<?xml version="1.0" encoding="utf-8"?>
<xbrl
  xmlns="http://www.xbrl.org/2003/instance"
  xmlns:dei="http://xbrl.sec.gov/dei/2024"
  xmlns:link="http://www.xbrl.org/2003/linkbase"
  xmlns:xlink="http://www.w3.org/1999/xlink">
    <link:schemaRef xlink:href="ufpi-20240730.xsd" xlink:type="simple"/>
    <context id="Duration_7_30_2024_To_7_30_2024_DKFo2LMUTE2NupCBJmDUWg">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0000912767</identifier>
        </entity>
        <period>
            <startDate>2024-07-30</startDate>
            <endDate>2024-07-30</endDate>
        </period>
    </context>
    <dei:EntityCentralIndexKey
      contextRef="Duration_7_30_2024_To_7_30_2024_DKFo2LMUTE2NupCBJmDUWg"
      id="Tc_aWRbeQVBHUqoYAvg-j8bgA_2_1">0000912767</dei:EntityCentralIndexKey>
    <dei:AmendmentFlag
      contextRef="Duration_7_30_2024_To_7_30_2024_DKFo2LMUTE2NupCBJmDUWg"
      id="Tc_qhDzABgT4EKxX4IdLuj_fA_3_1">false</dei:AmendmentFlag>
    <dei:DocumentType
      contextRef="Duration_7_30_2024_To_7_30_2024_DKFo2LMUTE2NupCBJmDUWg"
      id="Narr__Ui5fA47GEObYn24-wuP8Q">8-K</dei:DocumentType>
    <dei:DocumentPeriodEndDate
      contextRef="Duration_7_30_2024_To_7_30_2024_DKFo2LMUTE2NupCBJmDUWg"
      id="Narr_oLEHZEQAQkajPOkNEa8gxw">2024-07-30</dei:DocumentPeriodEndDate>
    <dei:EntityRegistrantName
      contextRef="Duration_7_30_2024_To_7_30_2024_DKFo2LMUTE2NupCBJmDUWg"
      id="Narr_8cSupXt8bkGs3C4e41dj8w">UFP INDUSTRIES, INC.</dei:EntityRegistrantName>
    <dei:EntityIncorporationStateCountryCode
      contextRef="Duration_7_30_2024_To_7_30_2024_DKFo2LMUTE2NupCBJmDUWg"
      id="Narr_UcKnqDtvYUi_EgjFsQi5_A">MI</dei:EntityIncorporationStateCountryCode>
    <dei:EntityFileNumber
      contextRef="Duration_7_30_2024_To_7_30_2024_DKFo2LMUTE2NupCBJmDUWg"
      id="Narr_YHCvg9b1RUO-u8dmuweKBw">0-22684</dei:EntityFileNumber>
    <dei:EntityTaxIdentificationNumber
      contextRef="Duration_7_30_2024_To_7_30_2024_DKFo2LMUTE2NupCBJmDUWg"
      id="Narr_iDcYY7d5Oke-LBVChK_dlw">38-1465835</dei:EntityTaxIdentificationNumber>
    <dei:EntityAddressAddressLine1
      contextRef="Duration_7_30_2024_To_7_30_2024_DKFo2LMUTE2NupCBJmDUWg"
      id="Narr_-NYb0kZdX0Wps4jnrrUGZQ">2801 East Beltline, NE</dei:EntityAddressAddressLine1>
    <dei:EntityAddressCityOrTown
      contextRef="Duration_7_30_2024_To_7_30_2024_DKFo2LMUTE2NupCBJmDUWg"
      id="Narr_C7Tupmr4bUKCZJRJdfDpCA">Grand Rapids</dei:EntityAddressCityOrTown>
    <dei:EntityAddressStateOrProvince
      contextRef="Duration_7_30_2024_To_7_30_2024_DKFo2LMUTE2NupCBJmDUWg"
      id="Narr_AC4dEMZ7jU6lZilTGRC6IQ">MI</dei:EntityAddressStateOrProvince>
    <dei:EntityAddressPostalZipCode
      contextRef="Duration_7_30_2024_To_7_30_2024_DKFo2LMUTE2NupCBJmDUWg"
      id="Narr_nVXa_TStEkWukgRaSpA5cQ">49525</dei:EntityAddressPostalZipCode>
    <dei:CityAreaCode
      contextRef="Duration_7_30_2024_To_7_30_2024_DKFo2LMUTE2NupCBJmDUWg"
      id="Narr_oWkQ4Epqz0mGqIZjCRjsBA">616</dei:CityAreaCode>
    <dei:LocalPhoneNumber
      contextRef="Duration_7_30_2024_To_7_30_2024_DKFo2LMUTE2NupCBJmDUWg"
      id="Narr_MBpofLsw6E6ynpJ3OMJwcQ">364-6161</dei:LocalPhoneNumber>
    <dei:WrittenCommunications
      contextRef="Duration_7_30_2024_To_7_30_2024_DKFo2LMUTE2NupCBJmDUWg"
      id="Narr_kvMiaYjRIkupB-MyC7slTA">false</dei:WrittenCommunications>
    <dei:SolicitingMaterial
      contextRef="Duration_7_30_2024_To_7_30_2024_DKFo2LMUTE2NupCBJmDUWg"
      id="Narr_9a-9VQpURE2WbH0_Hp7y6g">false</dei:SolicitingMaterial>
    <dei:PreCommencementTenderOffer
      contextRef="Duration_7_30_2024_To_7_30_2024_DKFo2LMUTE2NupCBJmDUWg"
      id="Narr__EZatoCR3UuvrOFSaOdEcg">false</dei:PreCommencementTenderOffer>
    <dei:PreCommencementIssuerTenderOffer
      contextRef="Duration_7_30_2024_To_7_30_2024_DKFo2LMUTE2NupCBJmDUWg"
      id="Narr_GZLfW4BtH0GdBcNRAzpnLw">false</dei:PreCommencementIssuerTenderOffer>
    <dei:Security12bTitle
      contextRef="Duration_7_30_2024_To_7_30_2024_DKFo2LMUTE2NupCBJmDUWg"
      id="Tc_vViFgojP3kCnNhtQoz8_DQ_2_0">Common Stock</dei:Security12bTitle>
    <dei:TradingSymbol
      contextRef="Duration_7_30_2024_To_7_30_2024_DKFo2LMUTE2NupCBJmDUWg"
      id="Tc_Ihy9xuhj4Eqm5VEvgNUi5w_2_1">UFPI</dei:TradingSymbol>
    <dei:SecurityExchangeName
      contextRef="Duration_7_30_2024_To_7_30_2024_DKFo2LMUTE2NupCBJmDUWg"
      id="Narr_RZmnfIBBSEuJoy4lThuTpg">NASDAQ</dei:SecurityExchangeName>
    <dei:EntityEmergingGrowthCompany
      contextRef="Duration_7_30_2024_To_7_30_2024_DKFo2LMUTE2NupCBJmDUWg"
      id="Narr_Q204c-rYYU2D4pQn6D-G_Q">false</dei:EntityEmergingGrowthCompany>
</xbrl>
