<?xml version="1.0" encoding="utf-8"?>
<xbrl
  xmlns="http://www.xbrl.org/2003/instance"
  xmlns:dei="http://xbrl.sec.gov/dei/2021"
  xmlns:link="http://www.xbrl.org/2003/linkbase"
  xmlns:xlink="http://www.w3.org/1999/xlink">
    <link:schemaRef xlink:href="ufpi-20211020.xsd" xlink:type="simple"/>
    <context id="Duration_10_20_2021_To_10_20_2021_fKyoG0n1BkqhAu-tNfe7WA">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0000912767</identifier>
        </entity>
        <period>
            <startDate>2021-10-20</startDate>
            <endDate>2021-10-20</endDate>
        </period>
    </context>
    <dei:EntityCentralIndexKey
      contextRef="Duration_10_20_2021_To_10_20_2021_fKyoG0n1BkqhAu-tNfe7WA"
      id="Tc_q4xjHWrufUO2yyWBZF8U3g_2_1">0000912767</dei:EntityCentralIndexKey>
    <dei:AmendmentFlag
      contextRef="Duration_10_20_2021_To_10_20_2021_fKyoG0n1BkqhAu-tNfe7WA"
      id="Tc_QZGmphvoNU-fQ83G71j4Uw_3_1">false</dei:AmendmentFlag>
    <dei:DocumentType
      contextRef="Duration_10_20_2021_To_10_20_2021_fKyoG0n1BkqhAu-tNfe7WA"
      id="Narr_4onf898k60C2DYI63NI7Hg">8-K</dei:DocumentType>
    <dei:DocumentPeriodEndDate
      contextRef="Duration_10_20_2021_To_10_20_2021_fKyoG0n1BkqhAu-tNfe7WA"
      id="Narr_wksQzGoRZUSskbPEQBLemw">2021-10-20</dei:DocumentPeriodEndDate>
    <dei:EntityRegistrantName
      contextRef="Duration_10_20_2021_To_10_20_2021_fKyoG0n1BkqhAu-tNfe7WA"
      id="Narr_rZ4_jJ268UyK9LPWgVCCZw">UFP INDUSTRIES, INC.</dei:EntityRegistrantName>
    <dei:EntityIncorporationStateCountryCode
      contextRef="Duration_10_20_2021_To_10_20_2021_fKyoG0n1BkqhAu-tNfe7WA"
      id="Narr_iErT6wYe4k-hKFGGc4fmPg">MI</dei:EntityIncorporationStateCountryCode>
    <dei:EntityFileNumber
      contextRef="Duration_10_20_2021_To_10_20_2021_fKyoG0n1BkqhAu-tNfe7WA"
      id="Narr_i7rHCRyMrUW-1lgXoFW2ag">0-22684</dei:EntityFileNumber>
    <dei:EntityTaxIdentificationNumber
      contextRef="Duration_10_20_2021_To_10_20_2021_fKyoG0n1BkqhAu-tNfe7WA"
      id="Narr_mZ36lltOFkigBdwfD3EXow">38-1465835</dei:EntityTaxIdentificationNumber>
    <dei:EntityAddressAddressLine1
      contextRef="Duration_10_20_2021_To_10_20_2021_fKyoG0n1BkqhAu-tNfe7WA"
      id="Narr_BsxqSXoZqECpvJ4hiKbIqg">2801 East Beltline, NE </dei:EntityAddressAddressLine1>
    <dei:EntityAddressCityOrTown
      contextRef="Duration_10_20_2021_To_10_20_2021_fKyoG0n1BkqhAu-tNfe7WA"
      id="Narr_jPyMQrqNdUWzAFjPa5z3vA">Grand Rapids</dei:EntityAddressCityOrTown>
    <dei:EntityAddressStateOrProvince
      contextRef="Duration_10_20_2021_To_10_20_2021_fKyoG0n1BkqhAu-tNfe7WA"
      id="Narr_7Deb6jh5DkuiLCSKHeT0JA">MI</dei:EntityAddressStateOrProvince>
    <dei:EntityAddressPostalZipCode
      contextRef="Duration_10_20_2021_To_10_20_2021_fKyoG0n1BkqhAu-tNfe7WA"
      id="Narr_AKkv0UZiC0aZn-UplBGkbw">49525</dei:EntityAddressPostalZipCode>
    <dei:CityAreaCode
      contextRef="Duration_10_20_2021_To_10_20_2021_fKyoG0n1BkqhAu-tNfe7WA"
      id="Narr_deZY2cvzgUKPoHZ3DVpuYw">616</dei:CityAreaCode>
    <dei:LocalPhoneNumber
      contextRef="Duration_10_20_2021_To_10_20_2021_fKyoG0n1BkqhAu-tNfe7WA"
      id="Narr_qQCU7Q3PHEextIJSecTX8A">364-6161</dei:LocalPhoneNumber>
    <dei:WrittenCommunications
      contextRef="Duration_10_20_2021_To_10_20_2021_fKyoG0n1BkqhAu-tNfe7WA"
      id="Narr_glC-zE_9Ak6FDz4l3FkUiA">false</dei:WrittenCommunications>
    <dei:SolicitingMaterial
      contextRef="Duration_10_20_2021_To_10_20_2021_fKyoG0n1BkqhAu-tNfe7WA"
      id="Narr_UDnkXI0s1UmJDDHEGGYpZg">false</dei:SolicitingMaterial>
    <dei:PreCommencementTenderOffer
      contextRef="Duration_10_20_2021_To_10_20_2021_fKyoG0n1BkqhAu-tNfe7WA"
      id="Narr_65PyVf8by0eXC7iGVZTZUQ">false</dei:PreCommencementTenderOffer>
    <dei:PreCommencementIssuerTenderOffer
      contextRef="Duration_10_20_2021_To_10_20_2021_fKyoG0n1BkqhAu-tNfe7WA"
      id="Narr_v-tp8dw8LEGwDR3E53zFUQ">false</dei:PreCommencementIssuerTenderOffer>
    <dei:Security12bTitle
      contextRef="Duration_10_20_2021_To_10_20_2021_fKyoG0n1BkqhAu-tNfe7WA"
      id="Tc_ydclyldxrES4O5XXUpaaLQ_2_0">Common Stock</dei:Security12bTitle>
    <dei:TradingSymbol
      contextRef="Duration_10_20_2021_To_10_20_2021_fKyoG0n1BkqhAu-tNfe7WA"
      id="Tc_h67e8_0oJkeEtMFN4IzryA_2_1">UFPI</dei:TradingSymbol>
    <dei:SecurityExchangeName
      contextRef="Duration_10_20_2021_To_10_20_2021_fKyoG0n1BkqhAu-tNfe7WA"
      id="Narr_OyIEwSNrHUSC7sDQYtrcJQ">NASDAQ</dei:SecurityExchangeName>
    <dei:EntityEmergingGrowthCompany
      contextRef="Duration_10_20_2021_To_10_20_2021_fKyoG0n1BkqhAu-tNfe7WA"
      id="Narr_DWRn7yb-PkqWGLrKdlFm7A">false</dei:EntityEmergingGrowthCompany>
</xbrl>
