<?xml version="1.0" encoding="utf-8"?>
<xbrl
  xmlns="http://www.xbrl.org/2003/instance"
  xmlns:dei="http://xbrl.sec.gov/dei/2022"
  xmlns:link="http://www.xbrl.org/2003/linkbase"
  xmlns:xlink="http://www.w3.org/1999/xlink">
    <link:schemaRef xlink:href="ufpi-20240424.xsd" xlink:type="simple"/>
    <context id="Duration_4_24_2024_To_4_24_2024_g-DLrca500ummZobfw-99Q">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0000912767</identifier>
        </entity>
        <period>
            <startDate>2024-04-24</startDate>
            <endDate>2024-04-24</endDate>
        </period>
    </context>
    <dei:EntityCentralIndexKey
      contextRef="Duration_4_24_2024_To_4_24_2024_g-DLrca500ummZobfw-99Q"
      id="Tc_NpNpnqjBX0eyX8qi5gYvfQ_2_1">0000912767</dei:EntityCentralIndexKey>
    <dei:AmendmentFlag
      contextRef="Duration_4_24_2024_To_4_24_2024_g-DLrca500ummZobfw-99Q"
      id="Tc_BJAILRircUGHlSAwUAPXQw_3_1">false</dei:AmendmentFlag>
    <dei:DocumentType
      contextRef="Duration_4_24_2024_To_4_24_2024_g-DLrca500ummZobfw-99Q"
      id="Narr_0Vn5U_eox0-iTbtvCAOuEQ">8-K</dei:DocumentType>
    <dei:DocumentPeriodEndDate
      contextRef="Duration_4_24_2024_To_4_24_2024_g-DLrca500ummZobfw-99Q"
      id="Narr_y6l7yuyRx0q6edDubPloiQ">2024-04-24</dei:DocumentPeriodEndDate>
    <dei:EntityRegistrantName
      contextRef="Duration_4_24_2024_To_4_24_2024_g-DLrca500ummZobfw-99Q"
      id="Narr_9RmRmuDiGUKkEhbjkfSxyw">UFP INDUSTRIES, INC.</dei:EntityRegistrantName>
    <dei:EntityIncorporationStateCountryCode
      contextRef="Duration_4_24_2024_To_4_24_2024_g-DLrca500ummZobfw-99Q"
      id="Narr_QxOLW3q6A0S8YA2FFZ3iuw">MI</dei:EntityIncorporationStateCountryCode>
    <dei:EntityFileNumber
      contextRef="Duration_4_24_2024_To_4_24_2024_g-DLrca500ummZobfw-99Q"
      id="Narr_NazLXYIH3k2qZXEjcSgdfw">0-22684</dei:EntityFileNumber>
    <dei:EntityTaxIdentificationNumber
      contextRef="Duration_4_24_2024_To_4_24_2024_g-DLrca500ummZobfw-99Q"
      id="Narr_sXVTMdBN60epmvV92eMJOg">38-1465835</dei:EntityTaxIdentificationNumber>
    <dei:EntityAddressAddressLine1
      contextRef="Duration_4_24_2024_To_4_24_2024_g-DLrca500ummZobfw-99Q"
      id="Narr_xgcPxM5ZoUGP1OTj92c4Lw">2801 East Beltline, NE</dei:EntityAddressAddressLine1>
    <dei:EntityAddressCityOrTown
      contextRef="Duration_4_24_2024_To_4_24_2024_g-DLrca500ummZobfw-99Q"
      id="Narr_pMjGlI1DpE2cfYWYJi21nQ">Grand Rapids</dei:EntityAddressCityOrTown>
    <dei:EntityAddressStateOrProvince
      contextRef="Duration_4_24_2024_To_4_24_2024_g-DLrca500ummZobfw-99Q"
      id="Narr_cWgk-wtsOUe2EcxJVgGy0Q">MI</dei:EntityAddressStateOrProvince>
    <dei:EntityAddressPostalZipCode
      contextRef="Duration_4_24_2024_To_4_24_2024_g-DLrca500ummZobfw-99Q"
      id="Narr_-NYO1fyFVkmfs5cp_wsesg">49525</dei:EntityAddressPostalZipCode>
    <dei:CityAreaCode
      contextRef="Duration_4_24_2024_To_4_24_2024_g-DLrca500ummZobfw-99Q"
      id="Narr_nEPlx6lxikWoufhlUUStig">616</dei:CityAreaCode>
    <dei:LocalPhoneNumber
      contextRef="Duration_4_24_2024_To_4_24_2024_g-DLrca500ummZobfw-99Q"
      id="Narr_0wy_D-ZDX0O9noiEpV2QVA">364-6161</dei:LocalPhoneNumber>
    <dei:WrittenCommunications
      contextRef="Duration_4_24_2024_To_4_24_2024_g-DLrca500ummZobfw-99Q"
      id="Narr_iQPuFN1dqE6L2ti7Tv-7fw">false</dei:WrittenCommunications>
    <dei:SolicitingMaterial
      contextRef="Duration_4_24_2024_To_4_24_2024_g-DLrca500ummZobfw-99Q"
      id="Narr_Y3C5JA13hki-G8-0pmHKBg">false</dei:SolicitingMaterial>
    <dei:PreCommencementTenderOffer
      contextRef="Duration_4_24_2024_To_4_24_2024_g-DLrca500ummZobfw-99Q"
      id="Narr_RxfKNI199UyODlL-W47V0A">false</dei:PreCommencementTenderOffer>
    <dei:PreCommencementIssuerTenderOffer
      contextRef="Duration_4_24_2024_To_4_24_2024_g-DLrca500ummZobfw-99Q"
      id="Narr_nv2fIlYZj0awnLpFRe_Bkw">false</dei:PreCommencementIssuerTenderOffer>
    <dei:Security12bTitle
      contextRef="Duration_4_24_2024_To_4_24_2024_g-DLrca500ummZobfw-99Q"
      id="Tc_v6dRUVPwLkGujcdNoEy7qQ_2_0">Common Stock</dei:Security12bTitle>
    <dei:TradingSymbol
      contextRef="Duration_4_24_2024_To_4_24_2024_g-DLrca500ummZobfw-99Q"
      id="Tc_sjYcRPDVVk-4PLHEHjKd7A_2_1">UFPI</dei:TradingSymbol>
    <dei:SecurityExchangeName
      contextRef="Duration_4_24_2024_To_4_24_2024_g-DLrca500ummZobfw-99Q"
      id="Narr_Lr2vgFYKxUGROBl_iRjErQ">NASDAQ</dei:SecurityExchangeName>
    <dei:EntityEmergingGrowthCompany
      contextRef="Duration_4_24_2024_To_4_24_2024_g-DLrca500ummZobfw-99Q"
      id="Narr_g_LwhqrJ5kypnwiCfhtH0g">false</dei:EntityEmergingGrowthCompany>
</xbrl>
