<?xml version="1.0" encoding="utf-8"?>
<xbrl
  xmlns="http://www.xbrl.org/2003/instance"
  xmlns:dei="http://xbrl.sec.gov/dei/2019-01-31"
  xmlns:link="http://www.xbrl.org/2003/linkbase"
  xmlns:xlink="http://www.w3.org/1999/xlink">
    <link:schemaRef xlink:href="ufpi-20210223.xsd" xlink:type="simple"/>
    <context id="Duration_11_16_2020_To_11_16_2020_1Lm7YE7FOE2eb0-G5JzKxQ">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0000912767</identifier>
        </entity>
        <period>
            <startDate>2020-11-16</startDate>
            <endDate>2020-11-16</endDate>
        </period>
    </context>
    <dei:EntityCentralIndexKey
      contextRef="Duration_11_16_2020_To_11_16_2020_1Lm7YE7FOE2eb0-G5JzKxQ"
      id="Tc_MozZbH8NE0SX13Kb3iYx5Q_2_1">0000912767</dei:EntityCentralIndexKey>
    <dei:AmendmentFlag
      contextRef="Duration_11_16_2020_To_11_16_2020_1Lm7YE7FOE2eb0-G5JzKxQ"
      id="Tc_FT11CTbNVE6t5VDBzbLuuA_3_1">false</dei:AmendmentFlag>
    <dei:DocumentType
      contextRef="Duration_11_16_2020_To_11_16_2020_1Lm7YE7FOE2eb0-G5JzKxQ"
      id="Narr_JvjU2xtYBUiNHzxch2ASIQ">8-K</dei:DocumentType>
    <dei:DocumentPeriodEndDate
      contextRef="Duration_11_16_2020_To_11_16_2020_1Lm7YE7FOE2eb0-G5JzKxQ"
      id="Narr_i_hz8JbUDUyTOe9yykEH1w">2021-02-23</dei:DocumentPeriodEndDate>
    <dei:EntityRegistrantName
      contextRef="Duration_11_16_2020_To_11_16_2020_1Lm7YE7FOE2eb0-G5JzKxQ"
      id="Narr_Z-5GK3uHL0WhbeZgaRPkgQ">UFP INDUSTRIES, INC.</dei:EntityRegistrantName>
    <dei:EntityIncorporationStateCountryCode
      contextRef="Duration_11_16_2020_To_11_16_2020_1Lm7YE7FOE2eb0-G5JzKxQ"
      id="Narr_8TTAOyORhEysgsy-2HPYOQ">MI</dei:EntityIncorporationStateCountryCode>
    <dei:EntityFileNumber
      contextRef="Duration_11_16_2020_To_11_16_2020_1Lm7YE7FOE2eb0-G5JzKxQ"
      id="Narr_5b29R91fWkqKp900IWZwrA">0-22684</dei:EntityFileNumber>
    <dei:EntityTaxIdentificationNumber
      contextRef="Duration_11_16_2020_To_11_16_2020_1Lm7YE7FOE2eb0-G5JzKxQ"
      id="Narr_aggWmaSWMku1IZ7-WUR04Q">38-1465835</dei:EntityTaxIdentificationNumber>
    <dei:EntityAddressAddressLine1
      contextRef="Duration_11_16_2020_To_11_16_2020_1Lm7YE7FOE2eb0-G5JzKxQ"
      id="Narr_ywbJGvL9dEW3BmQe76EP4A">2801 East Beltline, NE, Grand Rapids</dei:EntityAddressAddressLine1>
    <dei:EntityAddressCityOrTown
      contextRef="Duration_11_16_2020_To_11_16_2020_1Lm7YE7FOE2eb0-G5JzKxQ"
      id="Narr_f71F5AGnU0KQWzijIeiw6Q">, </dei:EntityAddressCityOrTown>
    <dei:EntityAddressStateOrProvince
      contextRef="Duration_11_16_2020_To_11_16_2020_1Lm7YE7FOE2eb0-G5JzKxQ"
      id="Narr_HPOERjCsr0K268aNRS7ufg">MI</dei:EntityAddressStateOrProvince>
    <dei:EntityAddressPostalZipCode
      contextRef="Duration_11_16_2020_To_11_16_2020_1Lm7YE7FOE2eb0-G5JzKxQ"
      id="Narr_DdrGmRYnQ0KgFbSGzy2X3A">49525</dei:EntityAddressPostalZipCode>
    <dei:CityAreaCode
      contextRef="Duration_11_16_2020_To_11_16_2020_1Lm7YE7FOE2eb0-G5JzKxQ"
      id="Narr_QOefYmMM3E-g4dCVR6BjiQ">616</dei:CityAreaCode>
    <dei:LocalPhoneNumber
      contextRef="Duration_11_16_2020_To_11_16_2020_1Lm7YE7FOE2eb0-G5JzKxQ"
      id="Narr_gYLI0qFP3kW_szba1BeJ4g">364-6161</dei:LocalPhoneNumber>
    <dei:WrittenCommunications
      contextRef="Duration_11_16_2020_To_11_16_2020_1Lm7YE7FOE2eb0-G5JzKxQ"
      id="Narr_YBhj2PjNXEaSWj3rImQOpQ">false</dei:WrittenCommunications>
    <dei:SolicitingMaterial
      contextRef="Duration_11_16_2020_To_11_16_2020_1Lm7YE7FOE2eb0-G5JzKxQ"
      id="Narr_DXP_a_FHw0KIn59-BK5Urw">false</dei:SolicitingMaterial>
    <dei:PreCommencementTenderOffer
      contextRef="Duration_11_16_2020_To_11_16_2020_1Lm7YE7FOE2eb0-G5JzKxQ"
      id="Narr_Fv7Bt-rb1UqtdWE227RelA">false</dei:PreCommencementTenderOffer>
    <dei:PreCommencementIssuerTenderOffer
      contextRef="Duration_11_16_2020_To_11_16_2020_1Lm7YE7FOE2eb0-G5JzKxQ"
      id="Narr_9O-AWDRakkWXEstr5ONVrA">false</dei:PreCommencementIssuerTenderOffer>
    <dei:Security12bTitle
      contextRef="Duration_11_16_2020_To_11_16_2020_1Lm7YE7FOE2eb0-G5JzKxQ"
      id="Tc_Ns8gd_mkFEK5w8KLw6fI0g_2_0">Common Stock</dei:Security12bTitle>
    <dei:TradingSymbol
      contextRef="Duration_11_16_2020_To_11_16_2020_1Lm7YE7FOE2eb0-G5JzKxQ"
      id="Tc_MPN6WLhrMUS4dM2nm_9w-A_2_1">UFPI</dei:TradingSymbol>
    <dei:SecurityExchangeName
      contextRef="Duration_11_16_2020_To_11_16_2020_1Lm7YE7FOE2eb0-G5JzKxQ"
      id="Narr_U3TclN88c066NZdbzIxn2Q">NASDAQ</dei:SecurityExchangeName>
    <dei:EntityEmergingGrowthCompany
      contextRef="Duration_11_16_2020_To_11_16_2020_1Lm7YE7FOE2eb0-G5JzKxQ"
      id="Narr_GRS0Bfhh6E-mEtg3Bkh-WQ">false</dei:EntityEmergingGrowthCompany>
</xbrl>
