<?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-20240923.xsd" xlink:type="simple"/>
    <context id="Duration_9_23_2024_To_9_23_2024_L5oDgmlN90W3QiUeGTmX8Q">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0000912767</identifier>
        </entity>
        <period>
            <startDate>2024-09-23</startDate>
            <endDate>2024-09-23</endDate>
        </period>
    </context>
    <dei:EntityCentralIndexKey
      contextRef="Duration_9_23_2024_To_9_23_2024_L5oDgmlN90W3QiUeGTmX8Q"
      id="Tc_669ndXwUh0-M1aTjeVfCsA_2_1">0000912767</dei:EntityCentralIndexKey>
    <dei:AmendmentFlag
      contextRef="Duration_9_23_2024_To_9_23_2024_L5oDgmlN90W3QiUeGTmX8Q"
      id="Tc_VIC0hR7uMUSWz-3fw5vN7A_3_1">false</dei:AmendmentFlag>
    <dei:DocumentType
      contextRef="Duration_9_23_2024_To_9_23_2024_L5oDgmlN90W3QiUeGTmX8Q"
      id="Narr_gc3YJi1KRUO9QQOQ3bRzQg">8-K</dei:DocumentType>
    <dei:DocumentPeriodEndDate
      contextRef="Duration_9_23_2024_To_9_23_2024_L5oDgmlN90W3QiUeGTmX8Q"
      id="Narr_KnljHys7u0iu8pBfiMxVWg">2024-09-23</dei:DocumentPeriodEndDate>
    <dei:EntityRegistrantName
      contextRef="Duration_9_23_2024_To_9_23_2024_L5oDgmlN90W3QiUeGTmX8Q"
      id="Narr_KY_d_nb-SkSgrL-lhVrw2Q">UFP INDUSTRIES, INC.</dei:EntityRegistrantName>
    <dei:EntityIncorporationStateCountryCode
      contextRef="Duration_9_23_2024_To_9_23_2024_L5oDgmlN90W3QiUeGTmX8Q"
      id="Narr_Uwia7mco3UWhCSBWC8WXYQ">MI</dei:EntityIncorporationStateCountryCode>
    <dei:EntityFileNumber
      contextRef="Duration_9_23_2024_To_9_23_2024_L5oDgmlN90W3QiUeGTmX8Q"
      id="Narr_hprUHlaw_E2EevIjUpjzkg">0-22684</dei:EntityFileNumber>
    <dei:EntityTaxIdentificationNumber
      contextRef="Duration_9_23_2024_To_9_23_2024_L5oDgmlN90W3QiUeGTmX8Q"
      id="Narr_38ottWllyU6q9RFHr_9ilg">38-1465835</dei:EntityTaxIdentificationNumber>
    <dei:EntityAddressAddressLine1
      contextRef="Duration_9_23_2024_To_9_23_2024_L5oDgmlN90W3QiUeGTmX8Q"
      id="Narr_ML_qzOg0z0qcoJa9Kugq3A">2801 East Beltline, NE </dei:EntityAddressAddressLine1>
    <dei:EntityAddressCityOrTown
      contextRef="Duration_9_23_2024_To_9_23_2024_L5oDgmlN90W3QiUeGTmX8Q"
      id="Narr_po92TbQ4S0i1b4bGcIMuOg">Grand Rapids</dei:EntityAddressCityOrTown>
    <dei:EntityAddressStateOrProvince
      contextRef="Duration_9_23_2024_To_9_23_2024_L5oDgmlN90W3QiUeGTmX8Q"
      id="Narr_jJkIiMB-E0Sf0aZX_oECww">MI</dei:EntityAddressStateOrProvince>
    <dei:EntityAddressPostalZipCode
      contextRef="Duration_9_23_2024_To_9_23_2024_L5oDgmlN90W3QiUeGTmX8Q"
      id="Narr_ymi7tuGVfEKQGi5nOzJIZA">49525</dei:EntityAddressPostalZipCode>
    <dei:CityAreaCode
      contextRef="Duration_9_23_2024_To_9_23_2024_L5oDgmlN90W3QiUeGTmX8Q"
      id="Narr_RUJAwnXm9EuTzjUiZX_2NA">616</dei:CityAreaCode>
    <dei:LocalPhoneNumber
      contextRef="Duration_9_23_2024_To_9_23_2024_L5oDgmlN90W3QiUeGTmX8Q"
      id="Narr_L9-dscXzOUuzuieLIDmmoA">364-6161</dei:LocalPhoneNumber>
    <dei:WrittenCommunications
      contextRef="Duration_9_23_2024_To_9_23_2024_L5oDgmlN90W3QiUeGTmX8Q"
      id="Narr_fRvizrILE0mn3qJqnQYaXw">false</dei:WrittenCommunications>
    <dei:SolicitingMaterial
      contextRef="Duration_9_23_2024_To_9_23_2024_L5oDgmlN90W3QiUeGTmX8Q"
      id="Narr_0M6DuQdNik6xUj4EkcAu6g">false</dei:SolicitingMaterial>
    <dei:PreCommencementTenderOffer
      contextRef="Duration_9_23_2024_To_9_23_2024_L5oDgmlN90W3QiUeGTmX8Q"
      id="Narr_lX9K7teP50GlyXKasKomMQ">false</dei:PreCommencementTenderOffer>
    <dei:PreCommencementIssuerTenderOffer
      contextRef="Duration_9_23_2024_To_9_23_2024_L5oDgmlN90W3QiUeGTmX8Q"
      id="Narr_6zmlsTIEp0il8HNxXSwQrQ">false</dei:PreCommencementIssuerTenderOffer>
    <dei:Security12bTitle
      contextRef="Duration_9_23_2024_To_9_23_2024_L5oDgmlN90W3QiUeGTmX8Q"
      id="Tc__pcht1-Aak6KkC1pnX0E8g_2_0">Common Stock</dei:Security12bTitle>
    <dei:TradingSymbol
      contextRef="Duration_9_23_2024_To_9_23_2024_L5oDgmlN90W3QiUeGTmX8Q"
      id="Tc_VB_Nr_v3cUiK-bN628iczg_2_1">UFPI</dei:TradingSymbol>
    <dei:SecurityExchangeName
      contextRef="Duration_9_23_2024_To_9_23_2024_L5oDgmlN90W3QiUeGTmX8Q"
      id="Narr_DOtfa3ozSkCua2os4_pLIw">NASDAQ</dei:SecurityExchangeName>
    <dei:EntityEmergingGrowthCompany
      contextRef="Duration_9_23_2024_To_9_23_2024_L5oDgmlN90W3QiUeGTmX8Q"
      id="Narr_l7tvLjM7K06ZLWsp9pu3bQ">false</dei:EntityEmergingGrowthCompany>
</xbrl>
