<?xml version="1.0" encoding="utf-8"?>
<xbrl
  xmlns="http://www.xbrl.org/2003/instance"
  xmlns:dei="http://xbrl.sec.gov/dei/2024"
  xmlns:link="http://www.xbrl.org/2003/linkbase"
  xmlns:xlink="http://www.w3.org/1999/xlink">
    <link:schemaRef xlink:href="ufpi-20250217.xsd" xlink:type="simple"/>
    <context id="Duration_2_17_2025_To_2_17_2025_CT0mPm1fskmr8FplLyW6HA">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0000912767</identifier>
        </entity>
        <period>
            <startDate>2025-02-17</startDate>
            <endDate>2025-02-17</endDate>
        </period>
    </context>
    <dei:EntityCentralIndexKey
      contextRef="Duration_2_17_2025_To_2_17_2025_CT0mPm1fskmr8FplLyW6HA"
      id="Tc_8t7NVW1VjEuCDwup4E3OXQ_2_1">0000912767</dei:EntityCentralIndexKey>
    <dei:AmendmentFlag
      contextRef="Duration_2_17_2025_To_2_17_2025_CT0mPm1fskmr8FplLyW6HA"
      id="Tc_BIQ1hAAM5EegVcodg2EWwg_3_1">false</dei:AmendmentFlag>
    <dei:DocumentType
      contextRef="Duration_2_17_2025_To_2_17_2025_CT0mPm1fskmr8FplLyW6HA"
      id="Narr_Y_UmXfJE80-XFOaBT9v6eg">8-K</dei:DocumentType>
    <dei:DocumentPeriodEndDate
      contextRef="Duration_2_17_2025_To_2_17_2025_CT0mPm1fskmr8FplLyW6HA"
      id="Narr_0yw9vviXbEO7LctZDbdEPg">2025-02-17</dei:DocumentPeriodEndDate>
    <dei:EntityRegistrantName
      contextRef="Duration_2_17_2025_To_2_17_2025_CT0mPm1fskmr8FplLyW6HA"
      id="Narr_gl3ddxLEJEC2OXolyRC3jg">UFP INDUSTRIES, INC.</dei:EntityRegistrantName>
    <dei:EntityIncorporationStateCountryCode
      contextRef="Duration_2_17_2025_To_2_17_2025_CT0mPm1fskmr8FplLyW6HA"
      id="Narr_Ty8C3ec_hEWBDLckHd0J_A">MI</dei:EntityIncorporationStateCountryCode>
    <dei:EntityFileNumber
      contextRef="Duration_2_17_2025_To_2_17_2025_CT0mPm1fskmr8FplLyW6HA"
      id="Narr_xRmvfxvd_UO7sWBIofIjLA">0-22684</dei:EntityFileNumber>
    <dei:EntityTaxIdentificationNumber
      contextRef="Duration_2_17_2025_To_2_17_2025_CT0mPm1fskmr8FplLyW6HA"
      id="Narr_b55dvNacTUadSu2WCgoeaw">38-1465835</dei:EntityTaxIdentificationNumber>
    <dei:EntityAddressAddressLine1
      contextRef="Duration_2_17_2025_To_2_17_2025_CT0mPm1fskmr8FplLyW6HA"
      id="Narr_a4X5bT7TPkq0mKYZiGAjGQ">2801 East Beltline, NE </dei:EntityAddressAddressLine1>
    <dei:EntityAddressCityOrTown
      contextRef="Duration_2_17_2025_To_2_17_2025_CT0mPm1fskmr8FplLyW6HA"
      id="Narr_YX8QSopty0KO-mxVfIS1MQ">Grand Rapids</dei:EntityAddressCityOrTown>
    <dei:EntityAddressStateOrProvince
      contextRef="Duration_2_17_2025_To_2_17_2025_CT0mPm1fskmr8FplLyW6HA"
      id="Narr_kTw_ua7bf0iLcyDDNi-4-g">MI</dei:EntityAddressStateOrProvince>
    <dei:EntityAddressPostalZipCode
      contextRef="Duration_2_17_2025_To_2_17_2025_CT0mPm1fskmr8FplLyW6HA"
      id="Narr_4UDFlk2akUSYsFfFzOohSA">49525</dei:EntityAddressPostalZipCode>
    <dei:CityAreaCode
      contextRef="Duration_2_17_2025_To_2_17_2025_CT0mPm1fskmr8FplLyW6HA"
      id="Narr_KcmqyjILlkqoOeaWa-S3OA">616</dei:CityAreaCode>
    <dei:LocalPhoneNumber
      contextRef="Duration_2_17_2025_To_2_17_2025_CT0mPm1fskmr8FplLyW6HA"
      id="Narr_YlMfF0C1xUqJ_VjLwksWYg">364-6161</dei:LocalPhoneNumber>
    <dei:WrittenCommunications
      contextRef="Duration_2_17_2025_To_2_17_2025_CT0mPm1fskmr8FplLyW6HA"
      id="Narr_VIKA8Q3UQEOuC6ukx1CO1A">false</dei:WrittenCommunications>
    <dei:SolicitingMaterial
      contextRef="Duration_2_17_2025_To_2_17_2025_CT0mPm1fskmr8FplLyW6HA"
      id="Narr__l4ZwLcka06hfU71DcXDAg">false</dei:SolicitingMaterial>
    <dei:PreCommencementTenderOffer
      contextRef="Duration_2_17_2025_To_2_17_2025_CT0mPm1fskmr8FplLyW6HA"
      id="Narr_ouRnDKEbv0eaaV12oHjlEg">false</dei:PreCommencementTenderOffer>
    <dei:PreCommencementIssuerTenderOffer
      contextRef="Duration_2_17_2025_To_2_17_2025_CT0mPm1fskmr8FplLyW6HA"
      id="Narr_JSQ9Y_nbokaEPmlpURO9Gw">false</dei:PreCommencementIssuerTenderOffer>
    <dei:Security12bTitle
      contextRef="Duration_2_17_2025_To_2_17_2025_CT0mPm1fskmr8FplLyW6HA"
      id="Tc_B9dPjzaX00eRB9oP5KD7Og_2_0">Common Stock</dei:Security12bTitle>
    <dei:TradingSymbol
      contextRef="Duration_2_17_2025_To_2_17_2025_CT0mPm1fskmr8FplLyW6HA"
      id="Tc_7I972CcHBkmEt-uPAbgchA_2_1">UFPI</dei:TradingSymbol>
    <dei:SecurityExchangeName
      contextRef="Duration_2_17_2025_To_2_17_2025_CT0mPm1fskmr8FplLyW6HA"
      id="Narr_kAP3faSCZkqe1JH4pZWNVQ">NASDAQ</dei:SecurityExchangeName>
    <dei:EntityEmergingGrowthCompany
      contextRef="Duration_2_17_2025_To_2_17_2025_CT0mPm1fskmr8FplLyW6HA"
      id="Narr_h7UIn02X2ki4WuSFbShE3g">false</dei:EntityEmergingGrowthCompany>
</xbrl>
