EXHIBIT 5.1 ___________ WOODS, OVIATT, GILMAN, STURMAN AND CLARK LLP 44 Exchange St. Rochester, NY 14614 May 22, 1997 Paychex, Inc. 911 Panorama Trail South Rochester, NY 14625 RE: Paychex, Inc. Registration Statement on Post-Effective Amendment #1 to Form S-3 (File Number 333-15105) Gentlemen: We are acting as counsel for Paychex, Inc. (the "Company"), a Delaware corporation, in connection with the proposed public offering ("Public Offering") by certain stockholders ("Selling Stockholders") of 1,579,908 of the $.01 par value common stock of the Company, covered by the above captioned registration statement (the "Registration Statement"). We are familiar with the Certificate of Incorporation of the Company, as amended, the by-laws of the Company and the corporate proceedings taken to authorize the issuance of the aforesaid shares of common stock to the Selling Stockholders. Based upon the foregoing, we are of the opinion that: 1. The Company has been duly organized and is validly existing as a corporation under the laws of the State of Delaware. 2. All necessary action had been taken by the Board of Directors of the Company to authorize the issuance of the shares of common stock being sold by the Selling Stockholders in the Public Offering. 3. When certificates for the shares of common stock being sold by the Selling Stockholders in the Public Offering were delivered in accordance with the terms of the merger of Paychex Merger Corp. merged with and into National Business Solutions, Inc., such shares of common stock were legally issued, fully paid and non-assessable. We hereby consent to the filing of this opinion as as exhibit to the Registration Statement and the reference made under the heading "Legal Matters" constituting a part of the Registration Statement. Very truly yours, WOODS, OVIATT, GILMAN, STURMAN & CLARKE LLP /s/ Harry P. Messina, Jr. - ------------------------- Harry P. Messina, Jr.