<?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-20210301.xsd" xlink:type="simple"/>
    <context id="Duration_3_1_2021_To_3_1_2021_0587sTE2BkSq70YWYID9qg">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0000912767</identifier>
        </entity>
        <period>
            <startDate>2021-03-01</startDate>
            <endDate>2021-03-01</endDate>
        </period>
    </context>
    <dei:EntityCentralIndexKey
      contextRef="Duration_3_1_2021_To_3_1_2021_0587sTE2BkSq70YWYID9qg"
      id="Tc_umMHEefIcEee6LMtR3phUA_2_1">0000912767</dei:EntityCentralIndexKey>
    <dei:AmendmentFlag
      contextRef="Duration_3_1_2021_To_3_1_2021_0587sTE2BkSq70YWYID9qg"
      id="Tc_AyjT-S9SEkK3BlDq3ylKJw_3_1">false</dei:AmendmentFlag>
    <dei:DocumentType
      contextRef="Duration_3_1_2021_To_3_1_2021_0587sTE2BkSq70YWYID9qg"
      id="Narr_g3GPpoGj806qoFIrxQIhyg">8-K</dei:DocumentType>
    <dei:DocumentPeriodEndDate
      contextRef="Duration_3_1_2021_To_3_1_2021_0587sTE2BkSq70YWYID9qg"
      id="Narr_kBxtZKbVfEGQTcvtcKZ6xA">2021-03-01</dei:DocumentPeriodEndDate>
    <dei:EntityRegistrantName
      contextRef="Duration_3_1_2021_To_3_1_2021_0587sTE2BkSq70YWYID9qg"
      id="Narr_CxuDTQSz50qoyPWQMBeY4Q">UFP INDUSTRIES, INC.</dei:EntityRegistrantName>
    <dei:EntityIncorporationStateCountryCode
      contextRef="Duration_3_1_2021_To_3_1_2021_0587sTE2BkSq70YWYID9qg"
      id="Narr_YJrAWykSOk-bLFYvmzSatA">MI</dei:EntityIncorporationStateCountryCode>
    <dei:EntityFileNumber
      contextRef="Duration_3_1_2021_To_3_1_2021_0587sTE2BkSq70YWYID9qg"
      id="Narr_R2PLFuHF1EK3tMxHa2s-LQ">0-22684</dei:EntityFileNumber>
    <dei:EntityTaxIdentificationNumber
      contextRef="Duration_3_1_2021_To_3_1_2021_0587sTE2BkSq70YWYID9qg"
      id="Narr_zlUtqmBzE0q45r2ftRgFvw">38-1465835</dei:EntityTaxIdentificationNumber>
    <dei:EntityAddressAddressLine1
      contextRef="Duration_3_1_2021_To_3_1_2021_0587sTE2BkSq70YWYID9qg"
      id="Narr_jRyWXofG40KFNdQR4PqyBA">2801 East Beltline, NE, Grand Rapids</dei:EntityAddressAddressLine1>
    <dei:EntityAddressCityOrTown
      contextRef="Duration_3_1_2021_To_3_1_2021_0587sTE2BkSq70YWYID9qg"
      id="Narr_OXO8VT2FjUy7Tz3RHOtYQg">, </dei:EntityAddressCityOrTown>
    <dei:EntityAddressStateOrProvince
      contextRef="Duration_3_1_2021_To_3_1_2021_0587sTE2BkSq70YWYID9qg"
      id="Narr_EOvQM1-ugUyvOx4ik5QNPQ">MI</dei:EntityAddressStateOrProvince>
    <dei:EntityAddressPostalZipCode
      contextRef="Duration_3_1_2021_To_3_1_2021_0587sTE2BkSq70YWYID9qg"
      id="Narr_bt2lxraEDkOUWYTefqGgIw">49525</dei:EntityAddressPostalZipCode>
    <dei:CityAreaCode
      contextRef="Duration_3_1_2021_To_3_1_2021_0587sTE2BkSq70YWYID9qg"
      id="Narr_ynnuttUs0kWuk9lZfXi8oQ">616</dei:CityAreaCode>
    <dei:LocalPhoneNumber
      contextRef="Duration_3_1_2021_To_3_1_2021_0587sTE2BkSq70YWYID9qg"
      id="Narr_aeG-0QAFUUSSzrih-P6v1w">364-6161</dei:LocalPhoneNumber>
    <dei:WrittenCommunications
      contextRef="Duration_3_1_2021_To_3_1_2021_0587sTE2BkSq70YWYID9qg"
      id="Narr_Q6-m8hoG20C7Xz0Xbbiu8A">false</dei:WrittenCommunications>
    <dei:SolicitingMaterial
      contextRef="Duration_3_1_2021_To_3_1_2021_0587sTE2BkSq70YWYID9qg"
      id="Narr_1o7L_r9VkEGHegXCCJ4mFA">false</dei:SolicitingMaterial>
    <dei:PreCommencementTenderOffer
      contextRef="Duration_3_1_2021_To_3_1_2021_0587sTE2BkSq70YWYID9qg"
      id="Narr_tYycT051OEepPDhfhbERxA">false</dei:PreCommencementTenderOffer>
    <dei:PreCommencementIssuerTenderOffer
      contextRef="Duration_3_1_2021_To_3_1_2021_0587sTE2BkSq70YWYID9qg"
      id="Narr_4vIevz3NJ0mpXYseqfhnLA">false</dei:PreCommencementIssuerTenderOffer>
    <dei:Security12bTitle
      contextRef="Duration_3_1_2021_To_3_1_2021_0587sTE2BkSq70YWYID9qg"
      id="Tc_O3O6jhWznk6DSf1Io8cZeQ_2_0">Common Stock</dei:Security12bTitle>
    <dei:TradingSymbol
      contextRef="Duration_3_1_2021_To_3_1_2021_0587sTE2BkSq70YWYID9qg"
      id="Tc_S-Ru8i4Q-kWKtbWwmy0jrg_2_1">UFPI</dei:TradingSymbol>
    <dei:SecurityExchangeName
      contextRef="Duration_3_1_2021_To_3_1_2021_0587sTE2BkSq70YWYID9qg"
      id="Narr_xTdwJIUd1USeb8666_Z69A">NASDAQ</dei:SecurityExchangeName>
    <dei:EntityEmergingGrowthCompany
      contextRef="Duration_3_1_2021_To_3_1_2021_0587sTE2BkSq70YWYID9qg"
      id="Narr_JmQeIQiAlUyO0HPXfTIyjg">false</dei:EntityEmergingGrowthCompany>
</xbrl>
