<?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-20210927.xsd" xlink:type="simple"/>
    <context id="Duration_9_27_2021_To_9_27_2021_YAz-jq3cTkyoEldVgj0uVw">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0000912767</identifier>
        </entity>
        <period>
            <startDate>2021-09-27</startDate>
            <endDate>2021-09-27</endDate>
        </period>
    </context>
    <dei:EntityCentralIndexKey
      contextRef="Duration_9_27_2021_To_9_27_2021_YAz-jq3cTkyoEldVgj0uVw"
      id="Tc_gYJkOSCg9Emt9Bw0r2z4_w_2_1">0000912767</dei:EntityCentralIndexKey>
    <dei:AmendmentFlag
      contextRef="Duration_9_27_2021_To_9_27_2021_YAz-jq3cTkyoEldVgj0uVw"
      id="Tc_EycHg3iwv0KY4Nl2v997uA_3_1">false</dei:AmendmentFlag>
    <dei:DocumentType
      contextRef="Duration_9_27_2021_To_9_27_2021_YAz-jq3cTkyoEldVgj0uVw"
      id="Narr_3X5AeqRvj0mX6OUflcgPJw">8-K</dei:DocumentType>
    <dei:DocumentPeriodEndDate
      contextRef="Duration_9_27_2021_To_9_27_2021_YAz-jq3cTkyoEldVgj0uVw"
      id="Narr_yqKOcvddOUSKfyJShKGJzg">2021-09-27</dei:DocumentPeriodEndDate>
    <dei:EntityRegistrantName
      contextRef="Duration_9_27_2021_To_9_27_2021_YAz-jq3cTkyoEldVgj0uVw"
      id="Narr_MdaR1TAN8Um18HVam9MvDw">UFP INDUSTRIES, INC.</dei:EntityRegistrantName>
    <dei:EntityIncorporationStateCountryCode
      contextRef="Duration_9_27_2021_To_9_27_2021_YAz-jq3cTkyoEldVgj0uVw"
      id="Narr_HogqPJjA-UanXyellDy8Hw">MI</dei:EntityIncorporationStateCountryCode>
    <dei:EntityFileNumber
      contextRef="Duration_9_27_2021_To_9_27_2021_YAz-jq3cTkyoEldVgj0uVw"
      id="Narr_cby1tU18Lkur5zlAxoMiAQ">0-22684</dei:EntityFileNumber>
    <dei:EntityTaxIdentificationNumber
      contextRef="Duration_9_27_2021_To_9_27_2021_YAz-jq3cTkyoEldVgj0uVw"
      id="Narr_noKHOCzgSkukSRRr2spqbQ">38-1465835</dei:EntityTaxIdentificationNumber>
    <dei:EntityAddressAddressLine1
      contextRef="Duration_9_27_2021_To_9_27_2021_YAz-jq3cTkyoEldVgj0uVw"
      id="Narr_EN6ucUa84Eq2RKgcXWJ7iQ">2801 East Beltline, NE</dei:EntityAddressAddressLine1>
    <dei:EntityAddressCityOrTown
      contextRef="Duration_9_27_2021_To_9_27_2021_YAz-jq3cTkyoEldVgj0uVw"
      id="Narr_9ycamjdhVUGeq3qjyDjazw">Grand Rapids</dei:EntityAddressCityOrTown>
    <dei:EntityAddressStateOrProvince
      contextRef="Duration_9_27_2021_To_9_27_2021_YAz-jq3cTkyoEldVgj0uVw"
      id="Narr_qswsNAAY7UepkFDg9TwSPA">MI</dei:EntityAddressStateOrProvince>
    <dei:EntityAddressPostalZipCode
      contextRef="Duration_9_27_2021_To_9_27_2021_YAz-jq3cTkyoEldVgj0uVw"
      id="Narr_GDjWuXgxSkurY7NPf4W4Bg">49525</dei:EntityAddressPostalZipCode>
    <dei:CityAreaCode
      contextRef="Duration_9_27_2021_To_9_27_2021_YAz-jq3cTkyoEldVgj0uVw"
      id="Narr_6XZz87dp-k-ozBu7Bh6Kmg">616</dei:CityAreaCode>
    <dei:LocalPhoneNumber
      contextRef="Duration_9_27_2021_To_9_27_2021_YAz-jq3cTkyoEldVgj0uVw"
      id="Narr_oOdWt5ubPkmqx3xJ3Iiorw">364-6161</dei:LocalPhoneNumber>
    <dei:WrittenCommunications
      contextRef="Duration_9_27_2021_To_9_27_2021_YAz-jq3cTkyoEldVgj0uVw"
      id="Narr_e8fm5k3_B0GC4bp0VxfhgA">false</dei:WrittenCommunications>
    <dei:SolicitingMaterial
      contextRef="Duration_9_27_2021_To_9_27_2021_YAz-jq3cTkyoEldVgj0uVw"
      id="Narr_76a2NREtW0WebmfDuE1Ttg">false</dei:SolicitingMaterial>
    <dei:PreCommencementTenderOffer
      contextRef="Duration_9_27_2021_To_9_27_2021_YAz-jq3cTkyoEldVgj0uVw"
      id="Narr_ri-2psmWbEG3kY23iKCuyA">false</dei:PreCommencementTenderOffer>
    <dei:PreCommencementIssuerTenderOffer
      contextRef="Duration_9_27_2021_To_9_27_2021_YAz-jq3cTkyoEldVgj0uVw"
      id="Narr_BFWbYvX2RE2AYW8lRti9HA">false</dei:PreCommencementIssuerTenderOffer>
    <dei:Security12bTitle
      contextRef="Duration_9_27_2021_To_9_27_2021_YAz-jq3cTkyoEldVgj0uVw"
      id="Tc_LHbABrPwGE-r1IwugKXM9A_2_0">Common Stock</dei:Security12bTitle>
    <dei:TradingSymbol
      contextRef="Duration_9_27_2021_To_9_27_2021_YAz-jq3cTkyoEldVgj0uVw"
      id="Tc_SGV1Zx93Q0mgL6iJBMKaRQ_2_1">UFPI</dei:TradingSymbol>
    <dei:SecurityExchangeName
      contextRef="Duration_9_27_2021_To_9_27_2021_YAz-jq3cTkyoEldVgj0uVw"
      id="Narr_rCx6M6Vyo0mww24IxTKDpw">NASDAQ</dei:SecurityExchangeName>
    <dei:EntityEmergingGrowthCompany
      contextRef="Duration_9_27_2021_To_9_27_2021_YAz-jq3cTkyoEldVgj0uVw"
      id="Narr_tQtxneqcXUGYOJtazqXl9A">false</dei:EntityEmergingGrowthCompany>
</xbrl>
