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

    <schemaVersion>X0306</schemaVersion>

    <documentType>4</documentType>

    <periodOfReport>2022-03-09</periodOfReport>

    <notSubjectToSection16>0</notSubjectToSection16>

    <issuer>
        <issuerCik>0000106040</issuerCik>
        <issuerName>WESTERN DIGITAL CORP</issuerName>
        <issuerTradingSymbol>WDC</issuerTradingSymbol>
    </issuer>

    <reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0001713941</rptOwnerCik>
            <rptOwnerName>Goeckeler David</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerStreet1>C/O WESTERN DIGITAL CORPORATION</rptOwnerStreet1>
            <rptOwnerStreet2>5601 GREAT OAKS PARKWAY</rptOwnerStreet2>
            <rptOwnerCity>SAN JOSE</rptOwnerCity>
            <rptOwnerState>CA</rptOwnerState>
            <rptOwnerZipCode>95119</rptOwnerZipCode>
            <rptOwnerStateDescription></rptOwnerStateDescription>
        </reportingOwnerAddress>
        <reportingOwnerRelationship>
            <isDirector>1</isDirector>
            <isOfficer>1</isOfficer>
            <isTenPercentOwner>0</isTenPercentOwner>
            <isOther>0</isOther>
            <officerTitle>Chief Executive Officer</officerTitle>
        </reportingOwnerRelationship>
    </reportingOwner>

    <nonDerivativeTable>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Common Stock</value>
            </securityTitle>
            <transactionDate>
                <value>2022-03-09</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>M</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>1246</value>
                    <footnoteId id="F1"/>
                </transactionShares>
                <transactionPricePerShare>
                    <value>0.0</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>A</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>369095</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Common Stock</value>
            </securityTitle>
            <transactionDate>
                <value>2022-03-09</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>F</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>49777</value>
                    <footnoteId id="F2"/>
                </transactionShares>
                <transactionPricePerShare>
                    <value>47.77</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>D</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>319318</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
    </nonDerivativeTable>

    <derivativeTable>
        <derivativeTransaction>
            <securityTitle>
                <value>Dividend Equivalent Rights</value>
            </securityTitle>
            <conversionOrExercisePrice>
                <footnoteId id="F1"/>
            </conversionOrExercisePrice>
            <transactionDate>
                <value>2022-03-09</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>M</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>1246.2784</value>
                </transactionShares>
                <transactionPricePerShare>
                    <value>0.0</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>D</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <exerciseDate>
                <footnoteId id="F1"/>
            </exerciseDate>
            <expirationDate>
                <footnoteId id="F1"/>
            </expirationDate>
            <underlyingSecurity>
                <underlyingSecurityTitle>
                    <value>Common Stock</value>
                </underlyingSecurityTitle>
                <underlyingSecurityShares>
                    <value>1246.2784</value>
                </underlyingSecurityShares>
            </underlyingSecurity>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>0</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </derivativeTransaction>
    </derivativeTable>

    <footnotes>
        <footnote id="F1">The dividend equivalents were converted into, and paid in the form of, shares of the Issuer's common stock on a one-for-one basis in connection with the vesting of restricted stock units to which the dividend equivalents relate.  A cash amount was also paid to the holder to settle a fractional dividend equivalent.</footnote>
        <footnote id="F2">Payment of tax obligation by withholding securities incident to the vesting of securities in accordance with Rule 16b-3(e).</footnote>
    </footnotes>

    <ownerSignature>
        <signatureName>By: /s/ Sandra Garcia Attorney-in-Fact For: David Goeckeler</signatureName>
        <signatureDate>2022-03-10</signatureDate>
    </ownerSignature>
</ownershipDocument>
[{"type": "4", "sequence": "1", "filename": "edgardoc.xml", "description": "PRIMARY DOCUMENT", "secsgml_size_bytes": 7021}]
X0306
4
2022-03-09
0
0000106040
WESTERN DIGITAL CORP
WDC
0001713941
Goeckeler David
C/O WESTERN DIGITAL CORPORATION
5601 GREAT OAKS PARKWAY
SAN JOSE
CA
95119
1
1
0
0
Chief Executive Officer
Common Stock
2022-03-09
4
M
0
1246
0.0
A
369095
D
Common Stock
2022-03-09
4
F
0
49777
47.77
D
319318
D
Dividend Equivalent Rights
2022-03-09
4
M
0
1246.2784
0.0
D
Common Stock
1246.2784
0
D
The dividend equivalents were converted into, and paid in the form of, shares of the Issuer's common stock on a one-for-one basis in connection with the vesting of restricted stock units to which the dividend equivalents relate.  A cash amount was also paid to the holder to settle a fractional dividend equivalent.
Payment of tax obligation by withholding securities incident to the vesting of securities in accordance with Rule 16b-3(e).
By: /s/ Sandra Garcia Attorney-in-Fact For: David Goeckeler
2022-03-10