<?xml version='1.0' encoding='utf-8'?>
<FilingSummary>
  <Version>3.22.2</Version>
  <ProcessingTime/>
  <ReportFormat>html</ReportFormat>
  <ContextCount>463</ContextCount>
  <ElementCount>196</ElementCount>
  <EntityCount>1</EntityCount>
  <FootnotesReported>false</FootnotesReported>
  <SegmentCount>54</SegmentCount>
  <ScenarioCount>0</ScenarioCount>
  <TuplesReported>false</TuplesReported>
  <UnitCount>7</UnitCount>
  <MyReports>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R1.htm</HtmlFileName>
      <LongName>0001001 - Document - Cover Page</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/CoverPage</Role>
      <ShortName>Cover Page</ShortName>
      <MenuCategory>Cover</MenuCategory>
      <Position>1</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R2.htm</HtmlFileName>
      <LongName>1001002 - Statement - Consolidated Balance Sheets</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/ConsolidatedBalanceSheets</Role>
      <ShortName>Consolidated Balance Sheets</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>2</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R3.htm</HtmlFileName>
      <LongName>1002003 - Statement - Consolidated Balance Sheets (Parentheticals)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/ConsolidatedBalanceSheetsParentheticals</Role>
      <ShortName>Consolidated Balance Sheets (Parentheticals)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>3</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R4.htm</HtmlFileName>
      <LongName>1003004 - Statement - Consolidated Statements Of Operations</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/ConsolidatedStatementsOfOperations</Role>
      <ShortName>Consolidated Statements Of Operations</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>4</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R5.htm</HtmlFileName>
      <LongName>1004005 - Statement - Consolidated Statements Of Comprehensive Income</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/ConsolidatedStatementsOfComprehensiveIncome</Role>
      <ShortName>Consolidated Statements Of Comprehensive Income</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>5</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R6.htm</HtmlFileName>
      <LongName>1005006 - Statement - Consolidated Statements of Cash Flows</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/ConsolidatedStatementsofCashFlows</Role>
      <ShortName>Consolidated Statements of Cash Flows</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>6</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R7.htm</HtmlFileName>
      <LongName>1006007 - Statement - Consolidated Statement of Stockholders' Equity</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/ConsolidatedStatementofStockholdersEquity</Role>
      <ShortName>Consolidated Statement of Stockholders' Equity</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>7</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R8.htm</HtmlFileName>
      <LongName>1007008 - Statement - Consolidated Statements of Shareholders' Equity (Parenthetical)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/ConsolidatedStatementsofShareholdersEquityParenthetical</Role>
      <ShortName>Consolidated Statements of Shareholders' Equity (Parenthetical)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>8</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R9.htm</HtmlFileName>
      <LongName>2101101 - Disclosure - Description of Business and Summary of Significant Accounting Policies</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/DescriptionofBusinessandSummaryofSignificantAccountingPolicies</Role>
      <ShortName>Description of Business and Summary of Significant Accounting Policies</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>9</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R10.htm</HtmlFileName>
      <LongName>2104102 - Disclosure - Recent Accounting Pronouncements</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/RecentAccountingPronouncements</Role>
      <ShortName>Recent Accounting Pronouncements</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>10</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R11.htm</HtmlFileName>
      <LongName>2105103 - Disclosure - Acquisitions</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/Acquisitions</Role>
      <ShortName>Acquisitions</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>11</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R12.htm</HtmlFileName>
      <LongName>2107104 - Disclosure - Accounts Receivable and Contract Balances</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/AccountsReceivableandContractBalances</Role>
      <ShortName>Accounts Receivable and Contract Balances</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>12</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R13.htm</HtmlFileName>
      <LongName>2112105 - Disclosure - Inventory Financing Agreements</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/InventoryFinancingAgreements</Role>
      <ShortName>Inventory Financing Agreements</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>13</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R14.htm</HtmlFileName>
      <LongName>2115106 - Disclosure - Financial Instruments</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/FinancialInstruments</Role>
      <ShortName>Financial Instruments</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>14</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R15.htm</HtmlFileName>
      <LongName>2118107 - Disclosure - Debt</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/Debt</Role>
      <ShortName>Debt</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>15</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R16.htm</HtmlFileName>
      <LongName>2123108 - Disclosure - Income Taxes</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/IncomeTaxes</Role>
      <ShortName>Income Taxes</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>16</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R17.htm</HtmlFileName>
      <LongName>2125109 - Disclosure - Earnings Per Share</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/EarningsPerShare</Role>
      <ShortName>Earnings Per Share</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>17</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R18.htm</HtmlFileName>
      <LongName>2128110 - Disclosure - Commitments and Contingencies</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/CommitmentsandContingencies</Role>
      <ShortName>Commitments and Contingencies</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>18</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R19.htm</HtmlFileName>
      <LongName>2129111 - Disclosure - Segment Information</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/SegmentInformation</Role>
      <ShortName>Segment Information</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>19</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R20.htm</HtmlFileName>
      <LongName>2202201 - Disclosure - Description of Business and Summary of Significant Accounting Policies (Policies)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/DescriptionofBusinessandSummaryofSignificantAccountingPoliciesPolicies</Role>
      <ShortName>Description of Business and Summary of Significant Accounting Policies (Policies)</ShortName>
      <MenuCategory>Policies</MenuCategory>
      <ParentRole>http://www.cdw.com/role/DescriptionofBusinessandSummaryofSignificantAccountingPolicies</ParentRole>
      <Position>20</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R21.htm</HtmlFileName>
      <LongName>2308301 - Disclosure - Accounts Receivable and Contract Balances (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/AccountsReceivableandContractBalancesTables</Role>
      <ShortName>Accounts Receivable and Contract Balances (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.cdw.com/role/AccountsReceivableandContractBalances</ParentRole>
      <Position>21</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R22.htm</HtmlFileName>
      <LongName>2313302 - Disclosure - Inventory Financing Agreements (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/InventoryFinancingAgreementsTables</Role>
      <ShortName>Inventory Financing Agreements (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.cdw.com/role/InventoryFinancingAgreements</ParentRole>
      <Position>22</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R23.htm</HtmlFileName>
      <LongName>2316303 - Disclosure - Financial Instruments (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/FinancialInstrumentsTables</Role>
      <ShortName>Financial Instruments (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.cdw.com/role/FinancialInstruments</ParentRole>
      <Position>23</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R24.htm</HtmlFileName>
      <LongName>2319304 - Disclosure - Debt (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/DebtTables</Role>
      <ShortName>Debt (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.cdw.com/role/Debt</ParentRole>
      <Position>24</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R25.htm</HtmlFileName>
      <LongName>2326305 - Disclosure - Earnings Per Share (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/EarningsPerShareTables</Role>
      <ShortName>Earnings Per Share (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.cdw.com/role/EarningsPerShare</ParentRole>
      <Position>25</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R26.htm</HtmlFileName>
      <LongName>2330306 - Disclosure - Segment Information (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/SegmentInformationTables</Role>
      <ShortName>Segment Information (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.cdw.com/role/SegmentInformation</ParentRole>
      <Position>26</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R27.htm</HtmlFileName>
      <LongName>2403401 - Disclosure - Description of Business and Summary of Significant Accounting Policies (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/DescriptionofBusinessandSummaryofSignificantAccountingPoliciesDetails</Role>
      <ShortName>Description of Business and Summary of Significant Accounting Policies (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.cdw.com/role/DescriptionofBusinessandSummaryofSignificantAccountingPoliciesPolicies</ParentRole>
      <Position>27</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R28.htm</HtmlFileName>
      <LongName>2406402 - Disclosure - Acquisitions (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/AcquisitionsDetails</Role>
      <ShortName>Acquisitions (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.cdw.com/role/Acquisitions</ParentRole>
      <Position>28</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R29.htm</HtmlFileName>
      <LongName>2409403 - Disclosure - Accounts Receivable and Contract Balances - Schedule of Accounts Receivable (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/AccountsReceivableandContractBalancesScheduleofAccountsReceivableDetails</Role>
      <ShortName>Accounts Receivable and Contract Balances - Schedule of Accounts Receivable (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>29</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R30.htm</HtmlFileName>
      <LongName>2410404 - Disclosure - Accounts Receivable and Contract Balances - Schedule of Contract with Customer (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/AccountsReceivableandContractBalancesScheduleofContractwithCustomerDetails</Role>
      <ShortName>Accounts Receivable and Contract Balances - Schedule of Contract with Customer (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>30</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R31.htm</HtmlFileName>
      <LongName>2411405 - Disclosure - Accounts Receivable and Contract Balances - Schedule of Remaining Performance Obligations (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/AccountsReceivableandContractBalancesScheduleofRemainingPerformanceObligationsDetails</Role>
      <ShortName>Accounts Receivable and Contract Balances - Schedule of Remaining Performance Obligations (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>31</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R32.htm</HtmlFileName>
      <LongName>2414406 - Disclosure - Inventory Financing Agreements (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/InventoryFinancingAgreementsDetails</Role>
      <ShortName>Inventory Financing Agreements (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.cdw.com/role/InventoryFinancingAgreementsTables</ParentRole>
      <Position>32</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R33.htm</HtmlFileName>
      <LongName>2417407 - Disclosure - Financial Instruments - (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/FinancialInstrumentsDetails</Role>
      <ShortName>Financial Instruments - (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.cdw.com/role/FinancialInstrumentsTables</ParentRole>
      <Position>33</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R34.htm</HtmlFileName>
      <LongName>2420408 - Disclosure - Debt - Debt Balances and Interest Rates (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/DebtDebtBalancesandInterestRatesDetails</Role>
      <ShortName>Debt - Debt Balances and Interest Rates (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>34</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R35.htm</HtmlFileName>
      <LongName>2421409 - Disclosure - Debt - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/DebtNarrativeDetails</Role>
      <ShortName>Debt - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>35</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R36.htm</HtmlFileName>
      <LongName>2422410 - Disclosure - Debt - Fair Value of Long-Term Debt (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/DebtFairValueofLongTermDebtDetails</Role>
      <ShortName>Debt - Fair Value of Long-Term Debt (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>36</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R37.htm</HtmlFileName>
      <LongName>2424411 - Disclosure - Income Taxes - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/IncomeTaxesNarrativeDetails</Role>
      <ShortName>Income Taxes - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>37</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R38.htm</HtmlFileName>
      <LongName>2427412 - Disclosure - Earnings Per Share (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/EarningsPerShareDetails</Role>
      <ShortName>Earnings Per Share (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.cdw.com/role/EarningsPerShareTables</ParentRole>
      <Position>38</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R39.htm</HtmlFileName>
      <LongName>2431413 - Disclosure - Segment Information - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/SegmentInformationNarrativeDetails</Role>
      <ShortName>Segment Information - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>39</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R40.htm</HtmlFileName>
      <LongName>2432414 - Disclosure - Segment Information - Schedule of Segment Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/SegmentInformationScheduleofSegmentInformationDetails</Role>
      <ShortName>Segment Information - Schedule of Segment Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>40</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R41.htm</HtmlFileName>
      <LongName>2433415 - Disclosure - Segment Information - Disaggregation of Revenue (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/SegmentInformationDisaggregationofRevenueDetails</Role>
      <ShortName>Segment Information - Disaggregation of Revenue (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>41</Position>
    </Report>
    <Report instance="cdw-20220630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R9999.htm</HtmlFileName>
      <LongName>Uncategorized Items - cdw-20220630.htm</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xbrl.sec.gov/role/uncategorizedFacts</Role>
      <ShortName>Uncategorized Items - cdw-20220630.htm</ShortName>
      <MenuCategory>Cover</MenuCategory>
      <Position>42</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" original="cdw-20220630.htm">cdw-20220630.htm</File>
    <File>cdw-20220630.xsd</File>
    <File>cdw-20220630_cal.xml</File>
    <File>cdw-20220630_def.xml</File>
    <File>cdw-20220630_lab.xml</File>
    <File>cdw-20220630_pre.xml</File>
    <File>cdw-2022630x10qxex311.htm</File>
    <File>cdw-2022630x10qxex312.htm</File>
    <File>cdw-2022630x10qxex321.htm</File>
    <File>cdw-2022630x10qxex322.htm</File>
  </InputFiles>
  <SupplementalFiles>
    <File>cdw-20220630_g1.gif</File>
  </SupplementalFiles>
  <BaseTaxonomies>
    <BaseTaxonomy items="995">http://fasb.org/us-gaap/2022</BaseTaxonomy>
    <BaseTaxonomy items="29">http://xbrl.sec.gov/dei/2022</BaseTaxonomy>
  </BaseTaxonomies>
  <HasPresentationLinkbase>true</HasPresentationLinkbase>
  <HasCalculationLinkbase>true</HasCalculationLinkbase>
</FilingSummary>
