<?xml version="1.0" encoding="utf-8"?>
<xbrl
  xmlns="http://www.xbrl.org/2003/instance"
  xmlns:dei="http://xbrl.sec.gov/dei/2023"
  xmlns:link="http://www.xbrl.org/2003/linkbase"
  xmlns:xlink="http://www.w3.org/1999/xlink">
    <link:schemaRef xlink:href="cdw-20240812.xsd" xlink:type="simple"/>
    <context id="duration_2024-08-12_to_2024-08-12">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0001402057</identifier>
        </entity>
        <period>
            <startDate>2024-08-12</startDate>
            <endDate>2024-08-12</endDate>
        </period>
    </context>
    <dei:EntityRegistrantName
      contextRef="duration_2024-08-12_to_2024-08-12"
      id="Hidden_dei_EntityRegistrantName">CDW Corp</dei:EntityRegistrantName>
    <dei:AmendmentFlag contextRef="duration_2024-08-12_to_2024-08-12" id="ixv-282">false</dei:AmendmentFlag>
    <dei:EntityCentralIndexKey
      contextRef="duration_2024-08-12_to_2024-08-12"
      id="Hidden_dei_EntityCentralIndexKey">0001402057</dei:EntityCentralIndexKey>
    <dei:DocumentType contextRef="duration_2024-08-12_to_2024-08-12" id="ixv-293">8-K</dei:DocumentType>
    <dei:DocumentPeriodEndDate contextRef="duration_2024-08-12_to_2024-08-12" id="ixv-294">2024-08-12</dei:DocumentPeriodEndDate>
    <dei:EntityIncorporationStateCountryCode contextRef="duration_2024-08-12_to_2024-08-12" id="ixv-295">DE</dei:EntityIncorporationStateCountryCode>
    <dei:EntityFileNumber contextRef="duration_2024-08-12_to_2024-08-12" id="ixv-296">001-35985</dei:EntityFileNumber>
    <dei:EntityTaxIdentificationNumber contextRef="duration_2024-08-12_to_2024-08-12" id="ixv-297">26-0273989</dei:EntityTaxIdentificationNumber>
    <dei:EntityAddressAddressLine1 contextRef="duration_2024-08-12_to_2024-08-12" id="ixv-298">200 N. Milwaukee Avenue</dei:EntityAddressAddressLine1>
    <dei:EntityAddressCityOrTown contextRef="duration_2024-08-12_to_2024-08-12" id="ixv-299">Vernon Hills</dei:EntityAddressCityOrTown>
    <dei:EntityAddressStateOrProvince contextRef="duration_2024-08-12_to_2024-08-12" id="ixv-300">IL</dei:EntityAddressStateOrProvince>
    <dei:EntityAddressPostalZipCode contextRef="duration_2024-08-12_to_2024-08-12" id="ixv-301">60061</dei:EntityAddressPostalZipCode>
    <dei:CityAreaCode contextRef="duration_2024-08-12_to_2024-08-12" id="ixv-302">(847)</dei:CityAreaCode>
    <dei:LocalPhoneNumber contextRef="duration_2024-08-12_to_2024-08-12" id="ixv-303">465-6000</dei:LocalPhoneNumber>
    <dei:WrittenCommunications contextRef="duration_2024-08-12_to_2024-08-12" id="ixv-304">false</dei:WrittenCommunications>
    <dei:SolicitingMaterial contextRef="duration_2024-08-12_to_2024-08-12" id="ixv-305">false</dei:SolicitingMaterial>
    <dei:PreCommencementTenderOffer contextRef="duration_2024-08-12_to_2024-08-12" id="ixv-306">false</dei:PreCommencementTenderOffer>
    <dei:PreCommencementIssuerTenderOffer contextRef="duration_2024-08-12_to_2024-08-12" id="ixv-307">false</dei:PreCommencementIssuerTenderOffer>
    <dei:Security12bTitle contextRef="duration_2024-08-12_to_2024-08-12" id="ixv-308">Common stock, par value $0.01 per share</dei:Security12bTitle>
    <dei:TradingSymbol contextRef="duration_2024-08-12_to_2024-08-12" id="ixv-309">CDW</dei:TradingSymbol>
    <dei:SecurityExchangeName contextRef="duration_2024-08-12_to_2024-08-12" id="ixv-310">NASDAQ</dei:SecurityExchangeName>
    <dei:EntityEmergingGrowthCompany contextRef="duration_2024-08-12_to_2024-08-12" id="ixv-311">false</dei:EntityEmergingGrowthCompany>
</xbrl>
