<?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-20240826.xsd" xlink:type="simple"/>
    <context id="Duration_8_27_2024_To_8_27_2024_38-tjSQQd02-HH5Ma8UpyQ">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0000912767</identifier>
        </entity>
        <period>
            <startDate>2024-08-27</startDate>
            <endDate>2024-08-27</endDate>
        </period>
    </context>
    <dei:EntityCentralIndexKey
      contextRef="Duration_8_27_2024_To_8_27_2024_38-tjSQQd02-HH5Ma8UpyQ"
      id="Tc_2sjNm0sZoUmcx6XztXYcNw_2_1">0000912767</dei:EntityCentralIndexKey>
    <dei:AmendmentFlag
      contextRef="Duration_8_27_2024_To_8_27_2024_38-tjSQQd02-HH5Ma8UpyQ"
      id="Tc_GtoAhydVak-BJhO7Cu1bLA_3_1">false</dei:AmendmentFlag>
    <dei:DocumentType
      contextRef="Duration_8_27_2024_To_8_27_2024_38-tjSQQd02-HH5Ma8UpyQ"
      id="Narr_ODphpZEfqEelg-bCHFZGkA">8-K</dei:DocumentType>
    <dei:DocumentPeriodEndDate
      contextRef="Duration_8_27_2024_To_8_27_2024_38-tjSQQd02-HH5Ma8UpyQ"
      id="Narr_tCp1bg51F0m1ALELHzeHFw">2024-08-27</dei:DocumentPeriodEndDate>
    <dei:EntityRegistrantName
      contextRef="Duration_8_27_2024_To_8_27_2024_38-tjSQQd02-HH5Ma8UpyQ"
      id="Narr_ToJXa0V7BEO6_7mBuCceoA">UFP INDUSTRIES, INC.</dei:EntityRegistrantName>
    <dei:EntityIncorporationStateCountryCode
      contextRef="Duration_8_27_2024_To_8_27_2024_38-tjSQQd02-HH5Ma8UpyQ"
      id="Narr_0pNvD86n3k6C7N9_Pugohw">MI</dei:EntityIncorporationStateCountryCode>
    <dei:EntityFileNumber
      contextRef="Duration_8_27_2024_To_8_27_2024_38-tjSQQd02-HH5Ma8UpyQ"
      id="Narr_93NEywhisEu4Q0rUFAyLRQ">0-22684</dei:EntityFileNumber>
    <dei:EntityTaxIdentificationNumber
      contextRef="Duration_8_27_2024_To_8_27_2024_38-tjSQQd02-HH5Ma8UpyQ"
      id="Narr_OmfbOpeeHUqv3wDHCMeFdw">38-1465835</dei:EntityTaxIdentificationNumber>
    <dei:EntityAddressAddressLine1
      contextRef="Duration_8_27_2024_To_8_27_2024_38-tjSQQd02-HH5Ma8UpyQ"
      id="Narr_JwaeQh2UCk-dmFxpGkJcqw">2801 East Beltline, NE </dei:EntityAddressAddressLine1>
    <dei:EntityAddressCityOrTown
      contextRef="Duration_8_27_2024_To_8_27_2024_38-tjSQQd02-HH5Ma8UpyQ"
      id="Narr_Pyan471qMkKBo0mdy4j4tA">Grand Rapids</dei:EntityAddressCityOrTown>
    <dei:EntityAddressStateOrProvince
      contextRef="Duration_8_27_2024_To_8_27_2024_38-tjSQQd02-HH5Ma8UpyQ"
      id="Narr_92N7FZPc7UORM99vNqCxPg">MI</dei:EntityAddressStateOrProvince>
    <dei:EntityAddressPostalZipCode
      contextRef="Duration_8_27_2024_To_8_27_2024_38-tjSQQd02-HH5Ma8UpyQ"
      id="Narr_CWE4GBXaNkqbven7PMKmxA">49525</dei:EntityAddressPostalZipCode>
    <dei:CityAreaCode
      contextRef="Duration_8_27_2024_To_8_27_2024_38-tjSQQd02-HH5Ma8UpyQ"
      id="Narr_R4oM3LckzUWTEE2RhqQPLA">616</dei:CityAreaCode>
    <dei:LocalPhoneNumber
      contextRef="Duration_8_27_2024_To_8_27_2024_38-tjSQQd02-HH5Ma8UpyQ"
      id="Narr_ghj4OThcckCrDXcSodhD3w">364-6161</dei:LocalPhoneNumber>
    <dei:WrittenCommunications
      contextRef="Duration_8_27_2024_To_8_27_2024_38-tjSQQd02-HH5Ma8UpyQ"
      id="Narr_7OuKjj9qC0mEk56xiU__Ug">false</dei:WrittenCommunications>
    <dei:SolicitingMaterial
      contextRef="Duration_8_27_2024_To_8_27_2024_38-tjSQQd02-HH5Ma8UpyQ"
      id="Narr_DH2bnzquREixn41OvrgfcQ">false</dei:SolicitingMaterial>
    <dei:PreCommencementTenderOffer
      contextRef="Duration_8_27_2024_To_8_27_2024_38-tjSQQd02-HH5Ma8UpyQ"
      id="Narr_Ba97U2izZkqpau8nUTc8Og">false</dei:PreCommencementTenderOffer>
    <dei:PreCommencementIssuerTenderOffer
      contextRef="Duration_8_27_2024_To_8_27_2024_38-tjSQQd02-HH5Ma8UpyQ"
      id="Narr_c7u9EAkW3EC4pEyVKZ_r9w">false</dei:PreCommencementIssuerTenderOffer>
    <dei:Security12bTitle
      contextRef="Duration_8_27_2024_To_8_27_2024_38-tjSQQd02-HH5Ma8UpyQ"
      id="Tc_pwbYIYu4cUOhxPTYEAQ4Aw_2_0">Common Stock</dei:Security12bTitle>
    <dei:TradingSymbol
      contextRef="Duration_8_27_2024_To_8_27_2024_38-tjSQQd02-HH5Ma8UpyQ"
      id="Tc_WAFB-Hn8FkeaPA56GPme1w_2_1">UFPI</dei:TradingSymbol>
    <dei:SecurityExchangeName
      contextRef="Duration_8_27_2024_To_8_27_2024_38-tjSQQd02-HH5Ma8UpyQ"
      id="Narr_6jg6JRLOH0Wo8J3DqU51Ug">NASDAQ</dei:SecurityExchangeName>
    <dei:EntityEmergingGrowthCompany
      contextRef="Duration_8_27_2024_To_8_27_2024_38-tjSQQd02-HH5Ma8UpyQ"
      id="Narr_0_W1IbMpFEexOMg8Xh3pcQ">false</dei:EntityEmergingGrowthCompany>
</xbrl>
