<?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-20250213.xsd" xlink:type="simple"/>
    <context id="Duration_2_13_2025_To_2_13_2025_xOQ9MfF0S0qCYdeTpzvAuw">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0000912767</identifier>
        </entity>
        <period>
            <startDate>2025-02-13</startDate>
            <endDate>2025-02-13</endDate>
        </period>
    </context>
    <dei:EntityCentralIndexKey
      contextRef="Duration_2_13_2025_To_2_13_2025_xOQ9MfF0S0qCYdeTpzvAuw"
      id="Tc_ySny6SmKB02pH4Z1sNRshA_2_1">0000912767</dei:EntityCentralIndexKey>
    <dei:AmendmentFlag
      contextRef="Duration_2_13_2025_To_2_13_2025_xOQ9MfF0S0qCYdeTpzvAuw"
      id="Tc_tqD0D07hEUeSQJkqc52qRw_3_1">false</dei:AmendmentFlag>
    <dei:DocumentType
      contextRef="Duration_2_13_2025_To_2_13_2025_xOQ9MfF0S0qCYdeTpzvAuw"
      id="Narr_6Tye7wmZr0GAO2_9rSwNpw">8-K</dei:DocumentType>
    <dei:DocumentPeriodEndDate
      contextRef="Duration_2_13_2025_To_2_13_2025_xOQ9MfF0S0qCYdeTpzvAuw"
      id="Narr_U1yP_cd7mUWPKUTR9Pgi1Q">2025-02-13</dei:DocumentPeriodEndDate>
    <dei:EntityRegistrantName
      contextRef="Duration_2_13_2025_To_2_13_2025_xOQ9MfF0S0qCYdeTpzvAuw"
      id="Narr_mTGWqBUZYkaFJvlNbw7tDQ">UFP INDUSTRIES, INC.</dei:EntityRegistrantName>
    <dei:EntityIncorporationStateCountryCode
      contextRef="Duration_2_13_2025_To_2_13_2025_xOQ9MfF0S0qCYdeTpzvAuw"
      id="Narr_RaPDy6mMX0GJg62qdMfHLQ">MI</dei:EntityIncorporationStateCountryCode>
    <dei:EntityFileNumber
      contextRef="Duration_2_13_2025_To_2_13_2025_xOQ9MfF0S0qCYdeTpzvAuw"
      id="Narr_E7NYbJ9i_EuaBUKXS4-KDQ">0-22684</dei:EntityFileNumber>
    <dei:EntityTaxIdentificationNumber
      contextRef="Duration_2_13_2025_To_2_13_2025_xOQ9MfF0S0qCYdeTpzvAuw"
      id="Narr_ZUK5GW5a5EuFy99TdRkgOA">38-1465835</dei:EntityTaxIdentificationNumber>
    <dei:EntityAddressAddressLine1
      contextRef="Duration_2_13_2025_To_2_13_2025_xOQ9MfF0S0qCYdeTpzvAuw"
      id="Narr_KlPp38_bwUKtW86eEbu-bA">2801 East Beltline, NE </dei:EntityAddressAddressLine1>
    <dei:EntityAddressCityOrTown
      contextRef="Duration_2_13_2025_To_2_13_2025_xOQ9MfF0S0qCYdeTpzvAuw"
      id="Narr_oJWkXvyG70eD2XtOz6axaw">Grand Rapids</dei:EntityAddressCityOrTown>
    <dei:EntityAddressStateOrProvince
      contextRef="Duration_2_13_2025_To_2_13_2025_xOQ9MfF0S0qCYdeTpzvAuw"
      id="Narr_R9NwHA0dXUqlXIHedOXhmA">MI</dei:EntityAddressStateOrProvince>
    <dei:EntityAddressPostalZipCode
      contextRef="Duration_2_13_2025_To_2_13_2025_xOQ9MfF0S0qCYdeTpzvAuw"
      id="Narr_NwzqNhBDFkGq_2xr2mmUEQ">49525</dei:EntityAddressPostalZipCode>
    <dei:CityAreaCode
      contextRef="Duration_2_13_2025_To_2_13_2025_xOQ9MfF0S0qCYdeTpzvAuw"
      id="Narr_MtxCfqZz1Eyvgi3WYY6NKQ">616</dei:CityAreaCode>
    <dei:LocalPhoneNumber
      contextRef="Duration_2_13_2025_To_2_13_2025_xOQ9MfF0S0qCYdeTpzvAuw"
      id="Narr_dGwma-L_XEuxATs7GYp9NA">364-6161</dei:LocalPhoneNumber>
    <dei:WrittenCommunications
      contextRef="Duration_2_13_2025_To_2_13_2025_xOQ9MfF0S0qCYdeTpzvAuw"
      id="Narr_0nt3sqLONUmFEZCZ87pZ0A">false</dei:WrittenCommunications>
    <dei:SolicitingMaterial
      contextRef="Duration_2_13_2025_To_2_13_2025_xOQ9MfF0S0qCYdeTpzvAuw"
      id="Narr_6hvA4B7TLU6Bw-RsdGYkMg">false</dei:SolicitingMaterial>
    <dei:PreCommencementTenderOffer
      contextRef="Duration_2_13_2025_To_2_13_2025_xOQ9MfF0S0qCYdeTpzvAuw"
      id="Narr_86AOOzP-SkOXXpKiApy3jw">false</dei:PreCommencementTenderOffer>
    <dei:PreCommencementIssuerTenderOffer
      contextRef="Duration_2_13_2025_To_2_13_2025_xOQ9MfF0S0qCYdeTpzvAuw"
      id="Narr_x87kgiS1Rka15uy3Wo0bzg">false</dei:PreCommencementIssuerTenderOffer>
    <dei:Security12bTitle
      contextRef="Duration_2_13_2025_To_2_13_2025_xOQ9MfF0S0qCYdeTpzvAuw"
      id="Tc_JnxD8nmbxEqCPADsFtIu7A_2_0">Common Stock</dei:Security12bTitle>
    <dei:TradingSymbol
      contextRef="Duration_2_13_2025_To_2_13_2025_xOQ9MfF0S0qCYdeTpzvAuw"
      id="Tc_98WzRE6g3EGnCLvy6JQnEA_2_1">UFPI</dei:TradingSymbol>
    <dei:SecurityExchangeName
      contextRef="Duration_2_13_2025_To_2_13_2025_xOQ9MfF0S0qCYdeTpzvAuw"
      id="Narr_AHDi8wN3JUmDFyJpvoS4lg">NASDAQ</dei:SecurityExchangeName>
    <dei:EntityEmergingGrowthCompany
      contextRef="Duration_2_13_2025_To_2_13_2025_xOQ9MfF0S0qCYdeTpzvAuw"
      id="Narr_O2_YrdgCGEOeKs86o2iKCg">false</dei:EntityEmergingGrowthCompany>
</xbrl>
