<?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-20220810.xsd" xlink:type="simple"/>
    <context id="Duration_8_10_2022_To_8_10_2022_Xtlizto1gE-xcLDtpAsb1w">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0000912767</identifier>
        </entity>
        <period>
            <startDate>2022-08-10</startDate>
            <endDate>2022-08-10</endDate>
        </period>
    </context>
    <dei:EntityCentralIndexKey
      contextRef="Duration_8_10_2022_To_8_10_2022_Xtlizto1gE-xcLDtpAsb1w"
      id="Tc_PPTJdTVxRkSoT5shGPChBg_2_1">0000912767</dei:EntityCentralIndexKey>
    <dei:AmendmentFlag
      contextRef="Duration_8_10_2022_To_8_10_2022_Xtlizto1gE-xcLDtpAsb1w"
      id="Tc_tzWd1NE3IEq53XxbUjZsHg_3_1">false</dei:AmendmentFlag>
    <dei:DocumentType
      contextRef="Duration_8_10_2022_To_8_10_2022_Xtlizto1gE-xcLDtpAsb1w"
      id="Narr_wjwqtYDbJEqBYMLVlQQ0NA">8-K</dei:DocumentType>
    <dei:DocumentPeriodEndDate
      contextRef="Duration_8_10_2022_To_8_10_2022_Xtlizto1gE-xcLDtpAsb1w"
      id="Narr_URdB2txaA0WNA5zZQ7CjQQ">2022-08-10</dei:DocumentPeriodEndDate>
    <dei:EntityRegistrantName
      contextRef="Duration_8_10_2022_To_8_10_2022_Xtlizto1gE-xcLDtpAsb1w"
      id="Narr_mSN5JewwyE-jbz9804ybog">UFP INDUSTRIES, INC.</dei:EntityRegistrantName>
    <dei:EntityIncorporationStateCountryCode
      contextRef="Duration_8_10_2022_To_8_10_2022_Xtlizto1gE-xcLDtpAsb1w"
      id="Narr_e-KIR29FuUyuAq5uIRyBrg">MI</dei:EntityIncorporationStateCountryCode>
    <dei:EntityFileNumber
      contextRef="Duration_8_10_2022_To_8_10_2022_Xtlizto1gE-xcLDtpAsb1w"
      id="Narr_bQTOExgwYUuOTaxiVeTVVA">0-22684</dei:EntityFileNumber>
    <dei:EntityTaxIdentificationNumber
      contextRef="Duration_8_10_2022_To_8_10_2022_Xtlizto1gE-xcLDtpAsb1w"
      id="Narr_d1C7UOsqokK45GkG1xhBXQ">38-1465835</dei:EntityTaxIdentificationNumber>
    <dei:EntityAddressAddressLine1
      contextRef="Duration_8_10_2022_To_8_10_2022_Xtlizto1gE-xcLDtpAsb1w"
      id="Narr_afrQfv7E4ESSYASknrnsuA">2801 East Beltline, NE</dei:EntityAddressAddressLine1>
    <dei:EntityAddressCityOrTown
      contextRef="Duration_8_10_2022_To_8_10_2022_Xtlizto1gE-xcLDtpAsb1w"
      id="Narr_GWjC_BIKLECXlvWfpSLVfA">Grand Rapids</dei:EntityAddressCityOrTown>
    <dei:EntityAddressStateOrProvince
      contextRef="Duration_8_10_2022_To_8_10_2022_Xtlizto1gE-xcLDtpAsb1w"
      id="Narr_e7gw9qF19EuMZEq9UOdVag">MI</dei:EntityAddressStateOrProvince>
    <dei:EntityAddressPostalZipCode
      contextRef="Duration_8_10_2022_To_8_10_2022_Xtlizto1gE-xcLDtpAsb1w"
      id="Narr_qhI0xAYMHku3lnV9i6VjUw">49525</dei:EntityAddressPostalZipCode>
    <dei:CityAreaCode
      contextRef="Duration_8_10_2022_To_8_10_2022_Xtlizto1gE-xcLDtpAsb1w"
      id="Narr_lJYn-KS6VU6ueJESOFg7cg">616</dei:CityAreaCode>
    <dei:LocalPhoneNumber
      contextRef="Duration_8_10_2022_To_8_10_2022_Xtlizto1gE-xcLDtpAsb1w"
      id="Narr_c6uAKs7HJE-Txz5FXNkp7A">364-6161</dei:LocalPhoneNumber>
    <dei:WrittenCommunications
      contextRef="Duration_8_10_2022_To_8_10_2022_Xtlizto1gE-xcLDtpAsb1w"
      id="Narr_42WQuLbRakGgNRQQ1VbLFQ">false</dei:WrittenCommunications>
    <dei:SolicitingMaterial
      contextRef="Duration_8_10_2022_To_8_10_2022_Xtlizto1gE-xcLDtpAsb1w"
      id="Narr_BpWpWMECoUODlRSZpaGxdw">false</dei:SolicitingMaterial>
    <dei:PreCommencementTenderOffer
      contextRef="Duration_8_10_2022_To_8_10_2022_Xtlizto1gE-xcLDtpAsb1w"
      id="Narr__dTBRCpFl023WbLTWjY6Xw">false</dei:PreCommencementTenderOffer>
    <dei:PreCommencementIssuerTenderOffer
      contextRef="Duration_8_10_2022_To_8_10_2022_Xtlizto1gE-xcLDtpAsb1w"
      id="Narr_wAJo3Loxh0mNd6NWeLAhHw">false</dei:PreCommencementIssuerTenderOffer>
    <dei:Security12bTitle
      contextRef="Duration_8_10_2022_To_8_10_2022_Xtlizto1gE-xcLDtpAsb1w"
      id="Tc_ororarI_dUOttQaXAIHlJQ_2_0">Common Stock</dei:Security12bTitle>
    <dei:TradingSymbol
      contextRef="Duration_8_10_2022_To_8_10_2022_Xtlizto1gE-xcLDtpAsb1w"
      id="Tc_vl2GDUmR9UKbn6-as79oCQ_2_1">UFPI</dei:TradingSymbol>
    <dei:SecurityExchangeName
      contextRef="Duration_8_10_2022_To_8_10_2022_Xtlizto1gE-xcLDtpAsb1w"
      id="Narr_Q6nPtvn6LUK9XizBMx7grg">NASDAQ</dei:SecurityExchangeName>
    <dei:EntityEmergingGrowthCompany
      contextRef="Duration_8_10_2022_To_8_10_2022_Xtlizto1gE-xcLDtpAsb1w"
      id="Narr___a2hgxDwkiSJsPj2z-7nA">false</dei:EntityEmergingGrowthCompany>
</xbrl>
