<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="../4_X02.xsl"?><ownershipDocument>    <schemaVersion>X0303</schemaVersion>    <documentType>4</documentType>    <periodOfReport>2010-03-04</periodOfReport>    <issuer>        <issuerCik>0000047217</issuerCik>        <issuerName>HEWLETT PACKARD CO</issuerName>        <issuerTradingSymbol>HPQ</issuerTradingSymbol>    </issuer>    <reportingOwner>        <reportingOwnerId>            <rptOwnerCik>0001018796</rptOwnerCik>            <rptOwnerName>BABBIO LAWRENCE T JR</rptOwnerName>        </reportingOwnerId>        <reportingOwnerAddress>            <rptOwnerStreet1>C/O HEWLETT-PACKARD COMPANY</rptOwnerStreet1>            <rptOwnerStreet2>3000 HANOVER STREET</rptOwnerStreet2>            <rptOwnerCity>PALO ALTO</rptOwnerCity>            <rptOwnerState>CA</rptOwnerState>            <rptOwnerZipCode>94304</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</value>            </securityTitle>            <transactionDate>                <value>2010-03-04</value>            </transactionDate>            <transactionCoding>                <transactionFormType>4</transactionFormType>                <transactionCode>M</transactionCode>                <equitySwapInvolved>0</equitySwapInvolved>            </transactionCoding>            <transactionAmounts>                <transactionShares>                    <value>15812</value>                </transactionShares>                <transactionPricePerShare>                    <value>47.44</value>                </transactionPricePerShare>                <transactionAcquiredDisposedCode>                    <value>A</value>                </transactionAcquiredDisposedCode>            </transactionAmounts>            <postTransactionAmounts>                <sharesOwnedFollowingTransaction>                    <value>52648</value>                </sharesOwnedFollowingTransaction>            </postTransactionAmounts>            <ownershipNature>                <directOrIndirectOwnership>                    <value>D</value>                </directOrIndirectOwnership>                <natureOfOwnership>                    <value></value>                </natureOfOwnership>            </ownershipNature>        </nonDerivativeTransaction>        <nonDerivativeTransaction>            <securityTitle>                <value>Common Stock</value>            </securityTitle>            <transactionDate>                <value>2010-03-04</value>            </transactionDate>            <transactionCoding>                <transactionFormType>4</transactionFormType>                <transactionCode>M</transactionCode>                <equitySwapInvolved>0</equitySwapInvolved>            </transactionCoding>            <transactionAmounts>                <transactionShares>                    <value>1053</value>                </transactionShares>                <transactionPricePerShare>                    <value>23.72</value>                </transactionPricePerShare>                <transactionAcquiredDisposedCode>                    <value>A</value>                </transactionAcquiredDisposedCode>            </transactionAmounts>            <postTransactionAmounts>                <sharesOwnedFollowingTransaction>                    <value>53701</value>                </sharesOwnedFollowingTransaction>            </postTransactionAmounts>            <ownershipNature>                <directOrIndirectOwnership>                    <value>D</value>                </directOrIndirectOwnership>                <natureOfOwnership>                    <value></value>                </natureOfOwnership>            </ownershipNature>        </nonDerivativeTransaction>        <nonDerivativeTransaction>            <securityTitle>                <value>Common  Stock</value>            </securityTitle>            <transactionDate>                <value>2010-03-04</value>            </transactionDate>            <transactionCoding>                <transactionFormType>4</transactionFormType>                <transactionCode>S</transactionCode>                <equitySwapInvolved>0</equitySwapInvolved>            </transactionCoding>            <transactionAmounts>                <transactionShares>                    <value>16865</value>                </transactionShares>                <transactionPricePerShare>                    <value>51.5142</value>                    <footnoteId id="F1"/>                </transactionPricePerShare>                <transactionAcquiredDisposedCode>                    <value>D</value>                </transactionAcquiredDisposedCode>            </transactionAmounts>            <postTransactionAmounts>                <sharesOwnedFollowingTransaction>                    <value>36836</value>                </sharesOwnedFollowingTransaction>            </postTransactionAmounts>            <ownershipNature>                <directOrIndirectOwnership>                    <value>D</value>                </directOrIndirectOwnership>                <natureOfOwnership>                    <value></value>                </natureOfOwnership>            </ownershipNature>        </nonDerivativeTransaction>    </nonDerivativeTable>    <derivativeTable>        <derivativeTransaction>            <securityTitle>                <value>Nonemployee Stock Option (Right to Buy)</value>            </securityTitle>            <conversionOrExercisePrice>                <value>47.44</value>            </conversionOrExercisePrice>            <transactionDate>                <value>2010-03-04</value>            </transactionDate>            <transactionCoding>                <transactionFormType>4</transactionFormType>                <transactionCode>M</transactionCode>                <equitySwapInvolved>0</equitySwapInvolved>            </transactionCoding>            <transactionAmounts>                <transactionShares>                    <value>15812</value>                </transactionShares>                <transactionPricePerShare>                    <value>0</value>                </transactionPricePerShare>                <transactionAcquiredDisposedCode>                    <value>D</value>                </transactionAcquiredDisposedCode>            </transactionAmounts>            <exerciseDate>                <value>2000-04-27</value>                <footnoteId id="F2"/>            </exerciseDate>            <expirationDate>                <value>2010-04-27</value>            </expirationDate>            <underlyingSecurity>                <underlyingSecurityTitle>                    <value>Common Stock</value>                </underlyingSecurityTitle>                <underlyingSecurityShares>                    <value>15812</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>Nonemployee Stock Option (Right to Buy)</value>            </securityTitle>            <conversionOrExercisePrice>                <value>23.72</value>            </conversionOrExercisePrice>            <transactionDate>                <value>2010-03-04</value>            </transactionDate>            <transactionCoding>                <transactionFormType>4</transactionFormType>                <transactionCode>M</transactionCode>                <equitySwapInvolved>0</equitySwapInvolved>            </transactionCoding>            <transactionAmounts>                <transactionShares>                    <value>1053</value>                </transactionShares>                <transactionPricePerShare>                    <value>0</value>                </transactionPricePerShare>                <transactionAcquiredDisposedCode>                    <value>D</value>                </transactionAcquiredDisposedCode>            </transactionAmounts>            <exerciseDate>                <value>2001-04-27</value>                <footnoteId id="F2"/>            </exerciseDate>            <expirationDate>                <value>2010-04-27</value>            </expirationDate>            <underlyingSecurity>                <underlyingSecurityTitle>                    <value>Common Stock</value>                </underlyingSecurityTitle>                <underlyingSecurityShares>                    <value>1053</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>Restricted Stock Units</value>            </securityTitle>            <conversionOrExercisePrice>                <footnoteId id="F3"/>            </conversionOrExercisePrice>            <transactionDate>                <value>2009-07-01</value>            </transactionDate>            <transactionCoding>                <transactionFormType>4</transactionFormType>                <transactionCode>A</transactionCode>                <equitySwapInvolved>0</equitySwapInvolved>            </transactionCoding>            <transactionAmounts>                <transactionShares>                    <value>11.5063</value>                    <footnoteId id="F4"/>                </transactionShares>                <transactionPricePerShare>                    <value>0</value>                </transactionPricePerShare>                <transactionAcquiredDisposedCode>                    <value>A</value>                </transactionAcquiredDisposedCode>            </transactionAmounts>            <exerciseDate>                <value>2010-04-20</value>                <footnoteId id="F4"/>            </exerciseDate>            <expirationDate>                <value>2019-04-20</value>                <footnoteId id="F4"/>            </expirationDate>            <underlyingSecurity>                <underlyingSecurityTitle>                    <value>Common Stock</value>                </underlyingSecurityTitle>                <underlyingSecurityShares>                    <value>11.5063</value>                    <footnoteId id="F4"/>                </underlyingSecurityShares>            </underlyingSecurity>            <postTransactionAmounts>                <sharesOwnedFollowingTransaction>                    <value>2174.5063</value>                </sharesOwnedFollowingTransaction>            </postTransactionAmounts>            <ownershipNature>                <directOrIndirectOwnership>                    <value>D</value>                </directOrIndirectOwnership>                <natureOfOwnership>                    <value></value>                </natureOfOwnership>            </ownershipNature>        </derivativeTransaction>    </derivativeTable>    <footnotes>        <footnote id="F1">The price in Column 4 is a weighted average price. The prices actually received ranged from $51.500 to $51.5202. Upon request, the reporting person will provide to the Issuer, any security holder of the Issuer, or the SEC staff information regarding the number of shares sold at each price within the range.</footnote>        <footnote id="F2">This option cliff vested and became exercisable beginning on this date.</footnote>        <footnote id="F3">Each restricted stock unit represents a contingent right to receive one share of HP common stock.</footnote>        <footnote id="F4">As previously reported, on 04/20/09 the Reporting Person was granted 2,163 restricted stock units (&quot;RSUs&quot;), all of which will cliff vest on 04/20/10, at which time the vested shares will be delivered to the reporting person. Dividend equivalent rights accrue with respect to these RSUs when and as dividends are paid on HP common stock.  The 11.5063 dividend equivalent rights being reported reflect  4.4736 dividend equivalent rights at $38.68 per RSU credited to the Reporting Person's account on 07/01/09; 3.7165 dividend equivalent rights at $45.96 per RSU credited to the Reporting Person's account on 10/07/09; and 3.3162 dividend equivalent rights at $52.18 per RSU credited to the Reporting Person's Account on 01/06/10.</footnote>    </footnotes>    <remarks></remarks>    <ownerSignature>        <signatureName>/s/ David Ritenour as Attorney-in-Fact for Lawrence T. Babbio, Jr.</signatureName>        <signatureDate>2010-03-08</signatureDate>    </ownerSignature></ownershipDocument>