<?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_HGDI59eqsUeh5ZQvP5Uj9Q">
        <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_HGDI59eqsUeh5ZQvP5Uj9Q"
      id="Tc_sFwQQ2t95EO6qusEK6MaYw_2_1">0000912767</dei:EntityCentralIndexKey>
    <dei:AmendmentFlag
      contextRef="Duration_7_30_2024_To_7_30_2024_HGDI59eqsUeh5ZQvP5Uj9Q"
      id="Tc_rfLs6XAgP0Od2qZrEdP5-Q_3_1">false</dei:AmendmentFlag>
    <dei:DocumentType
      contextRef="Duration_7_30_2024_To_7_30_2024_HGDI59eqsUeh5ZQvP5Uj9Q"
      id="Narr_9HktFMn-mUWlFW0xQSXV0w">8-K</dei:DocumentType>
    <dei:DocumentPeriodEndDate
      contextRef="Duration_7_30_2024_To_7_30_2024_HGDI59eqsUeh5ZQvP5Uj9Q"
      id="Narr_GWHgDghU2UKTBB676xsHCw">2024-07-30</dei:DocumentPeriodEndDate>
    <dei:EntityRegistrantName
      contextRef="Duration_7_30_2024_To_7_30_2024_HGDI59eqsUeh5ZQvP5Uj9Q"
      id="Narr_KfytpHaARUOYLsd9EVhIlA">UFP INDUSTRIES, INC.</dei:EntityRegistrantName>
    <dei:EntityIncorporationStateCountryCode
      contextRef="Duration_7_30_2024_To_7_30_2024_HGDI59eqsUeh5ZQvP5Uj9Q"
      id="Narr_SaZ9RL4zHk-jdtHTPo_U4A">MI</dei:EntityIncorporationStateCountryCode>
    <dei:EntityFileNumber
      contextRef="Duration_7_30_2024_To_7_30_2024_HGDI59eqsUeh5ZQvP5Uj9Q"
      id="Narr_CEdU96c7d0CpDzx9euMTCQ">0-22684</dei:EntityFileNumber>
    <dei:EntityTaxIdentificationNumber
      contextRef="Duration_7_30_2024_To_7_30_2024_HGDI59eqsUeh5ZQvP5Uj9Q"
      id="Narr_vH_RqUo6lkWYhDgsxQmbRA">38-1465835</dei:EntityTaxIdentificationNumber>
    <dei:EntityAddressAddressLine1
      contextRef="Duration_7_30_2024_To_7_30_2024_HGDI59eqsUeh5ZQvP5Uj9Q"
      id="Narr_7dnGJuoF7UCl2Sf52h1zBA">2801 East Beltline, NE </dei:EntityAddressAddressLine1>
    <dei:EntityAddressCityOrTown
      contextRef="Duration_7_30_2024_To_7_30_2024_HGDI59eqsUeh5ZQvP5Uj9Q"
      id="Narr_wUgbJzm6wkqaAiKOKU5Cqg">Grand Rapids</dei:EntityAddressCityOrTown>
    <dei:EntityAddressStateOrProvince
      contextRef="Duration_7_30_2024_To_7_30_2024_HGDI59eqsUeh5ZQvP5Uj9Q"
      id="Narr_R8yPmFZQZUuGuc3E2eyT0g">MI</dei:EntityAddressStateOrProvince>
    <dei:EntityAddressPostalZipCode
      contextRef="Duration_7_30_2024_To_7_30_2024_HGDI59eqsUeh5ZQvP5Uj9Q"
      id="Narr_35ZXtX_Jm0eSJKSzWorKiw">49525</dei:EntityAddressPostalZipCode>
    <dei:CityAreaCode
      contextRef="Duration_7_30_2024_To_7_30_2024_HGDI59eqsUeh5ZQvP5Uj9Q"
      id="Narr_KqX_Omu3xkmI5rLNNxJhrw">616</dei:CityAreaCode>
    <dei:LocalPhoneNumber
      contextRef="Duration_7_30_2024_To_7_30_2024_HGDI59eqsUeh5ZQvP5Uj9Q"
      id="Narr_8EiKesPxiE-Ei4dm-wXjMg">364-6161</dei:LocalPhoneNumber>
    <dei:WrittenCommunications
      contextRef="Duration_7_30_2024_To_7_30_2024_HGDI59eqsUeh5ZQvP5Uj9Q"
      id="Narr_9mhC73LGv0iWUe4BYfxx9g">false</dei:WrittenCommunications>
    <dei:SolicitingMaterial
      contextRef="Duration_7_30_2024_To_7_30_2024_HGDI59eqsUeh5ZQvP5Uj9Q"
      id="Narr_BV1odGM9XkKVLK5hGuX8tw">false</dei:SolicitingMaterial>
    <dei:PreCommencementTenderOffer
      contextRef="Duration_7_30_2024_To_7_30_2024_HGDI59eqsUeh5ZQvP5Uj9Q"
      id="Narr_oVjLUHIThU21q-KkE89QVw">false</dei:PreCommencementTenderOffer>
    <dei:PreCommencementIssuerTenderOffer
      contextRef="Duration_7_30_2024_To_7_30_2024_HGDI59eqsUeh5ZQvP5Uj9Q"
      id="Narr_fywrYnDx7UW8wQ3NPAujWA">false</dei:PreCommencementIssuerTenderOffer>
    <dei:Security12bTitle
      contextRef="Duration_7_30_2024_To_7_30_2024_HGDI59eqsUeh5ZQvP5Uj9Q"
      id="Tc_LiHUzSR0FkeuNi09FwwCtg_2_0">Common Stock</dei:Security12bTitle>
    <dei:TradingSymbol
      contextRef="Duration_7_30_2024_To_7_30_2024_HGDI59eqsUeh5ZQvP5Uj9Q"
      id="Tc_pdCcxh7fqkqQqcusEMn4xA_2_1">UFPI</dei:TradingSymbol>
    <dei:SecurityExchangeName
      contextRef="Duration_7_30_2024_To_7_30_2024_HGDI59eqsUeh5ZQvP5Uj9Q"
      id="Narr_2Nzeb8K8EESjyz-g-uRO6Q">NASDAQ</dei:SecurityExchangeName>
    <dei:EntityEmergingGrowthCompany
      contextRef="Duration_7_30_2024_To_7_30_2024_HGDI59eqsUeh5ZQvP5Uj9Q"
      id="Narr_Cvl6TLTAEE2nrtJYDLCgHA">false</dei:EntityEmergingGrowthCompany>
</xbrl>
