<?xml version="1.0" encoding="utf-8"?>
<xbrl
  xmlns="http://www.xbrl.org/2003/instance"
  xmlns:dei="http://xbrl.sec.gov/dei/2020-01-31"
  xmlns:link="http://www.xbrl.org/2003/linkbase"
  xmlns:xlink="http://www.w3.org/1999/xlink">
    <link:schemaRef xlink:href="ufpi-20210721.xsd" xlink:type="simple"/>
    <context id="Duration_7_21_2021_To_7_21_2021_sI7g2SS810izqekxitpCDw">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0000912767</identifier>
        </entity>
        <period>
            <startDate>2021-07-21</startDate>
            <endDate>2021-07-21</endDate>
        </period>
    </context>
    <dei:EntityCentralIndexKey
      contextRef="Duration_7_21_2021_To_7_21_2021_sI7g2SS810izqekxitpCDw"
      id="Tc_XhUNbXNq6E2uXePzsyqtVg_2_1">0000912767</dei:EntityCentralIndexKey>
    <dei:AmendmentFlag
      contextRef="Duration_7_21_2021_To_7_21_2021_sI7g2SS810izqekxitpCDw"
      id="Tc_3vS3S3bnAkqhkgwVEhiNyA_3_1">false</dei:AmendmentFlag>
    <dei:DocumentType
      contextRef="Duration_7_21_2021_To_7_21_2021_sI7g2SS810izqekxitpCDw"
      id="Narr_QD3AQBbh6UOPBqSPsEFjTg">8-K</dei:DocumentType>
    <dei:DocumentPeriodEndDate
      contextRef="Duration_7_21_2021_To_7_21_2021_sI7g2SS810izqekxitpCDw"
      id="Narr_XWSMDEJ7XUWDmqiouQRwpw">2021-07-21</dei:DocumentPeriodEndDate>
    <dei:EntityRegistrantName
      contextRef="Duration_7_21_2021_To_7_21_2021_sI7g2SS810izqekxitpCDw"
      id="Narr_F5QMf-q04EOxl5-zworZpA">UFP INDUSTRIES, INC.</dei:EntityRegistrantName>
    <dei:EntityIncorporationStateCountryCode
      contextRef="Duration_7_21_2021_To_7_21_2021_sI7g2SS810izqekxitpCDw"
      id="Narr_HumJ1CSGQEaVhalyMZW0oQ">MI</dei:EntityIncorporationStateCountryCode>
    <dei:EntityFileNumber
      contextRef="Duration_7_21_2021_To_7_21_2021_sI7g2SS810izqekxitpCDw"
      id="Narr_VA5IgcDM3U6VLn6ugAgOjw">0-22684</dei:EntityFileNumber>
    <dei:EntityTaxIdentificationNumber
      contextRef="Duration_7_21_2021_To_7_21_2021_sI7g2SS810izqekxitpCDw"
      id="Narr_Le-GAAPqRUe6lW5Ia1Xx6Q">38-1465835</dei:EntityTaxIdentificationNumber>
    <dei:EntityAddressAddressLine1
      contextRef="Duration_7_21_2021_To_7_21_2021_sI7g2SS810izqekxitpCDw"
      id="Narr_KN2QGFLDhUOl7dMh0j6Tdg">2801 East Beltline, NE </dei:EntityAddressAddressLine1>
    <dei:EntityAddressCityOrTown
      contextRef="Duration_7_21_2021_To_7_21_2021_sI7g2SS810izqekxitpCDw"
      id="Narr_V2pwaAGVIke6tcjVIzsLEw">Grand Rapids</dei:EntityAddressCityOrTown>
    <dei:EntityAddressStateOrProvince
      contextRef="Duration_7_21_2021_To_7_21_2021_sI7g2SS810izqekxitpCDw"
      id="Narr__h8adwbxE0m1PWz4tvi-AQ">MI</dei:EntityAddressStateOrProvince>
    <dei:EntityAddressPostalZipCode
      contextRef="Duration_7_21_2021_To_7_21_2021_sI7g2SS810izqekxitpCDw"
      id="Narr_S48DIOSc8Eq1XSANgBvKfg">49525</dei:EntityAddressPostalZipCode>
    <dei:CityAreaCode
      contextRef="Duration_7_21_2021_To_7_21_2021_sI7g2SS810izqekxitpCDw"
      id="Narr_hpnSrLjpJE2LPpqTkS2QpA">616</dei:CityAreaCode>
    <dei:LocalPhoneNumber
      contextRef="Duration_7_21_2021_To_7_21_2021_sI7g2SS810izqekxitpCDw"
      id="Narr_7jI2flSpukK6h0u9dG0pmg">364-6161</dei:LocalPhoneNumber>
    <dei:WrittenCommunications
      contextRef="Duration_7_21_2021_To_7_21_2021_sI7g2SS810izqekxitpCDw"
      id="Narr_iVmw2cz1rk24S_2j43pfaQ">false</dei:WrittenCommunications>
    <dei:SolicitingMaterial
      contextRef="Duration_7_21_2021_To_7_21_2021_sI7g2SS810izqekxitpCDw"
      id="Narr_xeZnQ2kVXE-EaYRs312Giw">false</dei:SolicitingMaterial>
    <dei:PreCommencementTenderOffer
      contextRef="Duration_7_21_2021_To_7_21_2021_sI7g2SS810izqekxitpCDw"
      id="Narr_gm38HSdPm0iMTXKTazJVRA">false</dei:PreCommencementTenderOffer>
    <dei:PreCommencementIssuerTenderOffer
      contextRef="Duration_7_21_2021_To_7_21_2021_sI7g2SS810izqekxitpCDw"
      id="Narr_-VycW_ibeUiBfhTvpDT-FQ">false</dei:PreCommencementIssuerTenderOffer>
    <dei:Security12bTitle
      contextRef="Duration_7_21_2021_To_7_21_2021_sI7g2SS810izqekxitpCDw"
      id="Tc_H_WqUectCUmU-zvk4G3HcA_2_0">Common Stock</dei:Security12bTitle>
    <dei:TradingSymbol
      contextRef="Duration_7_21_2021_To_7_21_2021_sI7g2SS810izqekxitpCDw"
      id="Tc_nhVHEr2A7U6WvbDn0WnCig_2_1">UFPI</dei:TradingSymbol>
    <dei:SecurityExchangeName
      contextRef="Duration_7_21_2021_To_7_21_2021_sI7g2SS810izqekxitpCDw"
      id="Narr_ASxi2i8VTkKUkYoE-4-eDQ">NASDAQ</dei:SecurityExchangeName>
    <dei:EntityEmergingGrowthCompany
      contextRef="Duration_7_21_2021_To_7_21_2021_sI7g2SS810izqekxitpCDw"
      id="Narr__vOumrHY4ESFhpWlS-tvCA">false</dei:EntityEmergingGrowthCompany>
</xbrl>
