<?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-20210812.xsd" xlink:type="simple"/>
    <context id="Duration_8_12_2021_To_8_12_2021_Tq4kCkUbN0-GDdswl7fvaA">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0000912767</identifier>
        </entity>
        <period>
            <startDate>2021-08-12</startDate>
            <endDate>2021-08-12</endDate>
        </period>
    </context>
    <dei:EntityCentralIndexKey
      contextRef="Duration_8_12_2021_To_8_12_2021_Tq4kCkUbN0-GDdswl7fvaA"
      id="Tc_f5U54pZ_3U2xiFyD5trFhA_2_1">0000912767</dei:EntityCentralIndexKey>
    <dei:AmendmentFlag
      contextRef="Duration_8_12_2021_To_8_12_2021_Tq4kCkUbN0-GDdswl7fvaA"
      id="Tc_wjooIJLxcUa3Y92mLqK4yA_3_1">false</dei:AmendmentFlag>
    <dei:DocumentType
      contextRef="Duration_8_12_2021_To_8_12_2021_Tq4kCkUbN0-GDdswl7fvaA"
      id="Narr_1g9BEEGF00ONbkf0MqUHkg">8-K</dei:DocumentType>
    <dei:DocumentPeriodEndDate
      contextRef="Duration_8_12_2021_To_8_12_2021_Tq4kCkUbN0-GDdswl7fvaA"
      id="Narr_PyiPVfAekkmM_2TqsAGe9A">2021-08-12</dei:DocumentPeriodEndDate>
    <dei:EntityRegistrantName
      contextRef="Duration_8_12_2021_To_8_12_2021_Tq4kCkUbN0-GDdswl7fvaA"
      id="Narr_0W1C7SkQ6UusoxTM64sEzw">UFP INDUSTRIES, INC.</dei:EntityRegistrantName>
    <dei:EntityIncorporationStateCountryCode
      contextRef="Duration_8_12_2021_To_8_12_2021_Tq4kCkUbN0-GDdswl7fvaA"
      id="Narr_qmdMDxrTjUaj9MdOyMW02w">MI</dei:EntityIncorporationStateCountryCode>
    <dei:EntityFileNumber
      contextRef="Duration_8_12_2021_To_8_12_2021_Tq4kCkUbN0-GDdswl7fvaA"
      id="Narr_dnSeqgwekkyShph3vOWO3A">0-22684</dei:EntityFileNumber>
    <dei:EntityTaxIdentificationNumber
      contextRef="Duration_8_12_2021_To_8_12_2021_Tq4kCkUbN0-GDdswl7fvaA"
      id="Narr_FU0QepKN1E-PjEJyBffOUg">38-1465835</dei:EntityTaxIdentificationNumber>
    <dei:EntityAddressAddressLine1
      contextRef="Duration_8_12_2021_To_8_12_2021_Tq4kCkUbN0-GDdswl7fvaA"
      id="Narr_5t6_nUGTLEW-tS0SeNPTTg">2801 East Beltline, NE</dei:EntityAddressAddressLine1>
    <dei:EntityAddressCityOrTown
      contextRef="Duration_8_12_2021_To_8_12_2021_Tq4kCkUbN0-GDdswl7fvaA"
      id="Narr_5af9v6sU_E-ZO1Lmv18V4w">Grand Rapids</dei:EntityAddressCityOrTown>
    <dei:EntityAddressStateOrProvince
      contextRef="Duration_8_12_2021_To_8_12_2021_Tq4kCkUbN0-GDdswl7fvaA"
      id="Narr_Up76K7Bhv0aA-KrhtjIRfA">MI</dei:EntityAddressStateOrProvince>
    <dei:EntityAddressPostalZipCode
      contextRef="Duration_8_12_2021_To_8_12_2021_Tq4kCkUbN0-GDdswl7fvaA"
      id="Narr_3ZDprDgGkE64AiKYN_-_pw">49525</dei:EntityAddressPostalZipCode>
    <dei:CityAreaCode
      contextRef="Duration_8_12_2021_To_8_12_2021_Tq4kCkUbN0-GDdswl7fvaA"
      id="Narr_omwnj_7QcUaukfXxk6B1Hw">616</dei:CityAreaCode>
    <dei:LocalPhoneNumber
      contextRef="Duration_8_12_2021_To_8_12_2021_Tq4kCkUbN0-GDdswl7fvaA"
      id="Narr_6yGhv8_zPUaqWU2zw3vs8g">364-6161</dei:LocalPhoneNumber>
    <dei:WrittenCommunications
      contextRef="Duration_8_12_2021_To_8_12_2021_Tq4kCkUbN0-GDdswl7fvaA"
      id="Narr_x1pDo_8rykWdC7Mdke_a0g">false</dei:WrittenCommunications>
    <dei:SolicitingMaterial
      contextRef="Duration_8_12_2021_To_8_12_2021_Tq4kCkUbN0-GDdswl7fvaA"
      id="Narr_WvP9tU6DNEGXFpXK1eV-WQ">false</dei:SolicitingMaterial>
    <dei:PreCommencementTenderOffer
      contextRef="Duration_8_12_2021_To_8_12_2021_Tq4kCkUbN0-GDdswl7fvaA"
      id="Narr_jj1O0CpHc0ezlA-_pVYKBQ">false</dei:PreCommencementTenderOffer>
    <dei:PreCommencementIssuerTenderOffer
      contextRef="Duration_8_12_2021_To_8_12_2021_Tq4kCkUbN0-GDdswl7fvaA"
      id="Narr_KJfYlwg5kUuHMWowxdvikw">false</dei:PreCommencementIssuerTenderOffer>
    <dei:Security12bTitle
      contextRef="Duration_8_12_2021_To_8_12_2021_Tq4kCkUbN0-GDdswl7fvaA"
      id="Tc_-mB-9ClbsUC4o2UrXd9pMg_2_0">Common Stock</dei:Security12bTitle>
    <dei:TradingSymbol
      contextRef="Duration_8_12_2021_To_8_12_2021_Tq4kCkUbN0-GDdswl7fvaA"
      id="Tc_yyIntVHLEU6iS4sWFaJc6w_2_1">UFPI</dei:TradingSymbol>
    <dei:SecurityExchangeName
      contextRef="Duration_8_12_2021_To_8_12_2021_Tq4kCkUbN0-GDdswl7fvaA"
      id="Narr_L2oX8cShrk2_KtzRCuegbQ">NASDAQ</dei:SecurityExchangeName>
    <dei:EntityEmergingGrowthCompany
      contextRef="Duration_8_12_2021_To_8_12_2021_Tq4kCkUbN0-GDdswl7fvaA"
      id="Narr_bFPbFXQTx06bTU767EbGXw">false</dei:EntityEmergingGrowthCompany>
</xbrl>
