<?xml version="1.0"?>
<ownershipDocument>

    <schemaVersion>X0202</schemaVersion>

    <documentType>4</documentType>

    <periodOfReport>2007-10-12</periodOfReport>

    <notSubjectToSection16>1</notSubjectToSection16>

    <issuer>
        <issuerCik>0000899171</issuerCik>
        <issuerName>CDW CORP</issuerName>
        <issuerTradingSymbol>CDWC</issuerTradingSymbol>
    </issuer>

    <reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0001232907</rptOwnerCik>
            <rptOwnerName>JAMES STEPHAN A</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerStreet1>200 NORTH MILWAUKEE AVENUE</rptOwnerStreet1>
            <rptOwnerStreet2></rptOwnerStreet2>
            <rptOwnerCity>VERNON HILLS</rptOwnerCity>
            <rptOwnerState>IL</rptOwnerState>
            <rptOwnerZipCode>60061</rptOwnerZipCode>
            <rptOwnerStateDescription></rptOwnerStateDescription>
        </reportingOwnerAddress>
        <reportingOwnerRelationship>
            <isDirector>1</isDirector>
            <isOfficer>0</isOfficer>
            <isTenPercentOwner>0</isTenPercentOwner>
            <isOther>0</isOther>
        </reportingOwnerRelationship>
    </reportingOwner>

    <nonDerivativeTable>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Common stock, $.01 par value</value>
            </securityTitle>
            <transactionDate>
                <value>2007-10-12</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>D</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>1000</value>
                </transactionShares>
                <transactionPricePerShare>
                    <value>87.75</value>
                    <footnoteId id="F1"/>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>D</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>0</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value></value>
                </natureOfOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
    </nonDerivativeTable>

    <derivativeTable>
        <derivativeTransaction>
            <securityTitle>
                <value>Stock Options (Right to buy)</value>
            </securityTitle>
            <conversionOrExercisePrice>
                <value>62.43</value>
            </conversionOrExercisePrice>
            <transactionDate>
                <value>2007-10-12</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>D</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>2478</value>
                </transactionShares>
                <transactionPricePerShare>
                    <value>0</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>D</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <exerciseDate>
                <value>2007-10-12</value>
                <footnoteId id="F2"/>
            </exerciseDate>
            <expirationDate>
                <value>2014-11-10</value>
            </expirationDate>
            <underlyingSecurity>
                <underlyingSecurityTitle>
                    <value>Common stock, $.01 par value</value>
                </underlyingSecurityTitle>
                <underlyingSecurityShares>
                    <value>2478</value>
                </underlyingSecurityShares>
            </underlyingSecurity>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>0</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value></value>
                </natureOfOwnership>
            </ownershipNature>
        </derivativeTransaction>
        <derivativeTransaction>
            <securityTitle>
                <value>Stock Options (Right to buy)</value>
            </securityTitle>
            <conversionOrExercisePrice>
                <value>58.44</value>
            </conversionOrExercisePrice>
            <transactionDate>
                <value>2007-10-12</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>D</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>5076</value>
                </transactionShares>
                <transactionPricePerShare>
                    <value>0</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>D</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <exerciseDate>
                <value>2007-10-12</value>
                <footnoteId id="F2"/>
            </exerciseDate>
            <expirationDate>
                <value>2015-05-11</value>
            </expirationDate>
            <underlyingSecurity>
                <underlyingSecurityTitle>
                    <value>Common stock, $.01 par value</value>
                </underlyingSecurityTitle>
                <underlyingSecurityShares>
                    <value>5076</value>
                </underlyingSecurityShares>
            </underlyingSecurity>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>0</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value></value>
                </natureOfOwnership>
            </ownershipNature>
        </derivativeTransaction>
        <derivativeTransaction>
            <securityTitle>
                <value>Stock Options (Right to buy)</value>
            </securityTitle>
            <conversionOrExercisePrice>
                <value>55.40</value>
            </conversionOrExercisePrice>
            <transactionDate>
                <value>2007-10-12</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>D</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>5462</value>
                </transactionShares>
                <transactionPricePerShare>
                    <value>0</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>D</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <exerciseDate>
                <value>2007-10-12</value>
                <footnoteId id="F2"/>
            </exerciseDate>
            <expirationDate>
                <value>2016-05-17</value>
            </expirationDate>
            <underlyingSecurity>
                <underlyingSecurityTitle>
                    <value>Common stock, $.01 par value</value>
                </underlyingSecurityTitle>
                <underlyingSecurityShares>
                    <value>5462</value>
                </underlyingSecurityShares>
            </underlyingSecurity>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>0</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value></value>
                </natureOfOwnership>
            </ownershipNature>
        </derivativeTransaction>
    </derivativeTable>

    <footnotes>
        <footnote id="F1">Pursuant to the acquisition of CDW Corporation by an entity controlled by investment funds affiliated with Madison Dearborn Partners, LLC and Providence Equity Partners, Inc. effective October 12, 2007, the stockholder received $87.75 in cash for each outstanding share of common stock.</footnote>
        <footnote id="F2">Pursuant to the acquisition of CDW Corporation by an entity controlled by investment funds affiliated with Madison Dearborn Partners, LLC and Providence Equity Partners, Inc. effective October 12, 2007, each stock option, regardless of whether it was exercisable upon completion of the merger, was cancelled by CDW Corporation and the holder of the stock option received a cash payment equal to the difference between the merger price of $87.75 and the exercise price of the option, times the number of shares subject to the stock option, less applicable withholding taxes.</footnote>
    </footnotes>

    <remarks></remarks>

    <ownerSignature>
        <signatureName>Robert J. Welyki, Attorney-in-fact</signatureName>
        <signatureDate>2007-10-12</signatureDate>
    </ownerSignature>
</ownershipDocument>
