<?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-20220425.xsd" xlink:type="simple"/>
    <context id="Duration_4_25_2022_To_4_25_2022_1W9GbXJJ8kCeY5t1Pulj3Q">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0000912767</identifier>
        </entity>
        <period>
            <startDate>2022-04-25</startDate>
            <endDate>2022-04-25</endDate>
        </period>
    </context>
    <dei:EntityCentralIndexKey
      contextRef="Duration_4_25_2022_To_4_25_2022_1W9GbXJJ8kCeY5t1Pulj3Q"
      id="Tc_wpygDvTIcUKO5CCLzJ6ffw_2_1">0000912767</dei:EntityCentralIndexKey>
    <dei:AmendmentFlag
      contextRef="Duration_4_25_2022_To_4_25_2022_1W9GbXJJ8kCeY5t1Pulj3Q"
      id="Tc_9pbnTCNaYkS0WzWf3Or4wQ_3_1">false</dei:AmendmentFlag>
    <dei:DocumentType
      contextRef="Duration_4_25_2022_To_4_25_2022_1W9GbXJJ8kCeY5t1Pulj3Q"
      id="Narr_TRkyrYAmYk2vN7kSh6O4eg">8-K</dei:DocumentType>
    <dei:DocumentPeriodEndDate
      contextRef="Duration_4_25_2022_To_4_25_2022_1W9GbXJJ8kCeY5t1Pulj3Q"
      id="Narr_GUnTGHXBRkyWgl2IVlkRdQ">2022-04-25</dei:DocumentPeriodEndDate>
    <dei:EntityRegistrantName
      contextRef="Duration_4_25_2022_To_4_25_2022_1W9GbXJJ8kCeY5t1Pulj3Q"
      id="Narr_SJ7zu5nEmkuVMiFuuqbSfw">UFP INDUSTRIES, INC.</dei:EntityRegistrantName>
    <dei:EntityIncorporationStateCountryCode
      contextRef="Duration_4_25_2022_To_4_25_2022_1W9GbXJJ8kCeY5t1Pulj3Q"
      id="Narr__uwRInaiXkCnsAFugaTAsg">MI</dei:EntityIncorporationStateCountryCode>
    <dei:EntityFileNumber
      contextRef="Duration_4_25_2022_To_4_25_2022_1W9GbXJJ8kCeY5t1Pulj3Q"
      id="Narr_YFIALTF0-kGjY0bEY3_raw">0-22684</dei:EntityFileNumber>
    <dei:EntityTaxIdentificationNumber
      contextRef="Duration_4_25_2022_To_4_25_2022_1W9GbXJJ8kCeY5t1Pulj3Q"
      id="Narr_OiY_yv0WWkqewmDSM7r0xA">38-1465835</dei:EntityTaxIdentificationNumber>
    <dei:EntityAddressAddressLine1
      contextRef="Duration_4_25_2022_To_4_25_2022_1W9GbXJJ8kCeY5t1Pulj3Q"
      id="Narr_j6HLKtBfT066GQEDESkt8w">2801 East Beltline, NE</dei:EntityAddressAddressLine1>
    <dei:EntityAddressCityOrTown
      contextRef="Duration_4_25_2022_To_4_25_2022_1W9GbXJJ8kCeY5t1Pulj3Q"
      id="Narr_dHgsV6J4jEu_c8e-0NoDpQ">Grand Rapids</dei:EntityAddressCityOrTown>
    <dei:EntityAddressStateOrProvince
      contextRef="Duration_4_25_2022_To_4_25_2022_1W9GbXJJ8kCeY5t1Pulj3Q"
      id="Narr_p1WmKkOZ0U2z21jJ4uhqJw">MI</dei:EntityAddressStateOrProvince>
    <dei:EntityAddressPostalZipCode
      contextRef="Duration_4_25_2022_To_4_25_2022_1W9GbXJJ8kCeY5t1Pulj3Q"
      id="Narr_n7oq-UO8uE6eGHqZFPsYbg">49525</dei:EntityAddressPostalZipCode>
    <dei:CityAreaCode
      contextRef="Duration_4_25_2022_To_4_25_2022_1W9GbXJJ8kCeY5t1Pulj3Q"
      id="Narr_hBA2YYel4kGXaqSgWVnuxQ">616</dei:CityAreaCode>
    <dei:LocalPhoneNumber
      contextRef="Duration_4_25_2022_To_4_25_2022_1W9GbXJJ8kCeY5t1Pulj3Q"
      id="Narr_ghOPZMyB40CMnwsSb5xebQ">364-6161</dei:LocalPhoneNumber>
    <dei:WrittenCommunications
      contextRef="Duration_4_25_2022_To_4_25_2022_1W9GbXJJ8kCeY5t1Pulj3Q"
      id="Narr_f0jwW10fekmXqSaIShv3dw">false</dei:WrittenCommunications>
    <dei:SolicitingMaterial
      contextRef="Duration_4_25_2022_To_4_25_2022_1W9GbXJJ8kCeY5t1Pulj3Q"
      id="Narr_62OjRmlJvEKAre8vuYHmug">false</dei:SolicitingMaterial>
    <dei:PreCommencementTenderOffer
      contextRef="Duration_4_25_2022_To_4_25_2022_1W9GbXJJ8kCeY5t1Pulj3Q"
      id="Narr_FgnKdleZsUi6sThGTN1riQ">false</dei:PreCommencementTenderOffer>
    <dei:PreCommencementIssuerTenderOffer
      contextRef="Duration_4_25_2022_To_4_25_2022_1W9GbXJJ8kCeY5t1Pulj3Q"
      id="Narr_I8T0osRip0-O5uO5R-5iPw">false</dei:PreCommencementIssuerTenderOffer>
    <dei:Security12bTitle
      contextRef="Duration_4_25_2022_To_4_25_2022_1W9GbXJJ8kCeY5t1Pulj3Q"
      id="Tc_JIIUmpFqDE-3rbOwSSYyAQ_2_0">Common Stock</dei:Security12bTitle>
    <dei:TradingSymbol
      contextRef="Duration_4_25_2022_To_4_25_2022_1W9GbXJJ8kCeY5t1Pulj3Q"
      id="Tc_IQC0nLzHUky84E8iNguCTA_2_1">UFPI</dei:TradingSymbol>
    <dei:SecurityExchangeName
      contextRef="Duration_4_25_2022_To_4_25_2022_1W9GbXJJ8kCeY5t1Pulj3Q"
      id="Narr_t_D7U5lRz0SZDZFQGcRwHQ">NASDAQ</dei:SecurityExchangeName>
    <dei:EntityEmergingGrowthCompany
      contextRef="Duration_4_25_2022_To_4_25_2022_1W9GbXJJ8kCeY5t1Pulj3Q"
      id="Narr_esWTViA-y0qji6HfVA4VHw">false</dei:EntityEmergingGrowthCompany>
</xbrl>
