Exhibit 23.1 CONSENT OF ERNST & YOUNG LLP, INDEPENDENT AUDITORS We consent to the incorporation by reference in the Registration Statements (Form S-3 No. 333-30786 and Form S-4 No. 333-73454) and the related Prospectuses and in the Registration Statements (Form S-8 No. 2-90239, No. 2-92331, No. 2-96361, No. 33-30769, No. 33-31496, No. 33-31500, No. 33-38579, No. 33-50699, No. 33-52291, No. 33-58447, No. 33-65179, No. 333-22947, No. 333-30459, No. 333-45231, No. 333-35836, No. 333-70232, and No. 333-33012) of Hewlett-Packard Company of our reports dated January 16, 2002 with respect to the consolidated financial statements and schedule of Compaq Computer Corporation as of December 31, 2001 and 2000 and for each of the two years in the period ended December 31, 2001 included in the Current Report on Form 8-K of Hewlett-Packard Company dated February 14, 2002, filed with the Securities and Exchange Commission. /s/ ERNST & YOUNG LLP Ernst & Young LLP Houston, Texas February 12, 2002