Exhibit 5.1

December 6, 2019
Grubhub Inc.
111 West Washington Street, #2100
Chicago, IL 60602
Ladies and Gentlemen:
We are acting as special counsel to Grubhub Inc., a Delaware corporation (the “Company”), in connection with the filing by the Company of a Registration Statement on FormS-8 (the “Registration Statement”) under the Securities Act of 1933, as amended (the “Act”), with the Securities and Exchange Commission (the “Commission”) covering the offering of up to 212,246 shares of common stock, par value $0.0001 per share, of the Company (the “Award Shares”) pursuant to the Grubhub Inc. December 2019 Restricted Stock Unit Inducement Awards (the “Awards”).
For purposes of this letter, we have examined such documents, records, certificates, resolutions and other instruments deemed necessary as a basis for this opinion, and we have assumed the authenticity of all documents submitted to us as originals, the conformity to the originals of all documents submitted to us as copies and the authenticity of the originals of all documents submitted to us as copies.
Based upon and subject to the foregoing qualifications, assumptions and limitations and the further limitations set forth below, we advise you that the Award Shares are duly authorized and when the Award Shares have been duly issued pursuant to and in accordance with the terms and conditions of the Awards and the Company’s Amended and Restated Certificate of Incorporation and Amended and Restated Bylaws, the Award Shares will be validly issued, fully paid andnon-assessable.
Our opinions expressed above are subject to the qualifications that we express no opinion as to the applicability of, compliance with, or effect of any laws except the General Corporation Law of the State of Delaware.
We have relied without independent investigation upon, among other things, an assurance from the Company that the number of shares which the Company is authorized to issue in its Amended and Restated Certificate of Incorporation exceeds the number of shares outstanding and the number of shares which the Company is obligated to issue (or had otherwise reserved for issuance) for any purposes other than issuances of the Award Shares by at least the number of Award Shares and we have assumed that such condition will remain true at all future times relevant to this opinion.
