EXHIBIT 5.1 March 25, 2002 Costco Wholesale Corporation 999 Lake Drive Issaquah, Washington 98027 Re: Costco Wholesale Corporation - Public Offering of 5 1/2% Senior Notes Due March 15, 2007 Ladies and Gentlemen: We have acted as counsel to Costco Wholesale Corporation, a Washington corporation (the "Company"), in connection with the filing by the Company with the Securities and Exchange Commission (the "Commission") of a Registration Statement on Form S-3 (File No. 333-01127) and a Registration Statement on Form S-3 (File No. 333-72122) (together, the "Registration Statement") pursuant to the Securities Act of 1933, as amended (the "Securities Act"), as declared effective under the Securities Act, and the related prospectus dated March 20, 2002, as supplemented by a prospectus supplement dated March 20, 2002 (the final prospectus, in the form filed with the Commission pursuant to Rule 424(b) of the rules and regulations under the Act, the "Prospectus"), relating to the offering by the Company of $300,000,000 aggregate principal amount of its 5 1/2% Senior Notes Due March 15, 2007 (the "Securities"). The Securities will be issued pursuant to a Senior Debt Securities Indenture dated October 26, 2001 and the First Supplemental Indenture dated March 20, 2002, each between U.S. Bank National Association, as Trustee, and the Company (collectively, the "Indenture"). I. We have assumed the authenticity of all records, documents and instruments submitted to us as originals, the genuineness of all signatures, the legal capacity of natural persons and the conformity to the originals of all records, documents and instruments submitted to us as copies. We have based our opinion upon our review of the following records, documents, instruments and certificates and such additional certificates relating to factual matters as we have deemed necessary or appropriate for our opinion: (a) The Registration Statement; <Page> Costco Wholesale Corporation March 25, 2002 Page 2 (b) The Indenture; (c) The Prospectus; (d) The Securities; (e) The Amended and Restated Articles of Incorporation (including all amendments thereto) of the Company certified by the Washington Secretary of State as of March 21, 2002, and certified to us by an officer of the Company as being complete and in full force and effect as of the date of this opinion; (f) A Certificate of Existence relating to the Company issued by the Washington Secretary of State, dated March 21, 2002; (g) The Bylaws of the Company (and all amendments thereto) certified to us by an officer of the Company as being complete and in full force and effect as of the date of this opinion; (h) Records certified to us by an officer of the Company as constituting all records of proceedings and actions of the board of directors of the Company relating to the issuance of the Securities by the Company; and (i) A certificate (the "Officer's Certificate") of an officer of the Company as to certain factual matters. II. This opinion is limited to the federal laws of the United States of America, the laws of the State of Washington, and the laws of the State of New York, and we disclaim any opinion as to the laws of any other jurisdiction. We express no opinion as to the applicable choice of law rules that may affect the interpretation or enforcement of the Securities. We further disclaim any opinion as to any statute, rule, regulation, ordinance, order or other promulgation of any regional or local governmental body or as to any related judicial or administrative opinion. III. Based upon the foregoing and our examination of such questions of law as we have deemed necessary or appropriate for the purpose of our opinion, and subject to the limitations and qualifications expressed herein, it is our opinion that the Securities, when 2 <Page> Costco Wholesale Corporation March 25, 2002 Page 3 sold and after receipt of payment therefor, will be legally issued, fully paid and non-assessable and will constitute valid and binding obligations of the Company, enforceable against the Company in accordance with their terms, subject, as to enforcement, (i) to bankruptcy, insolvency, reorganization, arrangement, moratorium and other laws of general applicability relating to or affecting creditors' rights and (ii) to general principles of equity, whether such enforceability is considered in a proceeding in equity or at law. IV. We further advise you that: A. As noted, the enforceability of the Securities is subject to the effect of general principles of equity. These principles include, without limitation, concepts of commercial reasonableness, materiality and good faith and fair dealing. As applied to the Securities, these principles will require the parties thereto to act reasonably, in good faith and in a manner that is not arbitrary or capricious in the administration and enforcement of the Securities and will preclude the parties thereto from invoking penalties for defaults that bear no reasonable relation to the damage suffered or that would otherwise work a forfeiture. B. The enforceability of the Securities is subject to the effects of (i) Section 1-102 of the New York Uniform Commercial Code (the "New York UCC"), which provides that obligations of good faith, diligence, reasonableness and care prescribed by the New York UCC may not be disclaimed by agreement, although the parties may by agreement determine the standards by which the performance of such obligations is to be measured if those standards are not manifestly unreasonable, (ii) Section 1-203 of the New York UCC, which imposes an obligation of good faith in the performance or enforcement of a contract and (iii) legal principles under which a court may refuse to enforce, or may limit the enforcement of, a contract or any clause of a contract that a court finds as a matter of law to have been unconscionable at the time it was made. C. The effectiveness of indemnities, rights of contribution, exculpatory provisions and waivers of the benefits of statutory provisions may be limited on public policy grounds. D. Provisions of the Securities requiring that waivers must be in writing may not be binding or enforceable if a non-executory oral agreement has been created 3 <Page> Costco Wholesale Corporation March 25, 2002 Page 4 modifying any such provision or an implied agreement by trade practice or course of conduct has given rise to a waiver. V. We hereby consent to the filing of this opinion as an exhibit to the Current Report of the Company on Form 8-K and to the Registration Statement and to the reference to this firm under the heading "Legal Opinions" in the Prospectus or any supplement thereto constituting a part of the Registration Statement. This opinion is rendered to you in connection with the filing of the Current Report of the Company on Form 8-K and is solely for your benefit and the benefit of the purchasers of the Securities. This opinion may not be relied upon by any other person, firm, corporation or other entity without our prior written consent. We disclaim any obligation to advise you of any change of law that occurs, or any facts of which we become aware, after the date of this opinion. Very truly yours, Heller Ehrman White & McAuliffe LLP 4