EXHIBIT 5.1 Pepper Hamilton LLP Attorneys at Law 3000 Two Logan Square Eighteenth and Arch Streets Philadelphia, PA 19103-2799 215.981.4000 Fax 215.981.4750 November 19, 2002 Comcast Corporation 1500 Market Street Philadelphia, PA 19102-2148 Re: Comcast Corporation Registration Statement on Form S-8 Ladies and Gentlemen: Reference is made to a Registration Statement on Form S-8 of Comcast Corporation (the "Company") which is being filed with the Securities and Exchange Commission on the date hereof (the "Registration Statement"). Capitalized terms not otherwise defined herein shall have the meanings ascribed to them in the Registration Statement. The Registration Statement covers 156,795,832 shares of Class A Common Stock, par value $0.01, of the Company (the "Shares"), which may be issued by the Company pursuant to the Comcast Corporation 2002 Employee Stock Purchase Plan, as amended and restated effective November 18, 2002, the Comcast Corporation 2002 Stock Option Plan, as amended and restated effective November 18, 2002, the Comcast Corporation 1987 Stock Option Plan, as amended and restated effective November 18, 2002, the Comcast Corporation 2002 Restricted Stock Plan, as amended and restated effective November 18, 2002 and the AT&T Broadband Corp. Adjustment Plan (collectively, the "Benefit Plans"). The Registration Statement also relates to $718,000,000 of deferred obligations (the "Deferred Compensation Obligations") which may be incurred by the Company pursuant to the Comcast Corporation 2002 Deferred Compensation Plan, as amended and restated effective November 18, 2002 (the "Deferred Compensation Plan"), the AT&T Broadband Deferred Compensation Plan, as amended and restated effective November 18, 2002 (the "Broadband Deferred Compensation Plan") and the Comcast Corporation 2002 Deferred Stock Option Plan, as amended and restated effective November 18, 2002 (the "Deferred Stock Option Plan" and together with the Deferred Compensation Plan and the Broadband Deferred Compensation Plan, the "Deferred Plans"). We have examined the Registration Statement, including the exhibits thereto, the Company's Articles of Incorporation, as amended, the Company's By-Laws, the Deferred Plans, the Benefit Plans and such documents as we have deemed appropriate in rendering this opinion. In our examination, we have assumed the genuineness of all signatures, the authenticity of all documents submitted to us as originals and the authenticity of all documents submitted to us as copies of originals. Based on the foregoing, we are of the opinion that the Shares, when issued in accordance with the terms of the Benefit Plans, will be validly issued, fully paid and non-assessable. Based on the foregoing, it is also our opinion that the deferred compensation obligations incurred by the Company in accordance with the Deferred Plans will be valid and binding obligations of the Company enforceable against the Company in accordance with the terms of the Deferred Plans, except to the extent that reorganization, fraudulent transfer, moratorium or other similar laws relating to or affecting creditors' rights generally and (b) general principles of equity, regardless of whether enforceability is considered in a proceeding at law or in equity. This opinion is being furnished to you solely for submission to the Securities and Exchange Commission as an exhibit to the Registration Statement and, accordingly, may not be relied upon, quoted in any manner to, or delivered to any other person or entity, without in each instance our prior written consent. We assume no obligation to supplement this opinion if any applicable law changes after the date hereof or if we become aware of any fact that might change the opinion expressed herein after the date hereof. Our opinion is limited to the Business Corporation Law of the Commonwealth of Pennsylvania, as amended, including the statutory provisions and all applicable provisions of the Constitution of the Commonwealth of Pennsylvania and reported judicial decisions interpreting these laws, and the federal securities laws, each as in effect on the date hereof. We hereby consent to the filing of this opinion as an exhibit to the Registration Statement. In giving this consent, we do not thereby admit that we come within the category of persons whose consent is required under Section 7 of the Securities Act of 1933, as amended, or the rules and regulations of the Securities and Exchange Commission thereunder. Sincerely, /s/ Pepper Hamilton LLP PEPPER HAMILTON LLP