<DOCUMENT>
<TYPE>EX-5
<SEQUENCE>3
<FILENAME>dex5.txt
<DESCRIPTION>OPINION OF KENNETH M. VITTOR
<TEXT>
<PAGE>

                                                                     (EXHIBIT 5)
                                                                     -----------
                                                     June 26, 2002




The McGraw-Hill Companies, Inc.
1221 Avenue of the Americas
New York, New York  10020

Ladies and Gentlemen:

         I have acted as counsel to The McGraw-Hill Companies, Inc. (the
"Corporation") in connection with the 2002 Stock Incentive Plan (the "Plan"), as
more fully described in the Registration Statement on Form S-8 being filed by
the Corporation with the Securities and Exchange Commission pursuant to the
Securities Act of 1933, as amended.

         In my opinion the shares of Common Stock, par value $1.00, of the
Corporation covered by the Plan have been duly authorized and, when issued in
accordance with the terms of the Plan, will be legally and validly issued, fully
paid and non-assessable.

         I hereby consent to the filing of this opinion as an exhibit to the
above-described Registration Statement and to the reference to this opinion in
said Registration Statement, and any amendments thereto.

                                                     Very truly yours,


                                                     /s/ Kenneth M. Vittor

                                                     Kenneth M. Vittor

KMV/lb

</TEXT>
</DOCUMENT>
