<?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-20241028.xsd" xlink:type="simple"/>
    <context id="Duration_10_28_2024_To_10_28_2024_-hzjGNrA10O6lQY0FL6OdQ">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0000912767</identifier>
        </entity>
        <period>
            <startDate>2024-10-28</startDate>
            <endDate>2024-10-28</endDate>
        </period>
    </context>
    <dei:EntityCentralIndexKey
      contextRef="Duration_10_28_2024_To_10_28_2024_-hzjGNrA10O6lQY0FL6OdQ"
      id="Tc_M4tR5Ry7dEub96BIZmcRlQ_2_1">0000912767</dei:EntityCentralIndexKey>
    <dei:AmendmentFlag
      contextRef="Duration_10_28_2024_To_10_28_2024_-hzjGNrA10O6lQY0FL6OdQ"
      id="Tc_oSfm_pexHEygIhU0_8f6Yg_3_1">false</dei:AmendmentFlag>
    <dei:DocumentType
      contextRef="Duration_10_28_2024_To_10_28_2024_-hzjGNrA10O6lQY0FL6OdQ"
      id="Narr_u9t-Uff1lkuFPGTbJrbvxw">8-K</dei:DocumentType>
    <dei:DocumentPeriodEndDate
      contextRef="Duration_10_28_2024_To_10_28_2024_-hzjGNrA10O6lQY0FL6OdQ"
      id="Narr_wwq8W55w_UKfcUMeIePNgA">2024-10-28</dei:DocumentPeriodEndDate>
    <dei:EntityRegistrantName
      contextRef="Duration_10_28_2024_To_10_28_2024_-hzjGNrA10O6lQY0FL6OdQ"
      id="Narr_KEA2qB4MvUqxSnrizPgo7A">UFP INDUSTRIES, INC.</dei:EntityRegistrantName>
    <dei:EntityIncorporationStateCountryCode
      contextRef="Duration_10_28_2024_To_10_28_2024_-hzjGNrA10O6lQY0FL6OdQ"
      id="Narr_asRLxEMTBEaVIdGJi1i-6w">MI</dei:EntityIncorporationStateCountryCode>
    <dei:EntityFileNumber
      contextRef="Duration_10_28_2024_To_10_28_2024_-hzjGNrA10O6lQY0FL6OdQ"
      id="Narr_C_mf-NY1wU2BYjH8feYDOw">0-22684</dei:EntityFileNumber>
    <dei:EntityTaxIdentificationNumber
      contextRef="Duration_10_28_2024_To_10_28_2024_-hzjGNrA10O6lQY0FL6OdQ"
      id="Narr_KwKi344DUUGv_grudqwVRQ">38-1465835</dei:EntityTaxIdentificationNumber>
    <dei:EntityAddressAddressLine1
      contextRef="Duration_10_28_2024_To_10_28_2024_-hzjGNrA10O6lQY0FL6OdQ"
      id="Narr_d8l--r0cxEypu1LdeT2m4w">2801 East Beltline, NE </dei:EntityAddressAddressLine1>
    <dei:EntityAddressCityOrTown
      contextRef="Duration_10_28_2024_To_10_28_2024_-hzjGNrA10O6lQY0FL6OdQ"
      id="Narr_gNIKIlasM0utQyjije4qog">Grand Rapids</dei:EntityAddressCityOrTown>
    <dei:EntityAddressStateOrProvince
      contextRef="Duration_10_28_2024_To_10_28_2024_-hzjGNrA10O6lQY0FL6OdQ"
      id="Narr_2buFOuiZRUuQZM5bJWLk_w">MI</dei:EntityAddressStateOrProvince>
    <dei:EntityAddressPostalZipCode
      contextRef="Duration_10_28_2024_To_10_28_2024_-hzjGNrA10O6lQY0FL6OdQ"
      id="Narr_v5E6dXbec0OO4pbSR85YFw">49525</dei:EntityAddressPostalZipCode>
    <dei:CityAreaCode
      contextRef="Duration_10_28_2024_To_10_28_2024_-hzjGNrA10O6lQY0FL6OdQ"
      id="Narr_Ylh02X0eEU-hkjZcdHW8SQ">616</dei:CityAreaCode>
    <dei:LocalPhoneNumber
      contextRef="Duration_10_28_2024_To_10_28_2024_-hzjGNrA10O6lQY0FL6OdQ"
      id="Narr_o5I5m_QWjU-W8r3AOFD0Dg">364-6161</dei:LocalPhoneNumber>
    <dei:WrittenCommunications
      contextRef="Duration_10_28_2024_To_10_28_2024_-hzjGNrA10O6lQY0FL6OdQ"
      id="Narr__HhKd3gvRUq-muxuC1f80Q">false</dei:WrittenCommunications>
    <dei:SolicitingMaterial
      contextRef="Duration_10_28_2024_To_10_28_2024_-hzjGNrA10O6lQY0FL6OdQ"
      id="Narr_pf0IwN8-_UaVMu-scXMj7g">false</dei:SolicitingMaterial>
    <dei:PreCommencementTenderOffer
      contextRef="Duration_10_28_2024_To_10_28_2024_-hzjGNrA10O6lQY0FL6OdQ"
      id="Narr_ZQMyWl61OkWz_BP9ZGIDbg">false</dei:PreCommencementTenderOffer>
    <dei:PreCommencementIssuerTenderOffer
      contextRef="Duration_10_28_2024_To_10_28_2024_-hzjGNrA10O6lQY0FL6OdQ"
      id="Narr_0cFP8uTQWUqMlvB56GOtVg">false</dei:PreCommencementIssuerTenderOffer>
    <dei:Security12bTitle
      contextRef="Duration_10_28_2024_To_10_28_2024_-hzjGNrA10O6lQY0FL6OdQ"
      id="Tc_tb5dM4r_6EyjDKiNXcJxlQ_2_0">Common Stock</dei:Security12bTitle>
    <dei:TradingSymbol
      contextRef="Duration_10_28_2024_To_10_28_2024_-hzjGNrA10O6lQY0FL6OdQ"
      id="Tc_mop4533LiEawIVbc1FqzEQ_2_1">UFPI</dei:TradingSymbol>
    <dei:SecurityExchangeName
      contextRef="Duration_10_28_2024_To_10_28_2024_-hzjGNrA10O6lQY0FL6OdQ"
      id="Narr_zpVAo8ivYE66Vp7yvAP3BQ">NASDAQ</dei:SecurityExchangeName>
    <dei:EntityEmergingGrowthCompany
      contextRef="Duration_10_28_2024_To_10_28_2024_-hzjGNrA10O6lQY0FL6OdQ"
      id="Narr_iVAiNhcJWUqpYGAf625Y9g">false</dei:EntityEmergingGrowthCompany>
</xbrl>
