<?xml version="1.0" encoding="utf-8"?>
<xbrl
  xmlns="http://www.xbrl.org/2003/instance"
  xmlns:dei="http://xbrl.sec.gov/dei/2022"
  xmlns:link="http://www.xbrl.org/2003/linkbase"
  xmlns:xlink="http://www.w3.org/1999/xlink">
    <link:schemaRef xlink:href="ufpi-20230301.xsd" xlink:type="simple"/>
    <context id="Duration_3_1_2023_To_3_1_2023_Asz3T6FE7EuPuWLSyN0WJw">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0000912767</identifier>
        </entity>
        <period>
            <startDate>2023-03-01</startDate>
            <endDate>2023-03-01</endDate>
        </period>
    </context>
    <dei:EntityCentralIndexKey
      contextRef="Duration_3_1_2023_To_3_1_2023_Asz3T6FE7EuPuWLSyN0WJw"
      id="Tc__DE4xGfcVU6Md_FkcJtiuA_2_1">0000912767</dei:EntityCentralIndexKey>
    <dei:AmendmentFlag
      contextRef="Duration_3_1_2023_To_3_1_2023_Asz3T6FE7EuPuWLSyN0WJw"
      id="Tc_iLRYAEUywUect5_peHjjJw_3_1">false</dei:AmendmentFlag>
    <dei:DocumentType
      contextRef="Duration_3_1_2023_To_3_1_2023_Asz3T6FE7EuPuWLSyN0WJw"
      id="Narr_O1Jm0i41gU-ufW2IkDBIaA">8-K</dei:DocumentType>
    <dei:DocumentPeriodEndDate
      contextRef="Duration_3_1_2023_To_3_1_2023_Asz3T6FE7EuPuWLSyN0WJw"
      id="Narr_ojOwGODeYUWWDF7sVSQ7VQ">2023-03-01</dei:DocumentPeriodEndDate>
    <dei:EntityRegistrantName
      contextRef="Duration_3_1_2023_To_3_1_2023_Asz3T6FE7EuPuWLSyN0WJw"
      id="Narr_VlWuFamxTUqU-iXZNfE80w">UFP INDUSTRIES, INC.</dei:EntityRegistrantName>
    <dei:EntityIncorporationStateCountryCode
      contextRef="Duration_3_1_2023_To_3_1_2023_Asz3T6FE7EuPuWLSyN0WJw"
      id="Narr_s-ZqB_rn80qO4hcopPtn6Q">MI</dei:EntityIncorporationStateCountryCode>
    <dei:EntityFileNumber
      contextRef="Duration_3_1_2023_To_3_1_2023_Asz3T6FE7EuPuWLSyN0WJw"
      id="Narr_lX8UJR5pekyHfD_uNPzwow">0-22684</dei:EntityFileNumber>
    <dei:EntityTaxIdentificationNumber
      contextRef="Duration_3_1_2023_To_3_1_2023_Asz3T6FE7EuPuWLSyN0WJw"
      id="Narr_yUiuQL5Y50WPvasGLXrcww">38-1465835</dei:EntityTaxIdentificationNumber>
    <dei:EntityAddressAddressLine1
      contextRef="Duration_3_1_2023_To_3_1_2023_Asz3T6FE7EuPuWLSyN0WJw"
      id="Narr_lTNy4Djh9EqBbYtx8fbqVg">2801 East Beltline, NE</dei:EntityAddressAddressLine1>
    <dei:EntityAddressCityOrTown
      contextRef="Duration_3_1_2023_To_3_1_2023_Asz3T6FE7EuPuWLSyN0WJw"
      id="Narr_-O-nOFZXZUmBAY7iNkeEbw">Grand Rapids</dei:EntityAddressCityOrTown>
    <dei:EntityAddressStateOrProvince
      contextRef="Duration_3_1_2023_To_3_1_2023_Asz3T6FE7EuPuWLSyN0WJw"
      id="Narr_pQfloUkjIUaJEx4MBY0ELw">MI</dei:EntityAddressStateOrProvince>
    <dei:EntityAddressPostalZipCode
      contextRef="Duration_3_1_2023_To_3_1_2023_Asz3T6FE7EuPuWLSyN0WJw"
      id="Narr_1QcZCQCy4ki3G5mLH9pbnQ">49525</dei:EntityAddressPostalZipCode>
    <dei:CityAreaCode
      contextRef="Duration_3_1_2023_To_3_1_2023_Asz3T6FE7EuPuWLSyN0WJw"
      id="Narr_aoZVMSSfXEa524QoJrBfMQ">616</dei:CityAreaCode>
    <dei:LocalPhoneNumber
      contextRef="Duration_3_1_2023_To_3_1_2023_Asz3T6FE7EuPuWLSyN0WJw"
      id="Narr_PAqxgI6qHkO5iBFnUz6KGQ">364-6161</dei:LocalPhoneNumber>
    <dei:WrittenCommunications
      contextRef="Duration_3_1_2023_To_3_1_2023_Asz3T6FE7EuPuWLSyN0WJw"
      id="Narr_BY0bIToWWUiD0AsBnBuVzg">false</dei:WrittenCommunications>
    <dei:SolicitingMaterial
      contextRef="Duration_3_1_2023_To_3_1_2023_Asz3T6FE7EuPuWLSyN0WJw"
      id="Narr_ms7SGia7jEuH6VAQmLBxyQ">false</dei:SolicitingMaterial>
    <dei:PreCommencementTenderOffer
      contextRef="Duration_3_1_2023_To_3_1_2023_Asz3T6FE7EuPuWLSyN0WJw"
      id="Narr_Qw_Z63aw-UqjNYCygWU-mw">false</dei:PreCommencementTenderOffer>
    <dei:PreCommencementIssuerTenderOffer
      contextRef="Duration_3_1_2023_To_3_1_2023_Asz3T6FE7EuPuWLSyN0WJw"
      id="Narr_ou15ziGgVUKlFJLDSxuwsw">false</dei:PreCommencementIssuerTenderOffer>
    <dei:Security12bTitle
      contextRef="Duration_3_1_2023_To_3_1_2023_Asz3T6FE7EuPuWLSyN0WJw"
      id="Tc_1gHA0-eDy0WMRb4paMdDtg_2_0">Common Stock</dei:Security12bTitle>
    <dei:TradingSymbol
      contextRef="Duration_3_1_2023_To_3_1_2023_Asz3T6FE7EuPuWLSyN0WJw"
      id="Tc_3R2p6BKVA069X1RHsV3bRg_2_1">UFPI</dei:TradingSymbol>
    <dei:SecurityExchangeName
      contextRef="Duration_3_1_2023_To_3_1_2023_Asz3T6FE7EuPuWLSyN0WJw"
      id="Narr_CWNDq_VKJUmjZ_R91Ve-AA">NASDAQ</dei:SecurityExchangeName>
    <dei:EntityEmergingGrowthCompany
      contextRef="Duration_3_1_2023_To_3_1_2023_Asz3T6FE7EuPuWLSyN0WJw"
      id="Narr_DDmf8IbJ5kOCApk9gpbeHA">false</dei:EntityEmergingGrowthCompany>
</xbrl>
