<?xml version="1.0" encoding="utf-8"?>
<xbrl
  xmlns="http://www.xbrl.org/2003/instance"
  xmlns:dei="http://xbrl.sec.gov/dei/2023"
  xmlns:link="http://www.xbrl.org/2003/linkbase"
  xmlns:xlink="http://www.w3.org/1999/xlink">
    <link:schemaRef xlink:href="ufpi-20240220.xsd" xlink:type="simple"/>
    <context id="Duration_2_20_2024_To_2_20_2024_ZcplGY0wRUGeQaYcJJ35qw">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0000912767</identifier>
        </entity>
        <period>
            <startDate>2024-02-20</startDate>
            <endDate>2024-02-20</endDate>
        </period>
    </context>
    <dei:EntityCentralIndexKey
      contextRef="Duration_2_20_2024_To_2_20_2024_ZcplGY0wRUGeQaYcJJ35qw"
      id="Tc_cpDexdhMpE-j_85A8VKDAg_2_1">0000912767</dei:EntityCentralIndexKey>
    <dei:AmendmentFlag
      contextRef="Duration_2_20_2024_To_2_20_2024_ZcplGY0wRUGeQaYcJJ35qw"
      id="Tc_gFQjdikId0i2oEhLesQt3A_3_1">false</dei:AmendmentFlag>
    <dei:DocumentType
      contextRef="Duration_2_20_2024_To_2_20_2024_ZcplGY0wRUGeQaYcJJ35qw"
      id="Narr_TlUu65F5xUuaaJz7b-Eayw">8-K</dei:DocumentType>
    <dei:DocumentPeriodEndDate
      contextRef="Duration_2_20_2024_To_2_20_2024_ZcplGY0wRUGeQaYcJJ35qw"
      id="Narr_DS4S7845SkSxEmzShEFaEw">2024-02-20</dei:DocumentPeriodEndDate>
    <dei:EntityRegistrantName
      contextRef="Duration_2_20_2024_To_2_20_2024_ZcplGY0wRUGeQaYcJJ35qw"
      id="Narr_hG9YZSvam0eP6VqCruMPjA">UFP INDUSTRIES, INC.</dei:EntityRegistrantName>
    <dei:EntityIncorporationStateCountryCode
      contextRef="Duration_2_20_2024_To_2_20_2024_ZcplGY0wRUGeQaYcJJ35qw"
      id="Narr_6N4a4cDbB0m0ykaDnxA4RA">MI</dei:EntityIncorporationStateCountryCode>
    <dei:EntityFileNumber
      contextRef="Duration_2_20_2024_To_2_20_2024_ZcplGY0wRUGeQaYcJJ35qw"
      id="Narr_nwznS-vYvU6gXEdrYgjhkA">0-22684</dei:EntityFileNumber>
    <dei:EntityTaxIdentificationNumber
      contextRef="Duration_2_20_2024_To_2_20_2024_ZcplGY0wRUGeQaYcJJ35qw"
      id="Narr_xOvmPoNubEa98l4woP2ugw">38-1465835</dei:EntityTaxIdentificationNumber>
    <dei:EntityAddressAddressLine1
      contextRef="Duration_2_20_2024_To_2_20_2024_ZcplGY0wRUGeQaYcJJ35qw"
      id="Narr_zRqkQYfnT0uxckxou80L4A">2801 East Beltline, NE </dei:EntityAddressAddressLine1>
    <dei:EntityAddressCityOrTown
      contextRef="Duration_2_20_2024_To_2_20_2024_ZcplGY0wRUGeQaYcJJ35qw"
      id="Narr_9rufv6WfjU25Qd136WSjXg">Grand Rapids</dei:EntityAddressCityOrTown>
    <dei:EntityAddressStateOrProvince
      contextRef="Duration_2_20_2024_To_2_20_2024_ZcplGY0wRUGeQaYcJJ35qw"
      id="Narr_7_izEV0CNEuBW7hKCYC7yA">MI</dei:EntityAddressStateOrProvince>
    <dei:EntityAddressPostalZipCode
      contextRef="Duration_2_20_2024_To_2_20_2024_ZcplGY0wRUGeQaYcJJ35qw"
      id="Narr_WbhW3ZGj_EGQZShJ09gkAw">49525</dei:EntityAddressPostalZipCode>
    <dei:CityAreaCode
      contextRef="Duration_2_20_2024_To_2_20_2024_ZcplGY0wRUGeQaYcJJ35qw"
      id="Narr_Vnlv-7vZbkCRi7TRaHzZ5g">616</dei:CityAreaCode>
    <dei:LocalPhoneNumber
      contextRef="Duration_2_20_2024_To_2_20_2024_ZcplGY0wRUGeQaYcJJ35qw"
      id="Narr_hWFmYNSZKEqomHVeJ2dtpQ">364-6161</dei:LocalPhoneNumber>
    <dei:WrittenCommunications
      contextRef="Duration_2_20_2024_To_2_20_2024_ZcplGY0wRUGeQaYcJJ35qw"
      id="Narr_WRvo2CSXk0qSJPwRkstCUA">false</dei:WrittenCommunications>
    <dei:SolicitingMaterial
      contextRef="Duration_2_20_2024_To_2_20_2024_ZcplGY0wRUGeQaYcJJ35qw"
      id="Narr_E15kOchWrUm79ceQB28jXg">false</dei:SolicitingMaterial>
    <dei:PreCommencementTenderOffer
      contextRef="Duration_2_20_2024_To_2_20_2024_ZcplGY0wRUGeQaYcJJ35qw"
      id="Narr_R3m0GpPWJ0WV4lw0YLj8qA">false</dei:PreCommencementTenderOffer>
    <dei:PreCommencementIssuerTenderOffer
      contextRef="Duration_2_20_2024_To_2_20_2024_ZcplGY0wRUGeQaYcJJ35qw"
      id="Narr_IaBFhnb7kkSX02HyqD9Rxw">false</dei:PreCommencementIssuerTenderOffer>
    <dei:Security12bTitle
      contextRef="Duration_2_20_2024_To_2_20_2024_ZcplGY0wRUGeQaYcJJ35qw"
      id="Tc_3wdTZXs98UiMK8DRKquLQQ_2_0">Common Stock</dei:Security12bTitle>
    <dei:TradingSymbol
      contextRef="Duration_2_20_2024_To_2_20_2024_ZcplGY0wRUGeQaYcJJ35qw"
      id="Tc_Wo_X_Q_v_U-NjxLpgRByjA_2_1">UFPI</dei:TradingSymbol>
    <dei:SecurityExchangeName
      contextRef="Duration_2_20_2024_To_2_20_2024_ZcplGY0wRUGeQaYcJJ35qw"
      id="Narr_paznZCf3uEKiQa0UckVTFw">NASDAQ</dei:SecurityExchangeName>
    <dei:EntityEmergingGrowthCompany
      contextRef="Duration_2_20_2024_To_2_20_2024_ZcplGY0wRUGeQaYcJJ35qw"
      id="Narr_QgWY8IDBs0S64lvF7ACkVA">false</dei:EntityEmergingGrowthCompany>
</xbrl>
