EXHIBIT 5.1 September 27, 2002 KLA-Tencor Corporation 160 Rio Robles San Jose, CA 95134 RE: REGISTRATION STATEMENT ON FORM S-8 Ladies and Gentlemen: I have examined the Registration Statement on Form S-8 to be filed with the Securities and Exchange Commission on or about September 27, 2002 (the "Registration Statement"), in connection with the registration under the Securities Act of 1933, as amended, of an additional 5,691,826 shares of KLA-Tencor Common Stock reserved for issuance under the Restated 1982 Stock Option Plan, as amended (the "1982 Plan"), 400,000 shares of KLA-Tencor Common Stock reserved for issuance under the Amended and Restated 1997 Employee Stock Purchase Plan (the "1997 Plan") and 7,589,102 shares of KLA-Tencor Common Stock reserved for issuance under the Amended and Restated 2000 Non-Statutory Stock Option Plan (the "2000 Plan"). Such shares of Common Stock are referred to herein as the "Shares." As legal counsel, I have examined the proceedings taken and proposed to be taken in connection with the issuance, sale and payment of consideration for the Shares to be issued under the 1982 Plan, the 1997 Plan and the 2000 Plan. It is my opinion that, when issued and sold in compliance with applicable prospectus delivery requirements and in the manner referred to in the 1982 Plan, the 1997 Plan and the 2000 Plan and pursuant to the agreements which accompany the 1982 Plan, the 1997 Plan and the 2000 Plan, the Shares will be legally and validly issued, fully paid and non-assessable. I consent to the use of this opinion as an exhibit to the Registration Statement and further consent to the use of my name wherever appearing in the Registration Statement and any amendments thereto. Sincerely, /s/ Stuart J. Nichols --------------------------------------- Stuart J. Nichols Vice President, General Counsel KLA-Tencor Corporation