<?xml version="1.0" encoding="utf-8"?>
<xbrl
  xmlns="http://www.xbrl.org/2003/instance"
  xmlns:dei="http://xbrl.sec.gov/dei/2020-01-31"
  xmlns:link="http://www.xbrl.org/2003/linkbase"
  xmlns:xlink="http://www.w3.org/1999/xlink">
    <link:schemaRef xlink:href="ufpi-20220225.xsd" xlink:type="simple"/>
    <context id="Duration_2_25_2022_To_2_25_2022_Z_GuKvsehE2rZavwUuajGQ">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0000912767</identifier>
        </entity>
        <period>
            <startDate>2022-02-25</startDate>
            <endDate>2022-02-25</endDate>
        </period>
    </context>
    <dei:EntityCentralIndexKey
      contextRef="Duration_2_25_2022_To_2_25_2022_Z_GuKvsehE2rZavwUuajGQ"
      id="Tc_PwJzipbpmESPboMAViiZSQ_2_1">0000912767</dei:EntityCentralIndexKey>
    <dei:AmendmentFlag
      contextRef="Duration_2_25_2022_To_2_25_2022_Z_GuKvsehE2rZavwUuajGQ"
      id="Tc_mbH2jpcZqk6jCJYm_Y8toA_3_1">false</dei:AmendmentFlag>
    <dei:DocumentType
      contextRef="Duration_2_25_2022_To_2_25_2022_Z_GuKvsehE2rZavwUuajGQ"
      id="Narr_6sET9_GUkUmnQNGnwRf6xg">8-K</dei:DocumentType>
    <dei:DocumentPeriodEndDate
      contextRef="Duration_2_25_2022_To_2_25_2022_Z_GuKvsehE2rZavwUuajGQ"
      id="Narr_XowtUDabF0iN5CoCaVBzjQ">2022-02-25</dei:DocumentPeriodEndDate>
    <dei:EntityRegistrantName
      contextRef="Duration_2_25_2022_To_2_25_2022_Z_GuKvsehE2rZavwUuajGQ"
      id="Narr_k-SrKxaJXUiyegjTE1y2dw">UFP INDUSTRIES, INC.</dei:EntityRegistrantName>
    <dei:EntityIncorporationStateCountryCode
      contextRef="Duration_2_25_2022_To_2_25_2022_Z_GuKvsehE2rZavwUuajGQ"
      id="Narr_MzHJbwBpS0SnDygG6BVjNA">MI</dei:EntityIncorporationStateCountryCode>
    <dei:EntityFileNumber
      contextRef="Duration_2_25_2022_To_2_25_2022_Z_GuKvsehE2rZavwUuajGQ"
      id="Narr_7zCXIRVzFUKNdm4QN4e_jw">0-22684</dei:EntityFileNumber>
    <dei:EntityTaxIdentificationNumber
      contextRef="Duration_2_25_2022_To_2_25_2022_Z_GuKvsehE2rZavwUuajGQ"
      id="Narr_R_aZSyYa8UuB410gTlcHYg">38-1465835</dei:EntityTaxIdentificationNumber>
    <dei:EntityAddressAddressLine1
      contextRef="Duration_2_25_2022_To_2_25_2022_Z_GuKvsehE2rZavwUuajGQ"
      id="Narr_BaPYLtdSI066CENjviaBbA">2801 East Beltline, NE</dei:EntityAddressAddressLine1>
    <dei:EntityAddressCityOrTown
      contextRef="Duration_2_25_2022_To_2_25_2022_Z_GuKvsehE2rZavwUuajGQ"
      id="Narr_KeOYWdPnrkOZuIQNYapLzg">Grand Rapids</dei:EntityAddressCityOrTown>
    <dei:EntityAddressStateOrProvince
      contextRef="Duration_2_25_2022_To_2_25_2022_Z_GuKvsehE2rZavwUuajGQ"
      id="Narr_5nNyiCPDP0qTvDFvxw0Wxw">MI</dei:EntityAddressStateOrProvince>
    <dei:EntityAddressPostalZipCode
      contextRef="Duration_2_25_2022_To_2_25_2022_Z_GuKvsehE2rZavwUuajGQ"
      id="Narr_vmeFXu5bNkCAODSR1QqXFA">49525</dei:EntityAddressPostalZipCode>
    <dei:CityAreaCode
      contextRef="Duration_2_25_2022_To_2_25_2022_Z_GuKvsehE2rZavwUuajGQ"
      id="Narr_c38BswUyokma7go1nINXCw">616</dei:CityAreaCode>
    <dei:LocalPhoneNumber
      contextRef="Duration_2_25_2022_To_2_25_2022_Z_GuKvsehE2rZavwUuajGQ"
      id="Narr_h9J_lPVtZ0ywZQVVXiMWzA">364-6161</dei:LocalPhoneNumber>
    <dei:WrittenCommunications
      contextRef="Duration_2_25_2022_To_2_25_2022_Z_GuKvsehE2rZavwUuajGQ"
      id="Narr_tRJq2mqnnkuPfMz3lu7u1Q">false</dei:WrittenCommunications>
    <dei:SolicitingMaterial
      contextRef="Duration_2_25_2022_To_2_25_2022_Z_GuKvsehE2rZavwUuajGQ"
      id="Narr_ofx_Rn-rEUmImOMBz6wNmw">false</dei:SolicitingMaterial>
    <dei:PreCommencementTenderOffer
      contextRef="Duration_2_25_2022_To_2_25_2022_Z_GuKvsehE2rZavwUuajGQ"
      id="Narr_uymCzHduxUGct2wy6jeqtg">false</dei:PreCommencementTenderOffer>
    <dei:PreCommencementIssuerTenderOffer
      contextRef="Duration_2_25_2022_To_2_25_2022_Z_GuKvsehE2rZavwUuajGQ"
      id="Narr_6hukGYOvoUSQKfxZfMpUWA">false</dei:PreCommencementIssuerTenderOffer>
    <dei:Security12bTitle
      contextRef="Duration_2_25_2022_To_2_25_2022_Z_GuKvsehE2rZavwUuajGQ"
      id="Tc_ub4OdiRK1UuqmZwD7VQLQw_2_0">Common Stock</dei:Security12bTitle>
    <dei:TradingSymbol
      contextRef="Duration_2_25_2022_To_2_25_2022_Z_GuKvsehE2rZavwUuajGQ"
      id="Tc_DrJXSbQZ1UOI_S83XP4gkg_2_1">UFPI</dei:TradingSymbol>
    <dei:SecurityExchangeName
      contextRef="Duration_2_25_2022_To_2_25_2022_Z_GuKvsehE2rZavwUuajGQ"
      id="Narr_Cg4EIdlKYEO-H4WOVme2yQ">NASDAQ</dei:SecurityExchangeName>
    <dei:EntityEmergingGrowthCompany
      contextRef="Duration_2_25_2022_To_2_25_2022_Z_GuKvsehE2rZavwUuajGQ"
      id="Narr_Yhbeo9jdqUe9ac6fYgQJEA">false</dei:EntityEmergingGrowthCompany>
</xbrl>
