<?xml version='1.0' encoding='utf-8'?>
<FilingSummary>
  <Version>3.21.2</Version>
  <ProcessingTime/>
  <ReportFormat>html</ReportFormat>
  <ContextCount>473</ContextCount>
  <ElementCount>259</ElementCount>
  <EntityCount>1</EntityCount>
  <FootnotesReported>false</FootnotesReported>
  <SegmentCount>53</SegmentCount>
  <ScenarioCount>0</ScenarioCount>
  <TuplesReported>false</TuplesReported>
  <UnitCount>7</UnitCount>
  <MyReports>
    <Report instance="cdw-20210630.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-20210630.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-20210630.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-20210630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R4.htm</HtmlFileName>
      <LongName>1003004 - Statement - Consolidated Statements Of Operations (Unaudited)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/ConsolidatedStatementsOfOperationsUnaudited</Role>
      <ShortName>Consolidated Statements Of Operations (Unaudited)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>4</Position>
    </Report>
    <Report instance="cdw-20210630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R5.htm</HtmlFileName>
      <LongName>1004005 - Statement - Consolidated Statements Of Comprehensive Income (Unaudited)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/ConsolidatedStatementsOfComprehensiveIncomeUnaudited</Role>
      <ShortName>Consolidated Statements Of Comprehensive Income (Unaudited)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>5</Position>
    </Report>
    <Report instance="cdw-20210630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R6.htm</HtmlFileName>
      <LongName>1005006 - Statement - Consolidated Statement of Stockholders' Equity (Unaudited)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/ConsolidatedStatementofStockholdersEquityUnaudited</Role>
      <ShortName>Consolidated Statement of Stockholders' Equity (Unaudited)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>6</Position>
    </Report>
    <Report instance="cdw-20210630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R7.htm</HtmlFileName>
      <LongName>1006007 - Statement - Consolidated Statements of Shareholders' Equity (Unaudited) (Parenthetical)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/ConsolidatedStatementsofShareholdersEquityUnauditedParenthetical</Role>
      <ShortName>Consolidated Statements of Shareholders' Equity (Unaudited) (Parenthetical)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>7</Position>
    </Report>
    <Report instance="cdw-20210630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R8.htm</HtmlFileName>
      <LongName>1007008 - Statement - Consolidated Statements of Cash Flows (Unaudited)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/ConsolidatedStatementsofCashFlowsUnaudited</Role>
      <ShortName>Consolidated Statements of Cash Flows (Unaudited)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>8</Position>
    </Report>
    <Report instance="cdw-20210630.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-20210630.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-20210630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R11.htm</HtmlFileName>
      <LongName>2106103 - Disclosure - Acquisition</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/Acquisition</Role>
      <ShortName>Acquisition</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>11</Position>
    </Report>
    <Report instance="cdw-20210630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R12.htm</HtmlFileName>
      <LongName>2108104 - Disclosure - Goodwill</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/Goodwill</Role>
      <ShortName>Goodwill</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>12</Position>
    </Report>
    <Report instance="cdw-20210630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R13.htm</HtmlFileName>
      <LongName>2111105 - 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-20210630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R14.htm</HtmlFileName>
      <LongName>2114106 - Disclosure - Contract Liabilities and Performance Obligations</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/ContractLiabilitiesandPerformanceObligations</Role>
      <ShortName>Contract Liabilities and Performance Obligations</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>14</Position>
    </Report>
    <Report instance="cdw-20210630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R15.htm</HtmlFileName>
      <LongName>2118107 - Disclosure - Long-Term Debt</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/LongTermDebt</Role>
      <ShortName>Long-Term Debt</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>15</Position>
    </Report>
    <Report instance="cdw-20210630.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-20210630.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-20210630.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-20210630.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-20210630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R20.htm</HtmlFileName>
      <LongName>2134112 - Disclosure - Subsequent Event</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/SubsequentEvent</Role>
      <ShortName>Subsequent Event</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>20</Position>
    </Report>
    <Report instance="cdw-20210630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R21.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>21</Position>
    </Report>
    <Report instance="cdw-20210630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R22.htm</HtmlFileName>
      <LongName>2309301 - Disclosure - Goodwill (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/GoodwillTables</Role>
      <ShortName>Goodwill (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.cdw.com/role/Goodwill</ParentRole>
      <Position>22</Position>
    </Report>
    <Report instance="cdw-20210630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R23.htm</HtmlFileName>
      <LongName>2312302 - 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>23</Position>
    </Report>
    <Report instance="cdw-20210630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R24.htm</HtmlFileName>
      <LongName>2315303 - Disclosure - Contract Liabilities and Performance Obligations (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/ContractLiabilitiesandPerformanceObligationsTables</Role>
      <ShortName>Contract Liabilities and Performance Obligations (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.cdw.com/role/ContractLiabilitiesandPerformanceObligations</ParentRole>
      <Position>24</Position>
    </Report>
    <Report instance="cdw-20210630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R25.htm</HtmlFileName>
      <LongName>2319304 - Disclosure - Long-Term Debt (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/LongTermDebtTables</Role>
      <ShortName>Long-Term Debt (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.cdw.com/role/LongTermDebt</ParentRole>
      <Position>25</Position>
    </Report>
    <Report instance="cdw-20210630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R26.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>26</Position>
    </Report>
    <Report instance="cdw-20210630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R27.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>27</Position>
    </Report>
    <Report instance="cdw-20210630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R28.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>28</Position>
    </Report>
    <Report instance="cdw-20210630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R29.htm</HtmlFileName>
      <LongName>2405402 - Disclosure - Recent Accounting Pronouncements (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/RecentAccountingPronouncementsDetails</Role>
      <ShortName>Recent Accounting Pronouncements (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.cdw.com/role/RecentAccountingPronouncements</ParentRole>
      <Position>29</Position>
    </Report>
    <Report instance="cdw-20210630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R30.htm</HtmlFileName>
      <LongName>2407403 - Disclosure - Acquisition - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/AcquisitionNarrativeDetails</Role>
      <ShortName>Acquisition - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>30</Position>
    </Report>
    <Report instance="cdw-20210630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R31.htm</HtmlFileName>
      <LongName>2410404 - Disclosure - Goodwill - Schedule of Goodwill by Segment (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/GoodwillScheduleofGoodwillbySegmentDetails</Role>
      <ShortName>Goodwill - Schedule of Goodwill by Segment (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>31</Position>
    </Report>
    <Report instance="cdw-20210630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R32.htm</HtmlFileName>
      <LongName>2413405 - 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-20210630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R33.htm</HtmlFileName>
      <LongName>2416406 - Disclosure - Contract Liabilities and Performance Obligations - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/ContractLiabilitiesandPerformanceObligationsNarrativeDetails</Role>
      <ShortName>Contract Liabilities and Performance Obligations - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.cdw.com/role/ContractLiabilitiesandPerformanceObligationsTables</ParentRole>
      <Position>33</Position>
    </Report>
    <Report instance="cdw-20210630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R34.htm</HtmlFileName>
      <LongName>2417407 - Disclosure - Contract Liabilities and Performance Obligations - Schedule of Remaining Performance Obligations (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/ContractLiabilitiesandPerformanceObligationsScheduleofRemainingPerformanceObligationsDetails</Role>
      <ShortName>Contract Liabilities and Performance Obligations - Schedule of Remaining Performance Obligations (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>34</Position>
    </Report>
    <Report instance="cdw-20210630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R35.htm</HtmlFileName>
      <LongName>2420408 - Disclosure - Long-Term Debt - Debt Balances and Interest Rates (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/LongTermDebtDebtBalancesandInterestRatesDetails</Role>
      <ShortName>Long-Term Debt - Debt Balances and Interest Rates (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>35</Position>
    </Report>
    <Report instance="cdw-20210630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R36.htm</HtmlFileName>
      <LongName>2421409 - Disclosure - Long-Term Debt - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/LongTermDebtNarrativeDetails</Role>
      <ShortName>Long-Term Debt - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>36</Position>
    </Report>
    <Report instance="cdw-20210630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R37.htm</HtmlFileName>
      <LongName>2422410 - Disclosure - Long-Term Debt - Fair Value of Long-Term Debt (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.cdw.com/role/LongTermDebtFairValueofLongTermDebtDetails</Role>
      <ShortName>Long-Term Debt - Fair Value of Long-Term Debt (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>37</Position>
    </Report>
    <Report instance="cdw-20210630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R38.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>38</Position>
    </Report>
    <Report instance="cdw-20210630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R39.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>39</Position>
    </Report>
    <Report instance="cdw-20210630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R40.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>40</Position>
    </Report>
    <Report instance="cdw-20210630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R41.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>41</Position>
    </Report>
    <Report instance="cdw-20210630.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R42.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>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-20210630.htm">cdw-20210630.htm</File>
    <File>cdw-20210630.xsd</File>
    <File>cdw-20210630_cal.xml</File>
    <File>cdw-20210630_def.xml</File>
    <File>cdw-20210630_lab.xml</File>
    <File>cdw-20210630_pre.xml</File>
    <File>cdw-2021630x10qxex102.htm</File>
    <File>cdw-2021630x10qxex103.htm</File>
    <File>cdw-2021630x10qxex311.htm</File>
    <File>cdw-2021630x10qxex312.htm</File>
    <File>cdw-2021630x10qxex321.htm</File>
    <File>cdw-2021630x10qxex322.htm</File>
  </InputFiles>
  <SupplementalFiles>
    <File>cdw-20210630_g1.gif</File>
  </SupplementalFiles>
  <BaseTaxonomies>
    <BaseTaxonomy>http://xbrl.sec.gov/dei/2021</BaseTaxonomy>
    <BaseTaxonomy>http://xbrl.sec.gov/country/2021</BaseTaxonomy>
    <BaseTaxonomy>http://fasb.org/us-gaap/2021-01-31</BaseTaxonomy>
    <BaseTaxonomy>http://fasb.org/srt/2021-01-31</BaseTaxonomy>
  </BaseTaxonomies>
  <HasPresentationLinkbase>true</HasPresentationLinkbase>
  <HasCalculationLinkbase>true</HasCalculationLinkbase>
</FilingSummary>
