<?xml version="1.0" encoding="utf-8"?>
<xbrl
  xmlns="http://www.xbrl.org/2003/instance"
  xmlns:dei="http://xbrl.sec.gov/dei/2022"
  xmlns:link="http://www.xbrl.org/2003/linkbase"
  xmlns:xlink="http://www.w3.org/1999/xlink">
    <link:schemaRef xlink:href="ufpi-20221206.xsd" xlink:type="simple"/>
    <context id="Duration_12_6_2022_To_12_6_2022_RDTcNUN6KE6jDhzyIvKGVw">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0000912767</identifier>
        </entity>
        <period>
            <startDate>2022-12-06</startDate>
            <endDate>2022-12-06</endDate>
        </period>
    </context>
    <dei:EntityCentralIndexKey
      contextRef="Duration_12_6_2022_To_12_6_2022_RDTcNUN6KE6jDhzyIvKGVw"
      id="Tc_2KFw1fT-YkGxtQc6vLoKSA_2_1">0000912767</dei:EntityCentralIndexKey>
    <dei:AmendmentFlag
      contextRef="Duration_12_6_2022_To_12_6_2022_RDTcNUN6KE6jDhzyIvKGVw"
      id="Tc_1fsoDlrYkkiPlTgxnnA66g_3_1">false</dei:AmendmentFlag>
    <dei:DocumentType
      contextRef="Duration_12_6_2022_To_12_6_2022_RDTcNUN6KE6jDhzyIvKGVw"
      id="Narr_TBpmA6n4kkCMOs1-Y_n0_Q">8-K</dei:DocumentType>
    <dei:DocumentPeriodEndDate
      contextRef="Duration_12_6_2022_To_12_6_2022_RDTcNUN6KE6jDhzyIvKGVw"
      id="Narr_xY0yKPq1tkKZ2UpamB63Wg">2022-12-06</dei:DocumentPeriodEndDate>
    <dei:EntityRegistrantName
      contextRef="Duration_12_6_2022_To_12_6_2022_RDTcNUN6KE6jDhzyIvKGVw"
      id="Narr_m2cvFa5PqUuLjDghgBhVXA">UFP INDUSTRIES, INC.</dei:EntityRegistrantName>
    <dei:EntityIncorporationStateCountryCode
      contextRef="Duration_12_6_2022_To_12_6_2022_RDTcNUN6KE6jDhzyIvKGVw"
      id="Narr_Jnx_TlZEW06uaXZzcUAEtw">MI</dei:EntityIncorporationStateCountryCode>
    <dei:EntityFileNumber
      contextRef="Duration_12_6_2022_To_12_6_2022_RDTcNUN6KE6jDhzyIvKGVw"
      id="Narr_LyYzII437UugfO2EVN45aQ">0-22684</dei:EntityFileNumber>
    <dei:EntityTaxIdentificationNumber
      contextRef="Duration_12_6_2022_To_12_6_2022_RDTcNUN6KE6jDhzyIvKGVw"
      id="Narr_OADIdI_Nuk-xHeDyh7uMjQ">38-1465835</dei:EntityTaxIdentificationNumber>
    <dei:EntityAddressAddressLine1
      contextRef="Duration_12_6_2022_To_12_6_2022_RDTcNUN6KE6jDhzyIvKGVw"
      id="Narr_scJxlMf0jEOKy8Gp9AkRsA">2801 East Beltline, NE</dei:EntityAddressAddressLine1>
    <dei:EntityAddressCityOrTown
      contextRef="Duration_12_6_2022_To_12_6_2022_RDTcNUN6KE6jDhzyIvKGVw"
      id="Narr_2iDVqV9zZE2aLSTN0IAzdQ">Grand Rapids</dei:EntityAddressCityOrTown>
    <dei:EntityAddressStateOrProvince
      contextRef="Duration_12_6_2022_To_12_6_2022_RDTcNUN6KE6jDhzyIvKGVw"
      id="Narr_vnYZ1_S8FUqhV3_wwesLMw">MI</dei:EntityAddressStateOrProvince>
    <dei:EntityAddressPostalZipCode
      contextRef="Duration_12_6_2022_To_12_6_2022_RDTcNUN6KE6jDhzyIvKGVw"
      id="Narr_Guk6eJj5lUiWcknzKmMrGQ">49525</dei:EntityAddressPostalZipCode>
    <dei:CityAreaCode
      contextRef="Duration_12_6_2022_To_12_6_2022_RDTcNUN6KE6jDhzyIvKGVw"
      id="Narr_KYTNGq5-6kaQoCfk2Fw5vg">616</dei:CityAreaCode>
    <dei:LocalPhoneNumber
      contextRef="Duration_12_6_2022_To_12_6_2022_RDTcNUN6KE6jDhzyIvKGVw"
      id="Narr_dvnBGk_4kEaUCl162N_LiA">364-6161</dei:LocalPhoneNumber>
    <dei:WrittenCommunications
      contextRef="Duration_12_6_2022_To_12_6_2022_RDTcNUN6KE6jDhzyIvKGVw"
      id="Narr_b9Bi5cf03EieybVvGe29EQ">false</dei:WrittenCommunications>
    <dei:SolicitingMaterial
      contextRef="Duration_12_6_2022_To_12_6_2022_RDTcNUN6KE6jDhzyIvKGVw"
      id="Narr_vGxjTKTZvECsDZXnfKhb-w">false</dei:SolicitingMaterial>
    <dei:PreCommencementTenderOffer
      contextRef="Duration_12_6_2022_To_12_6_2022_RDTcNUN6KE6jDhzyIvKGVw"
      id="Narr_JETgMV64dEO18yoE4EWphQ">false</dei:PreCommencementTenderOffer>
    <dei:PreCommencementIssuerTenderOffer
      contextRef="Duration_12_6_2022_To_12_6_2022_RDTcNUN6KE6jDhzyIvKGVw"
      id="Narr_2eKN86Ofx0yTPw-9jCq7sg">false</dei:PreCommencementIssuerTenderOffer>
    <dei:Security12bTitle
      contextRef="Duration_12_6_2022_To_12_6_2022_RDTcNUN6KE6jDhzyIvKGVw"
      id="Tc_9dxywhT-okuEDJYTcKm3Xw_2_0">Common Stock</dei:Security12bTitle>
    <dei:TradingSymbol
      contextRef="Duration_12_6_2022_To_12_6_2022_RDTcNUN6KE6jDhzyIvKGVw"
      id="Tc_eeh4Je75b0u90m2mBlDuxw_2_1">UFPI</dei:TradingSymbol>
    <dei:SecurityExchangeName
      contextRef="Duration_12_6_2022_To_12_6_2022_RDTcNUN6KE6jDhzyIvKGVw"
      id="Narr_gvA8yZurokO2Fb5mcEZkjA">NASDAQ</dei:SecurityExchangeName>
    <dei:EntityEmergingGrowthCompany
      contextRef="Duration_12_6_2022_To_12_6_2022_RDTcNUN6KE6jDhzyIvKGVw"
      id="Narr_9L-Ti2I47U2-viwD_c0kOA">false</dei:EntityEmergingGrowthCompany>
</xbrl>
