<?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-20210331.xsd" xlink:type="simple"/>
    <context id="Duration_3_1_2021_To_3_1_2021_47ztRnnZzEiFwe31Xnx1lA">
        <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_47ztRnnZzEiFwe31Xnx1lA"
      id="Tc_NGF8vI-XVkKyK4aEUyd8yg_2_1">0000912767</dei:EntityCentralIndexKey>
    <dei:AmendmentFlag
      contextRef="Duration_3_1_2021_To_3_1_2021_47ztRnnZzEiFwe31Xnx1lA"
      id="Tc_gpIJMVmzY0ihie4Zd9r3sQ_3_1">false</dei:AmendmentFlag>
    <dei:DocumentType
      contextRef="Duration_3_1_2021_To_3_1_2021_47ztRnnZzEiFwe31Xnx1lA"
      id="Narr_h9PPoFlgHUa6FZjUfUFYfw">8-K</dei:DocumentType>
    <dei:DocumentPeriodEndDate
      contextRef="Duration_3_1_2021_To_3_1_2021_47ztRnnZzEiFwe31Xnx1lA"
      id="Narr_Nq17_DfZKk2y_bwMKytCPg">2021-03-31</dei:DocumentPeriodEndDate>
    <dei:EntityRegistrantName
      contextRef="Duration_3_1_2021_To_3_1_2021_47ztRnnZzEiFwe31Xnx1lA"
      id="Narr_d_A6e7TbWUq19Mt4VsKWxA">UFP INDUSTRIES, INC.</dei:EntityRegistrantName>
    <dei:EntityIncorporationStateCountryCode
      contextRef="Duration_3_1_2021_To_3_1_2021_47ztRnnZzEiFwe31Xnx1lA"
      id="Narr_NrbBSvwcTESNrMZlctPuog">MI</dei:EntityIncorporationStateCountryCode>
    <dei:EntityFileNumber
      contextRef="Duration_3_1_2021_To_3_1_2021_47ztRnnZzEiFwe31Xnx1lA"
      id="Narr_YnM4pY08W0KvM_fF_-C5zw">0-22684</dei:EntityFileNumber>
    <dei:EntityTaxIdentificationNumber
      contextRef="Duration_3_1_2021_To_3_1_2021_47ztRnnZzEiFwe31Xnx1lA"
      id="Narr_2DXs3LbIeE-HF5Uxl32Sbw">38-1465835</dei:EntityTaxIdentificationNumber>
    <dei:EntityAddressAddressLine1
      contextRef="Duration_3_1_2021_To_3_1_2021_47ztRnnZzEiFwe31Xnx1lA"
      id="Narr_gy1fDLDyZEGzNKrKc4K8kA">2801 East Beltline, NE, Grand Rapids</dei:EntityAddressAddressLine1>
    <dei:EntityAddressCityOrTown
      contextRef="Duration_3_1_2021_To_3_1_2021_47ztRnnZzEiFwe31Xnx1lA"
      id="Narr_XaQAJZ_D8UOSr4Wo7H3ZiQ">, </dei:EntityAddressCityOrTown>
    <dei:EntityAddressStateOrProvince
      contextRef="Duration_3_1_2021_To_3_1_2021_47ztRnnZzEiFwe31Xnx1lA"
      id="Narr_WcQg1re2eUuaXI6arTf75Q">MI</dei:EntityAddressStateOrProvince>
    <dei:EntityAddressPostalZipCode
      contextRef="Duration_3_1_2021_To_3_1_2021_47ztRnnZzEiFwe31Xnx1lA"
      id="Narr_Kv7VjELO50umyebb-wxdcQ">49525</dei:EntityAddressPostalZipCode>
    <dei:CityAreaCode
      contextRef="Duration_3_1_2021_To_3_1_2021_47ztRnnZzEiFwe31Xnx1lA"
      id="Narr_9zE1XCig7Euf8whSSXiv2A">616</dei:CityAreaCode>
    <dei:LocalPhoneNumber
      contextRef="Duration_3_1_2021_To_3_1_2021_47ztRnnZzEiFwe31Xnx1lA"
      id="Narr_zMb4o_dRmk6yAk2xCa_voQ">364-6161</dei:LocalPhoneNumber>
    <dei:WrittenCommunications
      contextRef="Duration_3_1_2021_To_3_1_2021_47ztRnnZzEiFwe31Xnx1lA"
      id="Narr_CcQ9gS3NeE-WR-Yl80ZknA">false</dei:WrittenCommunications>
    <dei:SolicitingMaterial
      contextRef="Duration_3_1_2021_To_3_1_2021_47ztRnnZzEiFwe31Xnx1lA"
      id="Narr_aDghY6EQy0uAAOe8wqUWgg">false</dei:SolicitingMaterial>
    <dei:PreCommencementTenderOffer
      contextRef="Duration_3_1_2021_To_3_1_2021_47ztRnnZzEiFwe31Xnx1lA"
      id="Narr_LhKoZe4w2k67QphfeCNXqw">false</dei:PreCommencementTenderOffer>
    <dei:PreCommencementIssuerTenderOffer
      contextRef="Duration_3_1_2021_To_3_1_2021_47ztRnnZzEiFwe31Xnx1lA"
      id="Narr_Sv3-LWNkUUeZSAJyP3T5Yg">false</dei:PreCommencementIssuerTenderOffer>
    <dei:Security12bTitle
      contextRef="Duration_3_1_2021_To_3_1_2021_47ztRnnZzEiFwe31Xnx1lA"
      id="Tc_iFNu_A_Sok6Dymggg-mNbA_2_0">Common Stock</dei:Security12bTitle>
    <dei:TradingSymbol
      contextRef="Duration_3_1_2021_To_3_1_2021_47ztRnnZzEiFwe31Xnx1lA"
      id="Tc_QPybP5kXSU-FlGm4TcSNrA_2_1">UFPI</dei:TradingSymbol>
    <dei:SecurityExchangeName
      contextRef="Duration_3_1_2021_To_3_1_2021_47ztRnnZzEiFwe31Xnx1lA"
      id="Narr_Q8TGTQ53LkOp54NNB8FdmA">NASDAQ</dei:SecurityExchangeName>
    <dei:EntityEmergingGrowthCompany
      contextRef="Duration_3_1_2021_To_3_1_2021_47ztRnnZzEiFwe31Xnx1lA"
      id="Narr_BBktGmrYX02HLVLgnVJPAQ">false</dei:EntityEmergingGrowthCompany>
</xbrl>
