<?xml version='1.0' encoding='utf-8'?>
<FilingSummary>
  <Version>3.23.1</Version>
  <ProcessingTime/>
  <ReportFormat>html</ReportFormat>
  <ContextCount>108</ContextCount>
  <ElementCount>222</ElementCount>
  <EntityCount>1</EntityCount>
  <FootnotesReported>false</FootnotesReported>
  <SegmentCount>23</SegmentCount>
  <ScenarioCount>0</ScenarioCount>
  <TuplesReported>false</TuplesReported>
  <UnitCount>5</UnitCount>
  <MyReports>
    <Report instance="ggg-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R1.htm</HtmlFileName>
      <LongName>0000001 - Document - Document and Entity Information</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/DocumentandEntityInformation</Role>
      <ShortName>Document and Entity Information</ShortName>
      <MenuCategory>Cover</MenuCategory>
      <Position>1</Position>
    </Report>
    <Report instance="ggg-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R2.htm</HtmlFileName>
      <LongName>0000002 - 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-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R3.htm</HtmlFileName>
      <LongName>0000003 - 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-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R4.htm</HtmlFileName>
      <LongName>0000004 - 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-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R5.htm</HtmlFileName>
      <LongName>0000005 - 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-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R6.htm</HtmlFileName>
      <LongName>0000006 - 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-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R7.htm</HtmlFileName>
      <LongName>0000007 - 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-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R8.htm</HtmlFileName>
      <LongName>0000008 - Statement - Consolidated Statements of Shareholders' Equity (Unaudited) Consolidated Statements of Shareholders' Equity (Unaudited) Parenthetical</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/ConsolidatedStatementsofShareholdersEquityUnauditedConsolidatedStatementsofShareholdersEquityUnauditedParenthetical</Role>
      <ShortName>Consolidated Statements of Shareholders' Equity (Unaudited) Consolidated Statements of Shareholders' Equity (Unaudited) Parenthetical</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>8</Position>
    </Report>
    <Report instance="ggg-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R9.htm</HtmlFileName>
      <LongName>0000009 - 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-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R10.htm</HtmlFileName>
      <LongName>0000010 - 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-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R11.htm</HtmlFileName>
      <LongName>0000011 - 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-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R12.htm</HtmlFileName>
      <LongName>0000012 - 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-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R13.htm</HtmlFileName>
      <LongName>0000013 - 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-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R14.htm</HtmlFileName>
      <LongName>0000014 - 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-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R15.htm</HtmlFileName>
      <LongName>0000015 - 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-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R16.htm</HtmlFileName>
      <LongName>0000016 - 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-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R17.htm</HtmlFileName>
      <LongName>0000017 - 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-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R18.htm</HtmlFileName>
      <LongName>0000018 - 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-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R19.htm</HtmlFileName>
      <LongName>0000020 - 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-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R20.htm</HtmlFileName>
      <LongName>0000021 - 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>20</Position>
    </Report>
    <Report instance="ggg-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R21.htm</HtmlFileName>
      <LongName>0000022 - 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>21</Position>
    </Report>
    <Report instance="ggg-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R22.htm</HtmlFileName>
      <LongName>0000023 - 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>22</Position>
    </Report>
    <Report instance="ggg-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R23.htm</HtmlFileName>
      <LongName>0000024 - 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>23</Position>
    </Report>
    <Report instance="ggg-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R24.htm</HtmlFileName>
      <LongName>0000025 - 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>24</Position>
    </Report>
    <Report instance="ggg-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R25.htm</HtmlFileName>
      <LongName>0000026 - 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>25</Position>
    </Report>
    <Report instance="ggg-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R26.htm</HtmlFileName>
      <LongName>0000027 - 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>26</Position>
    </Report>
    <Report instance="ggg-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R27.htm</HtmlFileName>
      <LongName>0000028 - 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>27</Position>
    </Report>
    <Report instance="ggg-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R28.htm</HtmlFileName>
      <LongName>0000029 - 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>28</Position>
    </Report>
    <Report instance="ggg-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R29.htm</HtmlFileName>
      <LongName>0000031 - 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>29</Position>
    </Report>
    <Report instance="ggg-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R30.htm</HtmlFileName>
      <LongName>0000032 - 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>30</Position>
    </Report>
    <Report instance="ggg-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R31.htm</HtmlFileName>
      <LongName>0000033 - 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>31</Position>
    </Report>
    <Report instance="ggg-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R32.htm</HtmlFileName>
      <LongName>0000034 - 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>32</Position>
    </Report>
    <Report instance="ggg-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R33.htm</HtmlFileName>
      <LongName>0000035 - 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>33</Position>
    </Report>
    <Report instance="ggg-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R34.htm</HtmlFileName>
      <LongName>0000036 - 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>34</Position>
    </Report>
    <Report instance="ggg-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R35.htm</HtmlFileName>
      <LongName>0000037 - 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>35</Position>
    </Report>
    <Report instance="ggg-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R36.htm</HtmlFileName>
      <LongName>0000038 - 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-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R37.htm</HtmlFileName>
      <LongName>0000039 - 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>37</Position>
    </Report>
    <Report instance="ggg-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R38.htm</HtmlFileName>
      <LongName>0000041 - Disclosure - Shareholders' Equity - Changes in AOCI (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.graco.com/role/ShareholdersEquityChangesinAOCIDetails</Role>
      <ShortName>Shareholders' Equity - Changes in AOCI (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>38</Position>
    </Report>
    <Report instance="ggg-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R39.htm</HtmlFileName>
      <LongName>0000042 - 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>39</Position>
    </Report>
    <Report instance="ggg-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R40.htm</HtmlFileName>
      <LongName>0000043 - 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>40</Position>
    </Report>
    <Report instance="ggg-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R41.htm</HtmlFileName>
      <LongName>0000044 - 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>41</Position>
    </Report>
    <Report instance="ggg-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R42.htm</HtmlFileName>
      <LongName>0000045 - 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>42</Position>
    </Report>
    <Report instance="ggg-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R43.htm</HtmlFileName>
      <LongName>0000046 - 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>43</Position>
    </Report>
    <Report instance="ggg-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R44.htm</HtmlFileName>
      <LongName>0000047 - 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-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R45.htm</HtmlFileName>
      <LongName>0000048 - 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>45</Position>
    </Report>
    <Report instance="ggg-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R46.htm</HtmlFileName>
      <LongName>0000049 - 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>46</Position>
    </Report>
    <Report instance="ggg-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R47.htm</HtmlFileName>
      <LongName>0000050 - 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>47</Position>
    </Report>
    <Report instance="ggg-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R48.htm</HtmlFileName>
      <LongName>0000052 - 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>48</Position>
    </Report>
    <Report>
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <LongName>All Reports</LongName>
      <ReportType>Book</ReportType>
      <ShortName>All Reports</ShortName>
    </Report>
  </MyReports>
  <Logs>
    <Log type="Warning">[dq-0540-CurrentFiscalYearEndDate-Registrant-Value] In submission type 10-Q, CurrentFiscalYearEndDate value "--12-29", should match the Entity Registrant Fiscal Year End Date "12/27" on record within EDGAR. ggg-20230331.htm 4</Log>
    <Log type="Warning">[ix-0514-Hidden-Fact-Eligible-For-Transform] WARN: 8 fact(s) appearing in ix:hidden were eligible for transformation: dei:DocumentPeriodEndDate, dei:EntityCommonStockSharesOutstanding, us-gaap:DebtInstrumentCarryingAmount, us-gaap:GoodwillAcquiredDuringPeriod, us-gaap:LongTermDebtFairValue -  ggg-20230331.htm 4</Log>
  </Logs>
  <InputFiles>
    <File doctype="10-Q" original="ggg-20230331.htm">ggg-20230331.htm</File>
    <File>ggg-20230331.xsd</File>
    <File>ggg-20230331_cal.xml</File>
    <File>ggg-20230331_def.xml</File>
    <File>ggg-20230331_lab.xml</File>
    <File>ggg-20230331_pre.xml</File>
    <File>ggg03312023exhibit991q1.htm</File>
    <File>ggg2023q1ex311-quarteronly.htm</File>
    <File>ggg2023q1ex312-quarteronly.htm</File>
    <File>ggg2023q1ex32-quarteronly.htm</File>
  </InputFiles>
  <SupplementalFiles/>
  <BaseTaxonomies>
    <BaseTaxonomy items="541">http://fasb.org/us-gaap/2022</BaseTaxonomy>
    <BaseTaxonomy items="63">http://xbrl.sec.gov/dei/2022</BaseTaxonomy>
  </BaseTaxonomies>
  <HasPresentationLinkbase>true</HasPresentationLinkbase>
  <HasCalculationLinkbase>true</HasCalculationLinkbase>
</FilingSummary>
