<?xml version='1.0' encoding='utf-8'?>
<FilingSummary>
  <Version>3.24.2</Version>
  <ProcessingTime/>
  <ReportFormat>html</ReportFormat>
  <ContextCount>149</ContextCount>
  <ElementCount>221</ElementCount>
  <EntityCount>1</EntityCount>
  <FootnotesReported>false</FootnotesReported>
  <SegmentCount>23</SegmentCount>
  <ScenarioCount>0</ScenarioCount>
  <TuplesReported>false</TuplesReported>
  <UnitCount>5</UnitCount>
  <MyReports>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R1.htm</HtmlFileName>
      <LongName>0000001 - Document - Cover</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/Cover</Role>
      <ShortName>Cover</ShortName>
      <MenuCategory>Cover</MenuCategory>
      <Position>1</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R2.htm</HtmlFileName>
      <LongName>9952151 - Statement - Consolidated Statements of Earnings (Unaudited)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/ConsolidatedStatementsofEarningsUnaudited</Role>
      <ShortName>Consolidated Statements of Earnings (Unaudited)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>2</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R3.htm</HtmlFileName>
      <LongName>9952152 - Statement - Consolidated Statements of Comprehensive Income (Unaudited)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/ConsolidatedStatementsofComprehensiveIncomeUnaudited</Role>
      <ShortName>Consolidated Statements of Comprehensive Income (Unaudited)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>3</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R4.htm</HtmlFileName>
      <LongName>9952153 - Statement - Consolidated Balance Sheets (Unaudited)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/ConsolidatedBalanceSheetsUnaudited</Role>
      <ShortName>Consolidated Balance Sheets (Unaudited)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>4</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R5.htm</HtmlFileName>
      <LongName>9952154 - Statement - Consolidated Balance Sheets (Unaudited) (Parenthetical)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/ConsolidatedBalanceSheetsUnauditedParenthetical</Role>
      <ShortName>Consolidated Balance Sheets (Unaudited) (Parenthetical)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>5</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R6.htm</HtmlFileName>
      <LongName>9952155 - Statement - Consolidated Statements of Cash Flows (Unaudited)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/ConsolidatedStatementsofCashFlowsUnaudited</Role>
      <ShortName>Consolidated Statements of Cash Flows (Unaudited)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>6</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R7.htm</HtmlFileName>
      <LongName>9952156 - Statement - Consolidated Statements of Shareholders' Equity (Unaudited)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/ConsolidatedStatementsofShareholdersEquityUnaudited</Role>
      <ShortName>Consolidated Statements of Shareholders' Equity (Unaudited)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>7</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R8.htm</HtmlFileName>
      <LongName>9952157 - Statement - Consolidated Statements of Shareholders' Equity (Unaudited) (Parenthetical)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/ConsolidatedStatementsofShareholdersEquityUnauditedParenthetical</Role>
      <ShortName>Consolidated Statements of Shareholders' Equity (Unaudited) (Parenthetical)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>8</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R9.htm</HtmlFileName>
      <LongName>9952158 - Disclosure - Basis of Presentation</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/BasisofPresentation</Role>
      <ShortName>Basis of Presentation</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>9</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R10.htm</HtmlFileName>
      <LongName>9952159 - Disclosure - Segment Information</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/SegmentInformation</Role>
      <ShortName>Segment Information</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>10</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R11.htm</HtmlFileName>
      <LongName>9952160 - Disclosure - Earnings per Share</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/EarningsperShare</Role>
      <ShortName>Earnings per Share</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>11</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R12.htm</HtmlFileName>
      <LongName>9952161 - Disclosure - Share-Based Awards</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/ShareBasedAwards</Role>
      <ShortName>Share-Based Awards</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>12</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R13.htm</HtmlFileName>
      <LongName>9952162 - Disclosure - Retirement Benefits</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/RetirementBenefits</Role>
      <ShortName>Retirement Benefits</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>13</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R14.htm</HtmlFileName>
      <LongName>9952163 - Disclosure - Shareholders' Equity</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/ShareholdersEquity</Role>
      <ShortName>Shareholders' Equity</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>14</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R15.htm</HtmlFileName>
      <LongName>9952164 - Disclosure - Receivables and Credit Losses</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/ReceivablesandCreditLosses</Role>
      <ShortName>Receivables and Credit Losses</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>15</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R16.htm</HtmlFileName>
      <LongName>9952165 - Disclosure - Inventories</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/Inventories</Role>
      <ShortName>Inventories</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>16</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R17.htm</HtmlFileName>
      <LongName>9952166 - Disclosure - Intangible Assets</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/IntangibleAssets</Role>
      <ShortName>Intangible Assets</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>17</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R18.htm</HtmlFileName>
      <LongName>9952167 - Disclosure - Other Current Liabilities</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/OtherCurrentLiabilities</Role>
      <ShortName>Other Current Liabilities</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>18</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R19.htm</HtmlFileName>
      <LongName>9952168 - Disclosure - Fair Value</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/FairValue</Role>
      <ShortName>Fair Value</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>19</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R20.htm</HtmlFileName>
      <LongName>995410 - Disclosure - Pay vs Performance Disclosure</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xbrl.sec.gov/ecd/role/PvpDisclosure</Role>
      <ShortName>Pay vs Performance Disclosure</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>20</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R21.htm</HtmlFileName>
      <LongName>995445 - Disclosure - Insider Trading Arrangements</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xbrl.sec.gov/ecd/role/InsiderTradingArrangements</Role>
      <ShortName>Insider Trading Arrangements</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>21</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R22.htm</HtmlFileName>
      <LongName>9954471 - Disclosure - Segment Information (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/SegmentInformationTables</Role>
      <ShortName>Segment Information (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.graco.com/role/SegmentInformation</ParentRole>
      <Position>22</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R23.htm</HtmlFileName>
      <LongName>9954472 - Disclosure - Earnings per Share (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/EarningsperShareTables</Role>
      <ShortName>Earnings per Share (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.graco.com/role/EarningsperShare</ParentRole>
      <Position>23</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R24.htm</HtmlFileName>
      <LongName>9954473 - Disclosure - Share-Based Awards (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/ShareBasedAwardsTables</Role>
      <ShortName>Share-Based Awards (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.graco.com/role/ShareBasedAwards</ParentRole>
      <Position>24</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R25.htm</HtmlFileName>
      <LongName>9954474 - Disclosure - Retirement Benefits (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/RetirementBenefitsTables</Role>
      <ShortName>Retirement Benefits (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.graco.com/role/RetirementBenefits</ParentRole>
      <Position>25</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R26.htm</HtmlFileName>
      <LongName>9954475 - Disclosure - Shareholders' Equity (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/ShareholdersEquityTables</Role>
      <ShortName>Shareholders' Equity (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.graco.com/role/ShareholdersEquity</ParentRole>
      <Position>26</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R27.htm</HtmlFileName>
      <LongName>9954476 - Disclosure - Receivables and Credit Losses (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/ReceivablesandCreditLossesTables</Role>
      <ShortName>Receivables and Credit Losses (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.graco.com/role/ReceivablesandCreditLosses</ParentRole>
      <Position>27</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R28.htm</HtmlFileName>
      <LongName>9954477 - Disclosure - Inventories (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/InventoriesTables</Role>
      <ShortName>Inventories (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.graco.com/role/Inventories</ParentRole>
      <Position>28</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R29.htm</HtmlFileName>
      <LongName>9954478 - Disclosure - Intangible Assets (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/IntangibleAssetsTables</Role>
      <ShortName>Intangible Assets (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.graco.com/role/IntangibleAssets</ParentRole>
      <Position>29</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R30.htm</HtmlFileName>
      <LongName>9954479 - Disclosure - Other Current Liabilities (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/OtherCurrentLiabilitiesTables</Role>
      <ShortName>Other Current Liabilities (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.graco.com/role/OtherCurrentLiabilities</ParentRole>
      <Position>30</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R31.htm</HtmlFileName>
      <LongName>9954480 - Disclosure - Fair Value (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/FairValueTables</Role>
      <ShortName>Fair Value (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.graco.com/role/FairValue</ParentRole>
      <Position>31</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R32.htm</HtmlFileName>
      <LongName>9954481 - Disclosure - Segment Reporting Information - Operations and Assets (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/SegmentReportingInformationOperationsandAssetsDetails</Role>
      <ShortName>Segment Reporting Information - Operations and Assets (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>32</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R33.htm</HtmlFileName>
      <LongName>9954482 - Disclosure - Segment Reporting Information - Geographic (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/SegmentReportingInformationGeographicDetails</Role>
      <ShortName>Segment Reporting Information - Geographic (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>33</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R34.htm</HtmlFileName>
      <LongName>9954483 - Disclosure - Earnings per Share (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/EarningsperShareDetails</Role>
      <ShortName>Earnings per Share (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.graco.com/role/EarningsperShareTables</ParentRole>
      <Position>34</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R35.htm</HtmlFileName>
      <LongName>9954484 - Disclosure - Share-Based Awards - Options Activity and Outstanding (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/ShareBasedAwardsOptionsActivityandOutstandingDetails</Role>
      <ShortName>Share-Based Awards - Options Activity and Outstanding (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>35</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R36.htm</HtmlFileName>
      <LongName>9954485 - Disclosure - Share-Based Awards - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/ShareBasedAwardsNarrativeDetails</Role>
      <ShortName>Share-Based Awards - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>36</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R37.htm</HtmlFileName>
      <LongName>9954486 - Disclosure - Share-Based Awards - Options Fair Value Inputs (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/ShareBasedAwardsOptionsFairValueInputsDetails</Role>
      <ShortName>Share-Based Awards - Options Fair Value Inputs (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>37</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R38.htm</HtmlFileName>
      <LongName>9954487 - Disclosure - Share-Based Awards - ESPP Fair Value Inputs (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/ShareBasedAwardsESPPFairValueInputsDetails</Role>
      <ShortName>Share-Based Awards - ESPP Fair Value Inputs (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>38</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R39.htm</HtmlFileName>
      <LongName>9954488 - Disclosure - Retirement Benefits (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/RetirementBenefitsDetails</Role>
      <ShortName>Retirement Benefits (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.graco.com/role/RetirementBenefitsTables</ParentRole>
      <Position>39</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R40.htm</HtmlFileName>
      <LongName>9954489 - Disclosure - Shareholders' Equity (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/ShareholdersEquityDetails</Role>
      <ShortName>Shareholders' Equity (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.graco.com/role/ShareholdersEquityTables</ParentRole>
      <Position>40</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R41.htm</HtmlFileName>
      <LongName>9954490 - Disclosure - Receivables and Credit Losses (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/ReceivablesandCreditLossesDetails</Role>
      <ShortName>Receivables and Credit Losses (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.graco.com/role/ReceivablesandCreditLossesTables</ParentRole>
      <Position>41</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R42.htm</HtmlFileName>
      <LongName>9954491 - Disclosure - Inventories (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/InventoriesDetails</Role>
      <ShortName>Inventories (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.graco.com/role/InventoriesTables</ParentRole>
      <Position>42</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R43.htm</HtmlFileName>
      <LongName>9954492 - Disclosure - Intangible Assets - Other Intangible Assets (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/IntangibleAssetsOtherIntangibleAssetsDetails</Role>
      <ShortName>Intangible Assets - Other Intangible Assets (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>43</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R44.htm</HtmlFileName>
      <LongName>9954493 - Disclosure - Intangible Assets - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/IntangibleAssetsNarrativeDetails</Role>
      <ShortName>Intangible Assets - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>44</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R45.htm</HtmlFileName>
      <LongName>9954494 - Disclosure - Intangible Assets - Future Amortization Expense (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/IntangibleAssetsFutureAmortizationExpenseDetails</Role>
      <ShortName>Intangible Assets - Future Amortization Expense (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>45</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R46.htm</HtmlFileName>
      <LongName>9954495 - Disclosure - Intangible Assets - Goodwill Rollforward (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/IntangibleAssetsGoodwillRollforwardDetails</Role>
      <ShortName>Intangible Assets - Goodwill Rollforward (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>46</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R47.htm</HtmlFileName>
      <LongName>9954496 - Disclosure - Other Current Liabilities - Components of Other Current Liabilities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/OtherCurrentLiabilitiesComponentsofOtherCurrentLiabilitiesDetails</Role>
      <ShortName>Other Current Liabilities - Components of Other Current Liabilities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>47</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R48.htm</HtmlFileName>
      <LongName>9954497 - Disclosure - Other Current Liabilities - Accrued Warranty Activity (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/OtherCurrentLiabilitiesAccruedWarrantyActivityDetails</Role>
      <ShortName>Other Current Liabilities - Accrued Warranty Activity (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>48</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R49.htm</HtmlFileName>
      <LongName>9954498 - Disclosure - Other Current Liabilities - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/OtherCurrentLiabilitiesNarrativeDetails</Role>
      <ShortName>Other Current Liabilities - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>49</Position>
    </Report>
    <Report instance="ggg-20240628.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R50.htm</HtmlFileName>
      <LongName>9954499 - Disclosure - Fair Value (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/FairValueDetails</Role>
      <ShortName>Fair Value (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.graco.com/role/FairValueTables</ParentRole>
      <Position>50</Position>
    </Report>
    <Report>
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <LongName>All Reports</LongName>
      <ReportType>Book</ReportType>
      <ShortName>All Reports</ShortName>
    </Report>
  </MyReports>
  <InputFiles>
    <File doctype="10-Q" isDefinitelyFs="true" isUsgaap="true" original="ggg-20240628.htm">ggg-20240628.htm</File>
    <File>ggg-20240628.xsd</File>
    <File>ggg-20240628_cal.xml</File>
    <File>ggg-20240628_def.xml</File>
    <File>ggg-20240628_lab.xml</File>
    <File>ggg-20240628_pre.xml</File>
  </InputFiles>
  <SupplementalFiles/>
  <BaseTaxonomies>
    <BaseTaxonomy items="667">http://fasb.org/us-gaap/2024</BaseTaxonomy>
    <BaseTaxonomy items="30">http://xbrl.sec.gov/dei/2024</BaseTaxonomy>
    <BaseTaxonomy items="4">http://xbrl.sec.gov/ecd/2024</BaseTaxonomy>
  </BaseTaxonomies>
  <HasPresentationLinkbase>true</HasPresentationLinkbase>
  <HasCalculationLinkbase>true</HasCalculationLinkbase>
</FilingSummary>
