EXHIBIT 5 April 3, 1995 Hewlett-Packard Company 3000 Hanover Street Palo Alto, California 94304 32,000,000 Shares of common stock of Hewlett-Packard Company Offered pursuant to the 1995 Incentive Stock Plan Dear Sirs: I have examined the proceedings taken and the instruments executed in connection with the organization and present capitalization of Hewlett-Packard Company (the "Company") and the reservation for issuance and authorization of the sale and issuance from time to time of not in excess of 32,000,000 shares of common stock (the "Shares") pursuant to the terms of the Company's 1995 Incentive Stock Plan. The Shares are the subject of a Registration Statement on Form S-8 under the Securities Act of 1933, as amended, which is being filed with the Securities and Exchange Commission and to which this opinion is to be attached as an exhibit. Upon the basis of such examination, I am of the following opinion: 1. The authorized shares of the Company consist of 300,000,000 shares of preferred stock and 1,200,000,000 shares of common stock. 2. The proper corporate proceedings necessary to the reservation for issuance and the authorization of the sale and issuance from time to time of not in excess of 32,000,000 shares of the common stock of the Company pursuant to the Company's 1995 Incentive Stock Plan have been duly taken and, when issued pursuant to such plan, the Shares will be duly and validly issued and fully paid and nonassessable. 3. When the above-mentioned registration statement relating to the Shares has become effective and when the listing of the Shares on the New York and Pacific Stock Exchanges has been authorized, all authorizations, consents, approvals, or other orders of all United States regulatory authorities required for the issuance of Shares will have been obtained. You should be aware that I and other members of the Hewlett-Packard Company legal department participating in the preparation of the Registration Statement owned or held options to purchase 46, 210 shares of Hewlett-Packard Company common stock at April 3, 1995. You are further advised that I consent to the use of this opinion as an exhibit to the above-mentioned Registration Statement. Very truly yours, /s/ Ann O. Baskins -------------------- Ann O. Baskins Assistant Secretary And Managing Counsel 8