QuickLinks -- Click here to rapidly navigate through this document


Exhibit 5.1

LOGO

June 27, 2017

Liberty Media Corporation
12300 Liberty Boulevard
Englewood, CO 80112

Ladies and Gentlemen:

        As counsel for Liberty Media Corporation, a Delaware corporation ("Liberty"), we have examined and are familiar with Liberty's Registration Statement on Form S-3 (the "Registration Statement"), filed on the date hereof with the Securities and Exchange Commission for the purpose of registering under the Securities Act of 1933, as amended (the "Securities Act"), the sale from time to time of up to 52,000,000 shares of Liberty's Series C Liberty Formula One common stock, par value $.01 per share (the "Shares"), by the selling stockholders named in the prospectus forming part of the Registration Statement (the "Prospectus").

        In rendering our opinion, we have examined, among other things, originals, certified copies or copies otherwise identified to our satisfaction as being copies of originals, of (i) the Investment Agreement, dated as of December 13, 2016, among Liberty, Coatue Offshore Master Fund, Ltd. and Coatue Long Only Offshore Master Fund Ltd (the "Coatue Investment Agreement"), (ii) the Investment Agreement, dated as of December 13, 2016, between Liberty and D. E. Shaw Kalon Portfolios, L.L.C. (the "D. E. Shaw Kalon Investment Agreement"), (iii) the Investment Agreement, dated as of December 13, 2016, between Liberty and D. E. Shaw Valence Portfolios, L.L.C. (the "D. E. Shaw Valence Investment Agreement"), (iv) the Investment Agreement, dated as of December 13, 2016, among Liberty, JANA Master Fund, Ltd. and JANA Nirvana Master Fund, L.P. (the "JANA Investment Agreement"), (v) the Investment Agreement, dated as of December 13, 2016, between Liberty and Ruane, Cunniff & Goldfarb Inc. (the "Ruane Investment Agreement"), (vi) the Investment Agreement, dated as of December 13, 2016, among Liberty, Soroban Master Fund LP and Soroban Opportunities Master Fund LP (the "Soroban Investment Agreement") and (vii) the Investment Agreement, dated as of December 13, 2016, by and among Liberty, Viking Global Equities LP, Viking Global Equities II LP, VGE III Portfolio Ltd., Viking Long Fund Master Ltd. and Viking Global Opportunities Illiquid Investments Sub-Master LP (the "Viking Global Investment Agreement" and, collectively with the Coatue Investment Agreement, the D. E. Shaw Kalon Investment Agreement, the D. E. Shaw Valence Investment Agreement, the JANA Investment Agreement, the Ruane Investment Agreement and the Soroban Investment Agreement, the "Investment Agreements"), (viii) the Restated Certificate of Incorporation and Amended and Restated Bylaws of Liberty, (ix) records of proceedings of Liberty's Board of Directors, including committees thereof, with respect to the filing of the Registration Statement and the issuance of the Shares, and (x) such other documents, records, instruments and certificates of public officials and officers of Liberty as we deemed necessary or advisable for the purpose of rendering this opinion. We have assumed the authenticity of all documents submitted to us as originals and the conformity to authentic original documents of all documents submitted to us as copies.

        On the basis of such examination and review, we advise you that, in our opinion, upon the issuance and delivery of the Shares in accordance with the Investment Agreements, the Shares were duly authorized, validly issued and non-assessable.


LOGO

Liberty Media Corporation   June 27, 2016

        This opinion is limited to the corporate laws of the state of Delaware and the laws of the United States of America. We hereby consent to the filing of this opinion as Exhibit 5.1 to the Registration Statement and to the reference to us under the heading "Legal Matters" in the Prospectus. In giving the foregoing consent, we do not admit that we are in the category of persons whose consent is required under Section 7 of the Securities Act or the rules and regulations of the Securities and Exchange Commission promulgated thereunder.

 

Very truly yours,

 

/s/ Baker Botts L.L.P.

2




QuickLinks