<?xml version="1.0" encoding="utf-8"?>
<xbrl
  xmlns="http://www.xbrl.org/2003/instance"
  xmlns:dei="http://xbrl.sec.gov/dei/2021"
  xmlns:link="http://www.xbrl.org/2003/linkbase"
  xmlns:xlink="http://www.w3.org/1999/xlink">
    <link:schemaRef xlink:href="ufpi-20220216.xsd" xlink:type="simple"/>
    <context id="Duration_2_16_2022_To_2_16_2022_0Xjop6CL5kmgDHvNbJGQJw">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0000912767</identifier>
        </entity>
        <period>
            <startDate>2022-02-16</startDate>
            <endDate>2022-02-16</endDate>
        </period>
    </context>
    <dei:EntityCentralIndexKey
      contextRef="Duration_2_16_2022_To_2_16_2022_0Xjop6CL5kmgDHvNbJGQJw"
      id="Tc_WU-vjfXj1kOZXv_speBygQ_2_1">0000912767</dei:EntityCentralIndexKey>
    <dei:AmendmentFlag
      contextRef="Duration_2_16_2022_To_2_16_2022_0Xjop6CL5kmgDHvNbJGQJw"
      id="Tc_bSyE0ACR_0ujb8fljFb-Gg_3_1">false</dei:AmendmentFlag>
    <dei:DocumentType
      contextRef="Duration_2_16_2022_To_2_16_2022_0Xjop6CL5kmgDHvNbJGQJw"
      id="Narr_9wxv0pP-ake1ki5sYaviPw">8-K</dei:DocumentType>
    <dei:DocumentPeriodEndDate
      contextRef="Duration_2_16_2022_To_2_16_2022_0Xjop6CL5kmgDHvNbJGQJw"
      id="Narr_PxXu4cffMkiY8SDxuDouqA">2022-02-16</dei:DocumentPeriodEndDate>
    <dei:EntityRegistrantName
      contextRef="Duration_2_16_2022_To_2_16_2022_0Xjop6CL5kmgDHvNbJGQJw"
      id="Narr_NFtTC-3PHEud0xEJY13NwQ">UFP INDUSTRIES, INC.</dei:EntityRegistrantName>
    <dei:EntityIncorporationStateCountryCode
      contextRef="Duration_2_16_2022_To_2_16_2022_0Xjop6CL5kmgDHvNbJGQJw"
      id="Narr_RTQab1s1OUK_Mk76v2L1OQ">MI</dei:EntityIncorporationStateCountryCode>
    <dei:EntityFileNumber
      contextRef="Duration_2_16_2022_To_2_16_2022_0Xjop6CL5kmgDHvNbJGQJw"
      id="Narr_bl0CTjyBn0yzeKE9RWRsTA">0-22684</dei:EntityFileNumber>
    <dei:EntityTaxIdentificationNumber
      contextRef="Duration_2_16_2022_To_2_16_2022_0Xjop6CL5kmgDHvNbJGQJw"
      id="Narr_pMU4OyhGI0mAi2bF6cdd-Q">38-1465835</dei:EntityTaxIdentificationNumber>
    <dei:EntityAddressAddressLine1
      contextRef="Duration_2_16_2022_To_2_16_2022_0Xjop6CL5kmgDHvNbJGQJw"
      id="Narr_tJlOAVZQF0CxAzzO-KJ8Vw">2801 East Beltline, NE </dei:EntityAddressAddressLine1>
    <dei:EntityAddressCityOrTown
      contextRef="Duration_2_16_2022_To_2_16_2022_0Xjop6CL5kmgDHvNbJGQJw"
      id="Narr_OPpEoPrAU0eUQGzf75zmag">Grand Rapids</dei:EntityAddressCityOrTown>
    <dei:EntityAddressStateOrProvince
      contextRef="Duration_2_16_2022_To_2_16_2022_0Xjop6CL5kmgDHvNbJGQJw"
      id="Narr_wCDd4ahxukmYbXuHwfubKQ">MI</dei:EntityAddressStateOrProvince>
    <dei:EntityAddressPostalZipCode
      contextRef="Duration_2_16_2022_To_2_16_2022_0Xjop6CL5kmgDHvNbJGQJw"
      id="Narr_uSthNhm8Nkqf033RJ4RSwQ">49525</dei:EntityAddressPostalZipCode>
    <dei:CityAreaCode
      contextRef="Duration_2_16_2022_To_2_16_2022_0Xjop6CL5kmgDHvNbJGQJw"
      id="Narr_LeNY_CULF0u_G_VrZ5vJ3w">616</dei:CityAreaCode>
    <dei:LocalPhoneNumber
      contextRef="Duration_2_16_2022_To_2_16_2022_0Xjop6CL5kmgDHvNbJGQJw"
      id="Narr_tFVG7ltb3UquQCAghVZlMA">364-6161</dei:LocalPhoneNumber>
    <dei:WrittenCommunications
      contextRef="Duration_2_16_2022_To_2_16_2022_0Xjop6CL5kmgDHvNbJGQJw"
      id="Narr_vHc1MurDWkCnoltqF4aPHg">false</dei:WrittenCommunications>
    <dei:SolicitingMaterial
      contextRef="Duration_2_16_2022_To_2_16_2022_0Xjop6CL5kmgDHvNbJGQJw"
      id="Narr_fiZw1xC3W0qRL_wfBeySHw">false</dei:SolicitingMaterial>
    <dei:PreCommencementTenderOffer
      contextRef="Duration_2_16_2022_To_2_16_2022_0Xjop6CL5kmgDHvNbJGQJw"
      id="Narr_dZtcOLtUoEOj4C1xeDi3tA">false</dei:PreCommencementTenderOffer>
    <dei:PreCommencementIssuerTenderOffer
      contextRef="Duration_2_16_2022_To_2_16_2022_0Xjop6CL5kmgDHvNbJGQJw"
      id="Narr_IwWR1sTpt0yOLnZEAG_3Kw">false</dei:PreCommencementIssuerTenderOffer>
    <dei:Security12bTitle
      contextRef="Duration_2_16_2022_To_2_16_2022_0Xjop6CL5kmgDHvNbJGQJw"
      id="Tc_7bjlQTnHd0K4VOM3y54VAA_2_0">Common Stock</dei:Security12bTitle>
    <dei:TradingSymbol
      contextRef="Duration_2_16_2022_To_2_16_2022_0Xjop6CL5kmgDHvNbJGQJw"
      id="Tc_aBxWZgGi7EyIQoRZakDASA_2_1">UFPI</dei:TradingSymbol>
    <dei:SecurityExchangeName
      contextRef="Duration_2_16_2022_To_2_16_2022_0Xjop6CL5kmgDHvNbJGQJw"
      id="Narr_ED1I7ZeEtU-uujPsCNOFEQ">NASDAQ</dei:SecurityExchangeName>
    <dei:EntityEmergingGrowthCompany
      contextRef="Duration_2_16_2022_To_2_16_2022_0Xjop6CL5kmgDHvNbJGQJw"
      id="Narr_dgId-2oFQUCXGw6VPEuo-A">false</dei:EntityEmergingGrowthCompany>
</xbrl>
