<?xml version='1.0' encoding='utf-8'?>
<FilingSummary>
  <Version>3.24.3</Version>
  <ProcessingTime/>
  <ReportFormat>html</ReportFormat>
  <ContextCount>223</ContextCount>
  <ElementCount>245</ElementCount>
  <EntityCount>1</EntityCount>
  <FootnotesReported>false</FootnotesReported>
  <SegmentCount>59</SegmentCount>
  <ScenarioCount>0</ScenarioCount>
  <TuplesReported>false</TuplesReported>
  <UnitCount>6</UnitCount>
  <MyReports>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R1.htm</HtmlFileName>
      <LongName>0000001 - Document - Cover Page</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/CoverPage</Role>
      <ShortName>Cover Page</ShortName>
      <MenuCategory>Cover</MenuCategory>
      <Position>1</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R2.htm</HtmlFileName>
      <LongName>0000002 - Statement - CONDENSED CONSOLIDATED BALANCE SHEETS</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/CONDENSEDCONSOLIDATEDBALANCESHEETS</Role>
      <ShortName>CONDENSED CONSOLIDATED BALANCE SHEETS</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>2</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R3.htm</HtmlFileName>
      <LongName>0000003 - Statement - CONDENSED CONSOLIDATED BALANCE SHEETS (Parenthetical)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/CONDENSEDCONSOLIDATEDBALANCESHEETSParenthetical</Role>
      <ShortName>CONDENSED CONSOLIDATED BALANCE SHEETS (Parenthetical)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>3</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R4.htm</HtmlFileName>
      <LongName>0000004 - Statement - CONDENSED CONSOLIDATED STATEMENTS OF OPERATIONS</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/CONDENSEDCONSOLIDATEDSTATEMENTSOFOPERATIONS</Role>
      <ShortName>CONDENSED CONSOLIDATED STATEMENTS OF OPERATIONS</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>4</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R5.htm</HtmlFileName>
      <LongName>0000005 - Statement - CONDENSED CONSOLIDATED STATEMENTS OF COMPREHENSIVE LOSS</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/CONDENSEDCONSOLIDATEDSTATEMENTSOFCOMPREHENSIVELOSS</Role>
      <ShortName>CONDENSED CONSOLIDATED STATEMENTS OF COMPREHENSIVE LOSS</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>5</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R6.htm</HtmlFileName>
      <LongName>0000006 - Statement - CONDENSED CONSOLIDATED STATEMENTS OF STOCKHOLDERS??? EQUITY</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/CONDENSEDCONSOLIDATEDSTATEMENTSOFSTOCKHOLDERSEQUITY</Role>
      <ShortName>CONDENSED CONSOLIDATED STATEMENTS OF STOCKHOLDERS??? EQUITY</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>6</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R7.htm</HtmlFileName>
      <LongName>0000007 - Statement - CONDENSED CONSOLIDATED STATEMENTS OF CASH FLOWS</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/CONDENSEDCONSOLIDATEDSTATEMENTSOFCASHFLOWS</Role>
      <ShortName>CONDENSED CONSOLIDATED STATEMENTS OF CASH FLOWS</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>7</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R8.htm</HtmlFileName>
      <LongName>0000008 - Disclosure - Organization, Business and Basis of Presentation</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/OrganizationBusinessandBasisofPresentation</Role>
      <ShortName>Organization, Business and Basis of Presentation</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>8</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R9.htm</HtmlFileName>
      <LongName>0000009 - Disclosure - Summary of Significant Accounting Policies</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/SummaryofSignificantAccountingPolicies</Role>
      <ShortName>Summary of Significant Accounting Policies</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>9</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R10.htm</HtmlFileName>
      <LongName>0000010 - Disclosure - Liquidity and Uncertainties</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/LiquidityandUncertainties</Role>
      <ShortName>Liquidity and Uncertainties</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>10</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R11.htm</HtmlFileName>
      <LongName>0000011 - Disclosure - Cash, Cash Equivalents and Marketable Securities</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/CashCashEquivalentsandMarketableSecurities</Role>
      <ShortName>Cash, Cash Equivalents and Marketable Securities</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>11</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R12.htm</HtmlFileName>
      <LongName>0000012 - Disclosure - Inventory</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/Inventory</Role>
      <ShortName>Inventory</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>12</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R13.htm</HtmlFileName>
      <LongName>0000013 - Disclosure - Accrued Liabilities</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/AccruedLiabilities</Role>
      <ShortName>Accrued Liabilities</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>13</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R14.htm</HtmlFileName>
      <LongName>0000014 - Disclosure - Long Term Debt</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/LongTermDebt</Role>
      <ShortName>Long Term Debt</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>14</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R15.htm</HtmlFileName>
      <LongName>0000015 - Disclosure - Stockholders' Equity</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/StockholdersEquity</Role>
      <ShortName>Stockholders' Equity</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>15</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R16.htm</HtmlFileName>
      <LongName>0000016 - Disclosure - Stock-based Compensation</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/StockbasedCompensation</Role>
      <ShortName>Stock-based Compensation</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>16</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R17.htm</HtmlFileName>
      <LongName>0000017 - Disclosure - Commitments and Contingencies</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/CommitmentsandContingencies</Role>
      <ShortName>Commitments and Contingencies</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>17</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R18.htm</HtmlFileName>
      <LongName>0000018 - Disclosure - Subsequent Events</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/SubsequentEvents</Role>
      <ShortName>Subsequent Events</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>18</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R19.htm</HtmlFileName>
      <LongName>995410 - Disclosure - Pay vs Performance Disclosure</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xbrl.sec.gov/ecd/role/PvpDisclosure</Role>
      <ShortName>Pay vs Performance Disclosure</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>19</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R20.htm</HtmlFileName>
      <LongName>995445 - Disclosure - Insider Trading Arrangements</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xbrl.sec.gov/ecd/role/InsiderTradingArrangements</Role>
      <ShortName>Insider Trading Arrangements</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>20</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R21.htm</HtmlFileName>
      <LongName>9954471 - Disclosure - Summary of Significant Accounting Policies (Policies)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/SummaryofSignificantAccountingPoliciesPolicies</Role>
      <ShortName>Summary of Significant Accounting Policies (Policies)</ShortName>
      <MenuCategory>Policies</MenuCategory>
      <ParentRole>http://www.madrigalpharma.com/role/SummaryofSignificantAccountingPolicies</ParentRole>
      <Position>21</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R22.htm</HtmlFileName>
      <LongName>9954472 - Disclosure - Summary of Significant Accounting Policies (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/SummaryofSignificantAccountingPoliciesTables</Role>
      <ShortName>Summary of Significant Accounting Policies (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.madrigalpharma.com/role/SummaryofSignificantAccountingPolicies</ParentRole>
      <Position>22</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R23.htm</HtmlFileName>
      <LongName>9954473 - Disclosure - Cash, Cash Equivalents and Marketable Securities (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/CashCashEquivalentsandMarketableSecuritiesTables</Role>
      <ShortName>Cash, Cash Equivalents and Marketable Securities (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.madrigalpharma.com/role/CashCashEquivalentsandMarketableSecurities</ParentRole>
      <Position>23</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R24.htm</HtmlFileName>
      <LongName>9954474 - Disclosure - Inventory (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/InventoryTables</Role>
      <ShortName>Inventory (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.madrigalpharma.com/role/Inventory</ParentRole>
      <Position>24</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R25.htm</HtmlFileName>
      <LongName>9954475 - Disclosure - Accrued Liabilities (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/AccruedLiabilitiesTables</Role>
      <ShortName>Accrued Liabilities (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.madrigalpharma.com/role/AccruedLiabilities</ParentRole>
      <Position>25</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R26.htm</HtmlFileName>
      <LongName>9954476 - Disclosure - Long Term Debt (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/LongTermDebtTables</Role>
      <ShortName>Long Term Debt (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.madrigalpharma.com/role/LongTermDebt</ParentRole>
      <Position>26</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R27.htm</HtmlFileName>
      <LongName>9954477 - Disclosure - Stock-based Compensation (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/StockbasedCompensationTables</Role>
      <ShortName>Stock-based Compensation (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.madrigalpharma.com/role/StockbasedCompensation</ParentRole>
      <Position>27</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R28.htm</HtmlFileName>
      <LongName>9954478 - Disclosure - Summary of Significant Accounting Policies - Concentrations of Credit Risk and Significant Customers (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/SummaryofSignificantAccountingPoliciesConcentrationsofCreditRiskandSignificantCustomersDetails</Role>
      <ShortName>Summary of Significant Accounting Policies - Concentrations of Credit Risk and Significant Customers (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>28</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R29.htm</HtmlFileName>
      <LongName>9954479 - Disclosure - Summary of Significant Accounting Policies - Marketable Securities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/SummaryofSignificantAccountingPoliciesMarketableSecuritiesDetails</Role>
      <ShortName>Summary of Significant Accounting Policies - Marketable Securities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>29</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R30.htm</HtmlFileName>
      <LongName>9954480 - Disclosure - Summary of Significant Accounting Policies - Income Taxes (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/SummaryofSignificantAccountingPoliciesIncomeTaxesDetails</Role>
      <ShortName>Summary of Significant Accounting Policies - Income Taxes (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>30</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R31.htm</HtmlFileName>
      <LongName>9954481 - Disclosure - Summary of Significant Accounting Policies - Basic and Diluted Loss Per Common Share (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/SummaryofSignificantAccountingPoliciesBasicandDilutedLossPerCommonShareDetails</Role>
      <ShortName>Summary of Significant Accounting Policies - Basic and Diluted Loss Per Common Share (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>31</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R32.htm</HtmlFileName>
      <LongName>9954482 - Disclosure - Liquidity and Uncertainties (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/LiquidityandUncertaintiesDetails</Role>
      <ShortName>Liquidity and Uncertainties (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.madrigalpharma.com/role/LiquidityandUncertainties</ParentRole>
      <Position>32</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R33.htm</HtmlFileName>
      <LongName>9954483 - Disclosure - Cash, Cash Equivalents and Marketable Securities - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/CashCashEquivalentsandMarketableSecuritiesNarrativeDetails</Role>
      <ShortName>Cash, Cash Equivalents and Marketable Securities - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.madrigalpharma.com/role/CashCashEquivalentsandMarketableSecuritiesTables</ParentRole>
      <Position>33</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R34.htm</HtmlFileName>
      <LongName>9954484 - Disclosure - Cash, Cash Equivalents and Marketable Securities - Cash, Cash Equivalents and Available-for-Sale Marketable Securities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/CashCashEquivalentsandMarketableSecuritiesCashCashEquivalentsandAvailableforSaleMarketableSecuritiesDetails</Role>
      <ShortName>Cash, Cash Equivalents and Marketable Securities - Cash, Cash Equivalents and Available-for-Sale Marketable Securities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>34</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R35.htm</HtmlFileName>
      <LongName>9954485 - Disclosure - Inventory (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/InventoryDetails</Role>
      <ShortName>Inventory (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.madrigalpharma.com/role/InventoryTables</ParentRole>
      <Position>35</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R36.htm</HtmlFileName>
      <LongName>9954486 - Disclosure - Accrued Liabilities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/AccruedLiabilitiesDetails</Role>
      <ShortName>Accrued Liabilities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.madrigalpharma.com/role/AccruedLiabilitiesTables</ParentRole>
      <Position>36</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R37.htm</HtmlFileName>
      <LongName>9954487 - Disclosure - Long Term Debt - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/LongTermDebtNarrativeDetails</Role>
      <ShortName>Long Term Debt - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>37</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R38.htm</HtmlFileName>
      <LongName>9954488 - Disclosure - Long Term Debt - Maturities of Long-Term Debt (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/LongTermDebtMaturitiesofLongTermDebtDetails</Role>
      <ShortName>Long Term Debt - Maturities of Long-Term Debt (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>38</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R39.htm</HtmlFileName>
      <LongName>9954489 - Disclosure - Stockholders' Equity- Common Stock (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/StockholdersEquityCommonStockDetails</Role>
      <ShortName>Stockholders' Equity- Common Stock (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>39</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R40.htm</HtmlFileName>
      <LongName>9954490 - Disclosure - Stockholders' Equity - Preferred Stock (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/StockholdersEquityPreferredStockDetails</Role>
      <ShortName>Stockholders' Equity - Preferred Stock (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>40</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R41.htm</HtmlFileName>
      <LongName>9954491 - Disclosure - Stockholders' Equity - Public Offering (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/StockholdersEquityPublicOfferingDetails</Role>
      <ShortName>Stockholders' Equity - Public Offering (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>41</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R42.htm</HtmlFileName>
      <LongName>9954492 - Disclosure - Stockholders' Equity - At The Market Issuances (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/StockholdersEquityAtTheMarketIssuancesDetails</Role>
      <ShortName>Stockholders' Equity - At The Market Issuances (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>42</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R43.htm</HtmlFileName>
      <LongName>9954493 - Disclosure - Stock-based Compensation - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/StockbasedCompensationNarrativeDetails</Role>
      <ShortName>Stock-based Compensation - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>43</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R44.htm</HtmlFileName>
      <LongName>9954494 - Disclosure - Stock-based Compensation - Stock Option (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/StockbasedCompensationStockOptionDetails</Role>
      <ShortName>Stock-based Compensation - Stock Option (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>44</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R45.htm</HtmlFileName>
      <LongName>9954495 - Disclosure - Stock-based Compensation - Restricted Stock Units (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/StockbasedCompensationRestrictedStockUnitsDetails</Role>
      <ShortName>Stock-based Compensation - Restricted Stock Units (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>45</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R46.htm</HtmlFileName>
      <LongName>9954496 - Disclosure - Stock-based Compensation - Performance-Based Restricted Stock Units (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/StockbasedCompensationPerformanceBasedRestrictedStockUnitsDetails</Role>
      <ShortName>Stock-based Compensation - Performance-Based Restricted Stock Units (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>46</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R47.htm</HtmlFileName>
      <LongName>9954497 - Disclosure - Stock-based Compensation - Stock-Based Compensation Expense (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/StockbasedCompensationStockBasedCompensationExpenseDetails</Role>
      <ShortName>Stock-based Compensation - Stock-Based Compensation Expense (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>47</Position>
    </Report>
    <Report instance="mdgl-20240930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R48.htm</HtmlFileName>
      <LongName>9954498 - Disclosure - Commitments and Contingencies (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.madrigalpharma.com/role/CommitmentsandContingenciesDetails</Role>
      <ShortName>Commitments and Contingencies (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.madrigalpharma.com/role/CommitmentsandContingencies</ParentRole>
      <Position>48</Position>
    </Report>
    <Report>
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <LongName>All Reports</LongName>
      <ReportType>Book</ReportType>
      <ShortName>All Reports</ShortName>
    </Report>
  </MyReports>
  <InputFiles>
    <File doctype="10-Q" isDefinitelyFs="true" isUsgaap="true" original="mdgl-20240930.htm">mdgl-20240930.htm</File>
    <File>mdgl-20240930.xsd</File>
    <File>mdgl-20240930_cal.xml</File>
    <File>mdgl-20240930_def.xml</File>
    <File>mdgl-20240930_lab.xml</File>
    <File>mdgl-20240930_pre.xml</File>
  </InputFiles>
  <SupplementalFiles/>
  <BaseTaxonomies>
    <BaseTaxonomy items="588">http://fasb.org/us-gaap/2023</BaseTaxonomy>
    <BaseTaxonomy items="30">http://xbrl.sec.gov/dei/2023</BaseTaxonomy>
    <BaseTaxonomy items="10">http://xbrl.sec.gov/ecd/2023</BaseTaxonomy>
  </BaseTaxonomies>
  <HasPresentationLinkbase>true</HasPresentationLinkbase>
  <HasCalculationLinkbase>true</HasCalculationLinkbase>
</FilingSummary>
