<?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-20230203.xsd" xlink:type="simple"/>
    <context id="Duration_2_3_2023_To_2_3_2023_VmvPvVFIE0eki-oDvtL9pQ">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0000912767</identifier>
        </entity>
        <period>
            <startDate>2023-02-03</startDate>
            <endDate>2023-02-03</endDate>
        </period>
    </context>
    <dei:EntityCentralIndexKey
      contextRef="Duration_2_3_2023_To_2_3_2023_VmvPvVFIE0eki-oDvtL9pQ"
      id="Tc_U6FiCn_VhkerPWnxleiovA_2_1">0000912767</dei:EntityCentralIndexKey>
    <dei:AmendmentFlag
      contextRef="Duration_2_3_2023_To_2_3_2023_VmvPvVFIE0eki-oDvtL9pQ"
      id="Tc_3AFidS8kD0O-x-XvDC07Ww_3_1">false</dei:AmendmentFlag>
    <dei:DocumentType
      contextRef="Duration_2_3_2023_To_2_3_2023_VmvPvVFIE0eki-oDvtL9pQ"
      id="Narr_l5weI9m580ulV2xQdFXJhA">8-K</dei:DocumentType>
    <dei:DocumentPeriodEndDate
      contextRef="Duration_2_3_2023_To_2_3_2023_VmvPvVFIE0eki-oDvtL9pQ"
      id="Narr_x6WtqtyOEE-XoLnR6qjLLQ">2023-02-03</dei:DocumentPeriodEndDate>
    <dei:EntityRegistrantName
      contextRef="Duration_2_3_2023_To_2_3_2023_VmvPvVFIE0eki-oDvtL9pQ"
      id="Narr_DTNr_UVDkESBQrBJczohjg">UFP INDUSTRIES, INC.</dei:EntityRegistrantName>
    <dei:EntityIncorporationStateCountryCode
      contextRef="Duration_2_3_2023_To_2_3_2023_VmvPvVFIE0eki-oDvtL9pQ"
      id="Narr_joJS4INaIU27iJU0KXAgOg">MI</dei:EntityIncorporationStateCountryCode>
    <dei:EntityFileNumber
      contextRef="Duration_2_3_2023_To_2_3_2023_VmvPvVFIE0eki-oDvtL9pQ"
      id="Narr_mzPvDBFOiEq2rF82uFy6Hw">0-22684</dei:EntityFileNumber>
    <dei:EntityTaxIdentificationNumber
      contextRef="Duration_2_3_2023_To_2_3_2023_VmvPvVFIE0eki-oDvtL9pQ"
      id="Narr_Clu98Mgy1kS3Q_nMVtAdXg">38-1465835</dei:EntityTaxIdentificationNumber>
    <dei:EntityAddressAddressLine1
      contextRef="Duration_2_3_2023_To_2_3_2023_VmvPvVFIE0eki-oDvtL9pQ"
      id="Narr_vVJFw6VFMUyB37rtZNfy9Q">2801 East Beltline, NE</dei:EntityAddressAddressLine1>
    <dei:EntityAddressCityOrTown
      contextRef="Duration_2_3_2023_To_2_3_2023_VmvPvVFIE0eki-oDvtL9pQ"
      id="Narr_drQsq8H4PUqcg7WeWNr_3A">Grand Rapids</dei:EntityAddressCityOrTown>
    <dei:EntityAddressStateOrProvince
      contextRef="Duration_2_3_2023_To_2_3_2023_VmvPvVFIE0eki-oDvtL9pQ"
      id="Narr_61ZNgo3tiU2UJ4DervNqrA">MI</dei:EntityAddressStateOrProvince>
    <dei:EntityAddressPostalZipCode
      contextRef="Duration_2_3_2023_To_2_3_2023_VmvPvVFIE0eki-oDvtL9pQ"
      id="Narr_nVrwhsWVt0-z92Uh0bnqiw">49525</dei:EntityAddressPostalZipCode>
    <dei:CityAreaCode
      contextRef="Duration_2_3_2023_To_2_3_2023_VmvPvVFIE0eki-oDvtL9pQ"
      id="Narr_CrHQJWE1Ck-M6YHro0wnTg">616</dei:CityAreaCode>
    <dei:LocalPhoneNumber
      contextRef="Duration_2_3_2023_To_2_3_2023_VmvPvVFIE0eki-oDvtL9pQ"
      id="Narr_eJSvLIsadUuA9FwG7mzEwQ">364-6161</dei:LocalPhoneNumber>
    <dei:WrittenCommunications
      contextRef="Duration_2_3_2023_To_2_3_2023_VmvPvVFIE0eki-oDvtL9pQ"
      id="Narr_XpZ1ik0vXUWHhDodKGv_PA">false</dei:WrittenCommunications>
    <dei:SolicitingMaterial
      contextRef="Duration_2_3_2023_To_2_3_2023_VmvPvVFIE0eki-oDvtL9pQ"
      id="Narr_SPZbfJK7j0mKgG2O_Tr0AA">false</dei:SolicitingMaterial>
    <dei:PreCommencementTenderOffer
      contextRef="Duration_2_3_2023_To_2_3_2023_VmvPvVFIE0eki-oDvtL9pQ"
      id="Narr_zqoI6k1E70CvaWZi8c6k2g">false</dei:PreCommencementTenderOffer>
    <dei:PreCommencementIssuerTenderOffer
      contextRef="Duration_2_3_2023_To_2_3_2023_VmvPvVFIE0eki-oDvtL9pQ"
      id="Narr_iBc_dU5PRUa9bwrD9IezzA">false</dei:PreCommencementIssuerTenderOffer>
    <dei:Security12bTitle
      contextRef="Duration_2_3_2023_To_2_3_2023_VmvPvVFIE0eki-oDvtL9pQ"
      id="Tc_UrqWrDjphEKi3rqKtGNepA_2_0">Common Stock</dei:Security12bTitle>
    <dei:TradingSymbol
      contextRef="Duration_2_3_2023_To_2_3_2023_VmvPvVFIE0eki-oDvtL9pQ"
      id="Tc_tfzYfDfN4E6FviybSKi_mg_2_1">UFPI</dei:TradingSymbol>
    <dei:SecurityExchangeName
      contextRef="Duration_2_3_2023_To_2_3_2023_VmvPvVFIE0eki-oDvtL9pQ"
      id="Narr_HaeI3cDkGUacC6bjXaNqhQ">NASDAQ</dei:SecurityExchangeName>
    <dei:EntityEmergingGrowthCompany
      contextRef="Duration_2_3_2023_To_2_3_2023_VmvPvVFIE0eki-oDvtL9pQ"
      id="Narr_CCGF2KEBUUuU9xAJLR6s5Q">false</dei:EntityEmergingGrowthCompany>
</xbrl>
