<?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-20231108.xsd" xlink:type="simple"/>
    <context id="Duration_11_8_2023_To_11_8_2023_l54jYwUPXE6ARwLFCS_x6Q">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0000912767</identifier>
        </entity>
        <period>
            <startDate>2023-11-08</startDate>
            <endDate>2023-11-08</endDate>
        </period>
    </context>
    <dei:EntityCentralIndexKey
      contextRef="Duration_11_8_2023_To_11_8_2023_l54jYwUPXE6ARwLFCS_x6Q"
      id="Tc_upews9kG3kmcSLRYs1j-Lg_2_1">0000912767</dei:EntityCentralIndexKey>
    <dei:AmendmentFlag
      contextRef="Duration_11_8_2023_To_11_8_2023_l54jYwUPXE6ARwLFCS_x6Q"
      id="Tc_2Qf2G5Xe9ESwmstDV_-F5g_3_1">false</dei:AmendmentFlag>
    <dei:DocumentType
      contextRef="Duration_11_8_2023_To_11_8_2023_l54jYwUPXE6ARwLFCS_x6Q"
      id="Narr_sZu-TEdbzUylC8KaXDfPhA">8-K</dei:DocumentType>
    <dei:DocumentPeriodEndDate
      contextRef="Duration_11_8_2023_To_11_8_2023_l54jYwUPXE6ARwLFCS_x6Q"
      id="Narr_vliCzs5AbkCri05DVAyJHQ">2023-11-08</dei:DocumentPeriodEndDate>
    <dei:EntityRegistrantName
      contextRef="Duration_11_8_2023_To_11_8_2023_l54jYwUPXE6ARwLFCS_x6Q"
      id="Narr_qUIPMWjBQ0qFRHhBlRFb_Q">UFP INDUSTRIES, INC.</dei:EntityRegistrantName>
    <dei:EntityIncorporationStateCountryCode
      contextRef="Duration_11_8_2023_To_11_8_2023_l54jYwUPXE6ARwLFCS_x6Q"
      id="Narr_O6PpQRuxH0aTwk6gNHw7mg">MI</dei:EntityIncorporationStateCountryCode>
    <dei:EntityFileNumber
      contextRef="Duration_11_8_2023_To_11_8_2023_l54jYwUPXE6ARwLFCS_x6Q"
      id="Narr_Bn68o6Jsx0O6XDB9kz3znQ">0-22684</dei:EntityFileNumber>
    <dei:EntityTaxIdentificationNumber
      contextRef="Duration_11_8_2023_To_11_8_2023_l54jYwUPXE6ARwLFCS_x6Q"
      id="Narr_hciaiMXIL0OvscgXd3wFgw">38-1465835</dei:EntityTaxIdentificationNumber>
    <dei:EntityAddressAddressLine1
      contextRef="Duration_11_8_2023_To_11_8_2023_l54jYwUPXE6ARwLFCS_x6Q"
      id="Narr_CuKktsM0Y0iH9VBEe7AoHw">2801 East Beltline, NE</dei:EntityAddressAddressLine1>
    <dei:EntityAddressCityOrTown
      contextRef="Duration_11_8_2023_To_11_8_2023_l54jYwUPXE6ARwLFCS_x6Q"
      id="Narr_bnwDhP0zYEadKrySZ2AdCA">Grand Rapids</dei:EntityAddressCityOrTown>
    <dei:EntityAddressStateOrProvince
      contextRef="Duration_11_8_2023_To_11_8_2023_l54jYwUPXE6ARwLFCS_x6Q"
      id="Narr_B0W_0drQKkmOnVkmvLOPQA">MI</dei:EntityAddressStateOrProvince>
    <dei:EntityAddressPostalZipCode
      contextRef="Duration_11_8_2023_To_11_8_2023_l54jYwUPXE6ARwLFCS_x6Q"
      id="Narr_ARGLxaeo6k27YySQQIRbZg">49525</dei:EntityAddressPostalZipCode>
    <dei:CityAreaCode
      contextRef="Duration_11_8_2023_To_11_8_2023_l54jYwUPXE6ARwLFCS_x6Q"
      id="Narr_yQ_IEP0Zu0iMK8MqlBa6og">616</dei:CityAreaCode>
    <dei:LocalPhoneNumber
      contextRef="Duration_11_8_2023_To_11_8_2023_l54jYwUPXE6ARwLFCS_x6Q"
      id="Narr_JLA4L6BVeEOz97H1Oz4MIw">364-6161</dei:LocalPhoneNumber>
    <dei:WrittenCommunications
      contextRef="Duration_11_8_2023_To_11_8_2023_l54jYwUPXE6ARwLFCS_x6Q"
      id="Narr_L-NhfDNcgE61eVzRzl9F5g">false</dei:WrittenCommunications>
    <dei:SolicitingMaterial
      contextRef="Duration_11_8_2023_To_11_8_2023_l54jYwUPXE6ARwLFCS_x6Q"
      id="Narr_JYO7anqkD0C39yebe784zQ">false</dei:SolicitingMaterial>
    <dei:PreCommencementTenderOffer
      contextRef="Duration_11_8_2023_To_11_8_2023_l54jYwUPXE6ARwLFCS_x6Q"
      id="Narr_ZsBQP2GYSEiVVxk3H1oJCA">false</dei:PreCommencementTenderOffer>
    <dei:PreCommencementIssuerTenderOffer
      contextRef="Duration_11_8_2023_To_11_8_2023_l54jYwUPXE6ARwLFCS_x6Q"
      id="Narr_X7DNLZbDPk-fA5kKQdSiIg">false</dei:PreCommencementIssuerTenderOffer>
    <dei:Security12bTitle
      contextRef="Duration_11_8_2023_To_11_8_2023_l54jYwUPXE6ARwLFCS_x6Q"
      id="Tc_dXx2Z3_PFk63Ii0ULeeJ4A_2_0">Common Stock</dei:Security12bTitle>
    <dei:TradingSymbol
      contextRef="Duration_11_8_2023_To_11_8_2023_l54jYwUPXE6ARwLFCS_x6Q"
      id="Tc_qqHkwxk_nkCeBpEAI_E20A_2_1">UFPI</dei:TradingSymbol>
    <dei:SecurityExchangeName
      contextRef="Duration_11_8_2023_To_11_8_2023_l54jYwUPXE6ARwLFCS_x6Q"
      id="Narr_z-wE6NIu2UeRpgXEVfqEqg">NASDAQ</dei:SecurityExchangeName>
    <dei:EntityEmergingGrowthCompany
      contextRef="Duration_11_8_2023_To_11_8_2023_l54jYwUPXE6ARwLFCS_x6Q"
      id="Narr_tnAk9MiJNU-TtwM3TP1POg">false</dei:EntityEmergingGrowthCompany>
</xbrl>
