<?xml version='1.0' encoding='utf-8'?>
<FilingSummary>
  <Version>3.24.0.1</Version>
  <ProcessingTime/>
  <ReportFormat>html</ReportFormat>
  <ContextCount>421</ContextCount>
  <ElementCount>495</ElementCount>
  <EntityCount>1</EntityCount>
  <FootnotesReported>false</FootnotesReported>
  <SegmentCount>109</SegmentCount>
  <ScenarioCount>0</ScenarioCount>
  <TuplesReported>false</TuplesReported>
  <UnitCount>7</UnitCount>
  <MyReports>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R1.htm</HtmlFileName>
      <LongName>0000001 - Document - Document and Entity Information</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/DocumentandEntityInformation</Role>
      <ShortName>Document and Entity Information</ShortName>
      <MenuCategory>Cover</MenuCategory>
      <Position>1</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R2.htm</HtmlFileName>
      <LongName>0000002 - Document - Audit Information</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/AuditInformation</Role>
      <ShortName>Audit Information</ShortName>
      <MenuCategory>Cover</MenuCategory>
      <Position>2</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R3.htm</HtmlFileName>
      <LongName>0000003 - Statement - CONSOLIDATED BALANCE SHEETS</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/CONSOLIDATEDBALANCESHEETS</Role>
      <ShortName>CONSOLIDATED BALANCE SHEETS</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>3</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R4.htm</HtmlFileName>
      <LongName>0000004 - Statement - CONSOLIDATED BALANCE SHEETS (Parenthetical)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/CONSOLIDATEDBALANCESHEETSParenthetical</Role>
      <ShortName>CONSOLIDATED BALANCE SHEETS (Parenthetical)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>4</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R5.htm</HtmlFileName>
      <LongName>0000005 - Statement - CONSOLIDATED STATEMENTS OF OPERATIONS</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/CONSOLIDATEDSTATEMENTSOFOPERATIONS</Role>
      <ShortName>CONSOLIDATED STATEMENTS OF OPERATIONS</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>5</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R6.htm</HtmlFileName>
      <LongName>0000006 - Statement - CONSOLIDATED STATEMENTS OF COMPREHENSIVE INCOME</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/CONSOLIDATEDSTATEMENTSOFCOMPREHENSIVEINCOME</Role>
      <ShortName>CONSOLIDATED STATEMENTS OF COMPREHENSIVE INCOME</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>6</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R7.htm</HtmlFileName>
      <LongName>0000007 - Statement - CONSOLIDATED STATEMENTS OF SHAREHOLDERS' EQUITY</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/CONSOLIDATEDSTATEMENTSOFSHAREHOLDERSEQUITY</Role>
      <ShortName>CONSOLIDATED STATEMENTS OF SHAREHOLDERS' EQUITY</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>7</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R8.htm</HtmlFileName>
      <LongName>0000008 - Statement - CONSOLIDATED STATEMENTS OF CASH FLOWS</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/CONSOLIDATEDSTATEMENTSOFCASHFLOWS</Role>
      <ShortName>CONSOLIDATED STATEMENTS OF CASH FLOWS</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>8</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R9.htm</HtmlFileName>
      <LongName>0000009 - Disclosure - Nature of Business</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/NatureofBusiness</Role>
      <ShortName>Nature of Business</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>9</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R10.htm</HtmlFileName>
      <LongName>0000010 - Disclosure - Basis of Presentation</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/BasisofPresentation</Role>
      <ShortName>Basis of Presentation</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>10</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R11.htm</HtmlFileName>
      <LongName>0000011 - Disclosure - Significant Accounting Policies</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/SignificantAccountingPolicies</Role>
      <ShortName>Significant Accounting Policies</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>11</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R12.htm</HtmlFileName>
      <LongName>0000012 - Disclosure - Earnings per Share</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/EarningsperShare</Role>
      <ShortName>Earnings per Share</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>12</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R13.htm</HtmlFileName>
      <LongName>0000013 - Disclosure - Investments</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/Investments</Role>
      <ShortName>Investments</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>13</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R14.htm</HtmlFileName>
      <LongName>0000014 - Disclosure - Fair Value Measurements</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/FairValueMeasurements</Role>
      <ShortName>Fair Value Measurements</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>14</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R15.htm</HtmlFileName>
      <LongName>0000015 - Disclosure - Debt</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/Debt</Role>
      <ShortName>Debt</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>15</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R16.htm</HtmlFileName>
      <LongName>0000016 - Disclosure - Loss Reserves</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/LossReserves</Role>
      <ShortName>Loss Reserves</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>16</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R17.htm</HtmlFileName>
      <LongName>0000017 - Disclosure - Reinsurance</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/Reinsurance</Role>
      <ShortName>Reinsurance</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>17</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R18.htm</HtmlFileName>
      <LongName>0000018 - Disclosure - Other Comprehensive Income (Loss)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/OtherComprehensiveIncomeLoss</Role>
      <ShortName>Other Comprehensive Income (Loss)</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>18</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R19.htm</HtmlFileName>
      <LongName>0000019 - Disclosure - Benefit Plans</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/BenefitPlans</Role>
      <ShortName>Benefit Plans</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>19</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R20.htm</HtmlFileName>
      <LongName>0000020 - Disclosure - Income Taxes</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/IncomeTaxes</Role>
      <ShortName>Income Taxes</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>20</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R21.htm</HtmlFileName>
      <LongName>0000021 - Disclosure - Shareholders' Equity</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/ShareholdersEquity</Role>
      <ShortName>Shareholders' Equity</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>21</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R22.htm</HtmlFileName>
      <LongName>0000022 - Disclosure - Statutory Information</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/StatutoryInformation</Role>
      <ShortName>Statutory Information</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>22</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R23.htm</HtmlFileName>
      <LongName>0000023 - Disclosure - Share-based Compensation Plans</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/SharebasedCompensationPlans</Role>
      <ShortName>Share-based Compensation Plans</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>23</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R24.htm</HtmlFileName>
      <LongName>0000024 - Disclosure - Leases</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/Leases</Role>
      <ShortName>Leases</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>24</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R25.htm</HtmlFileName>
      <LongName>0000025 - Disclosure - Litigation and Contingencies</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/LitigationandContingencies</Role>
      <ShortName>Litigation and Contingencies</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>25</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R26.htm</HtmlFileName>
      <LongName>0000026 - Disclosure - SCHEDULE I - SUMMARY OF INVESTMENTS - OTHER THAN INVESTMENTS IN RELATED PARTIES</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/SCHEDULEISUMMARYOFINVESTMENTSOTHERTHANINVESTMENTSINRELATEDPARTIES</Role>
      <ShortName>SCHEDULE I - SUMMARY OF INVESTMENTS - OTHER THAN INVESTMENTS IN RELATED PARTIES</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>26</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R27.htm</HtmlFileName>
      <LongName>0000027 - Disclosure - SCHEDULE II - CONDENSED FINANCIAL INFORMATION OF REGISTRANT</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/SCHEDULEIICONDENSEDFINANCIALINFORMATIONOFREGISTRANT</Role>
      <ShortName>SCHEDULE II - CONDENSED FINANCIAL INFORMATION OF REGISTRANT</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>27</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R28.htm</HtmlFileName>
      <LongName>0000028 - Disclosure - SCHEDULE IV - REINSURANCE</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/SCHEDULEIVREINSURANCE</Role>
      <ShortName>SCHEDULE IV - REINSURANCE</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>28</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R29.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>29</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R30.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>30</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R31.htm</HtmlFileName>
      <LongName>9954471 - Disclosure - Significant Accounting Policies (Policies)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/SignificantAccountingPoliciesPolicies</Role>
      <ShortName>Significant Accounting Policies (Policies)</ShortName>
      <MenuCategory>Policies</MenuCategory>
      <ParentRole>http://www.mgic.com/role/SignificantAccountingPolicies</ParentRole>
      <Position>31</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R32.htm</HtmlFileName>
      <LongName>9954472 - Disclosure - Earnings per Share (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/EarningsperShareTables</Role>
      <ShortName>Earnings per Share (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.mgic.com/role/EarningsperShare</ParentRole>
      <Position>32</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R33.htm</HtmlFileName>
      <LongName>9954473 - Disclosure - Investments (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/InvestmentsTables</Role>
      <ShortName>Investments (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.mgic.com/role/Investments</ParentRole>
      <Position>33</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R34.htm</HtmlFileName>
      <LongName>9954474 - Disclosure - Fair Value Measurements (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/FairValueMeasurementsTables</Role>
      <ShortName>Fair Value Measurements (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.mgic.com/role/FairValueMeasurements</ParentRole>
      <Position>34</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R35.htm</HtmlFileName>
      <LongName>9954475 - Disclosure - Debt (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/DebtTables</Role>
      <ShortName>Debt (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.mgic.com/role/Debt</ParentRole>
      <Position>35</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R36.htm</HtmlFileName>
      <LongName>9954476 - Disclosure - Loss Reserves (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/LossReservesTables</Role>
      <ShortName>Loss Reserves (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.mgic.com/role/LossReserves</ParentRole>
      <Position>36</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R37.htm</HtmlFileName>
      <LongName>9954477 - Disclosure - Reinsurance (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/ReinsuranceTables</Role>
      <ShortName>Reinsurance (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.mgic.com/role/Reinsurance</ParentRole>
      <Position>37</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R38.htm</HtmlFileName>
      <LongName>9954478 - Disclosure - Other Comprehensive Income (Loss) (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/OtherComprehensiveIncomeLossTables</Role>
      <ShortName>Other Comprehensive Income (Loss) (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.mgic.com/role/OtherComprehensiveIncomeLoss</ParentRole>
      <Position>38</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R39.htm</HtmlFileName>
      <LongName>9954479 - Disclosure - Benefit Plans (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/BenefitPlansTables</Role>
      <ShortName>Benefit Plans (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.mgic.com/role/BenefitPlans</ParentRole>
      <Position>39</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R40.htm</HtmlFileName>
      <LongName>9954480 - Disclosure - Income Taxes (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/IncomeTaxesTables</Role>
      <ShortName>Income Taxes (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.mgic.com/role/IncomeTaxes</ParentRole>
      <Position>40</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R41.htm</HtmlFileName>
      <LongName>9954481 - Disclosure - Statutory Information (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/StatutoryInformationTables</Role>
      <ShortName>Statutory Information (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.mgic.com/role/StatutoryInformation</ParentRole>
      <Position>41</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R42.htm</HtmlFileName>
      <LongName>9954482 - Disclosure - Share-based Compensation Plans (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/SharebasedCompensationPlansTables</Role>
      <ShortName>Share-based Compensation Plans (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.mgic.com/role/SharebasedCompensationPlans</ParentRole>
      <Position>42</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R43.htm</HtmlFileName>
      <LongName>9954483 - Disclosure - Leases (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/LeasesTables</Role>
      <ShortName>Leases (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.mgic.com/role/Leases</ParentRole>
      <Position>43</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R44.htm</HtmlFileName>
      <LongName>9954484 - Disclosure - Nature of Business (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/NatureofBusinessDetails</Role>
      <ShortName>Nature of Business (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.mgic.com/role/NatureofBusiness</ParentRole>
      <Position>44</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R45.htm</HtmlFileName>
      <LongName>9954485 - Disclosure - Significant Accounting Policies - Home Office and Equipment (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/SignificantAccountingPoliciesHomeOfficeandEquipmentDetails</Role>
      <ShortName>Significant Accounting Policies - Home Office and Equipment (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>45</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R46.htm</HtmlFileName>
      <LongName>9954486 - Disclosure - Significant Accounting Policies - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/SignificantAccountingPoliciesAdditionalInformationDetails</Role>
      <ShortName>Significant Accounting Policies - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>46</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R47.htm</HtmlFileName>
      <LongName>9954487 - Disclosure - Earnings per Share (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/EarningsperShareDetails</Role>
      <ShortName>Earnings per Share (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.mgic.com/role/EarningsperShareTables</ParentRole>
      <Position>47</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R48.htm</HtmlFileName>
      <LongName>9954488 - Disclosure - Investments (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/InvestmentsDetails</Role>
      <ShortName>Investments (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.mgic.com/role/InvestmentsTables</ParentRole>
      <Position>48</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R49.htm</HtmlFileName>
      <LongName>9954489 - Disclosure - Investments - Amortized Cost and Fair Values of Debt Securities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/InvestmentsAmortizedCostandFairValuesofDebtSecuritiesDetails</Role>
      <ShortName>Investments - Amortized Cost and Fair Values of Debt Securities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>49</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R50.htm</HtmlFileName>
      <LongName>9954490 - Disclosure - Investments - Equity Securities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/InvestmentsEquitySecuritiesDetails</Role>
      <ShortName>Investments - Equity Securities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>50</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R51.htm</HtmlFileName>
      <LongName>9954491 - Disclosure - Investments - Net Gains (Losses) On Investments and Other Financial Instruments (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/InvestmentsNetGainsLossesOnInvestmentsandOtherFinancialInstrumentsDetails</Role>
      <ShortName>Investments - Net Gains (Losses) On Investments and Other Financial Instruments (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>51</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R52.htm</HtmlFileName>
      <LongName>9954492 - Disclosure - Investments - Securities In Unrealized Loss Position (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/InvestmentsSecuritiesInUnrealizedLossPositionDetails</Role>
      <ShortName>Investments - Securities In Unrealized Loss Position (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>52</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R53.htm</HtmlFileName>
      <LongName>9954493 - Disclosure - Investments - Net Unrealized Gains (Losses) of Investments (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/InvestmentsNetUnrealizedGainsLossesofInvestmentsDetails</Role>
      <ShortName>Investments - Net Unrealized Gains (Losses) of Investments (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>53</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R54.htm</HtmlFileName>
      <LongName>9954494 - Disclosure - Investments - Net Investment Income (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/InvestmentsNetInvestmentIncomeDetails</Role>
      <ShortName>Investments - Net Investment Income (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>54</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R55.htm</HtmlFileName>
      <LongName>9954495 - Disclosure - Fair Value Measurements (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/FairValueMeasurementsDetails</Role>
      <ShortName>Fair Value Measurements (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.mgic.com/role/FairValueMeasurementsTables</ParentRole>
      <Position>55</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R56.htm</HtmlFileName>
      <LongName>9954496 - Disclosure - Fair Value Measurements - Assets and Liabilities Not Measured at Fair Value (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/FairValueMeasurementsAssetsandLiabilitiesNotMeasuredatFairValueDetails</Role>
      <ShortName>Fair Value Measurements - Assets and Liabilities Not Measured at Fair Value (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>56</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R57.htm</HtmlFileName>
      <LongName>9954497 - Disclosure - Debt - Summary of Obligations (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/DebtSummaryofObligationsDetails</Role>
      <ShortName>Debt - Summary of Obligations (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>57</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R58.htm</HtmlFileName>
      <LongName>9954498 - Disclosure - Debt (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/DebtDetails</Role>
      <ShortName>Debt (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.mgic.com/role/DebtTables</ParentRole>
      <Position>58</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R59.htm</HtmlFileName>
      <LongName>9954499 - Disclosure - Loss Reserves - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/LossReservesNarrativeDetails</Role>
      <ShortName>Loss Reserves - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>59</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R60.htm</HtmlFileName>
      <LongName>9954500 - Disclosure - Loss Reserves - Reconciliation of Changes in Loss Reserves (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/LossReservesReconciliationofChangesinLossReservesDetails</Role>
      <ShortName>Loss Reserves - Reconciliation of Changes in Loss Reserves (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>60</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R61.htm</HtmlFileName>
      <LongName>9954501 - Disclosure - Loss Reserves - Prior Year Loss Reserves (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/LossReservesPriorYearLossReservesDetails</Role>
      <ShortName>Loss Reserves - Prior Year Loss Reserves (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>61</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R62.htm</HtmlFileName>
      <LongName>9954502 - Disclosure - Loss Reserves - Default Inventory Reconciliation (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/LossReservesDefaultInventoryReconciliationDetails</Role>
      <ShortName>Loss Reserves - Default Inventory Reconciliation (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>62</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R63.htm</HtmlFileName>
      <LongName>9954503 - Disclosure - Loss Reserves - Aging of Primary Default Inventory (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/LossReservesAgingofPrimaryDefaultInventoryDetails</Role>
      <ShortName>Loss Reserves - Aging of Primary Default Inventory (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>63</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R64.htm</HtmlFileName>
      <LongName>9954504 - Disclosure - Reinsurance - Summary of Reinsurance Agreements (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/ReinsuranceSummaryofReinsuranceAgreementsDetails</Role>
      <ShortName>Reinsurance - Summary of Reinsurance Agreements (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>64</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R65.htm</HtmlFileName>
      <LongName>9954505 - Disclosure - Reinsurance - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/ReinsuranceNarrativeDetails</Role>
      <ShortName>Reinsurance - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>65</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R66.htm</HtmlFileName>
      <LongName>9954506 - Disclosure - Reinsurance - Quota Share Agreement Terms (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/ReinsuranceQuotaShareAgreementTermsDetails</Role>
      <ShortName>Reinsurance - Quota Share Agreement Terms (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>66</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R67.htm</HtmlFileName>
      <LongName>9954507 - Disclosure - Reinsurance - Excess of Loss Reinsurance (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/ReinsuranceExcessofLossReinsuranceDetails</Role>
      <ShortName>Reinsurance - Excess of Loss Reinsurance (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>67</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R68.htm</HtmlFileName>
      <LongName>9954508 - Disclosure - Reinsurance - Home Re Entities Total Assets (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/ReinsuranceHomeReEntitiesTotalAssetsDetails</Role>
      <ShortName>Reinsurance - Home Re Entities Total Assets (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>68</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R69.htm</HtmlFileName>
      <LongName>9954509 - Disclosure - Other Comprehensive Income (Loss) - Pretax Components of Other Comprehensive Income (Loss) and Related Income Tax Benefit (Expense) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/OtherComprehensiveIncomeLossPretaxComponentsofOtherComprehensiveIncomeLossandRelatedIncomeTaxBenefitExpenseDetails</Role>
      <ShortName>Other Comprehensive Income (Loss) - Pretax Components of Other Comprehensive Income (Loss) and Related Income Tax Benefit (Expense) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.mgic.com/role/OtherComprehensiveIncomeLossTables</ParentRole>
      <Position>69</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R70.htm</HtmlFileName>
      <LongName>9954510 - Disclosure - Other Comprehensive Income (Loss) - Pretax and Related Income Tax Benefit (Expense) Components (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/OtherComprehensiveIncomeLossPretaxandRelatedIncomeTaxBenefitExpenseComponentsDetails</Role>
      <ShortName>Other Comprehensive Income (Loss) - Pretax and Related Income Tax Benefit (Expense) Components (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.mgic.com/role/OtherComprehensiveIncomeLossTables</ParentRole>
      <Position>70</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R71.htm</HtmlFileName>
      <LongName>9954511 - Disclosure - Other Comprehensive Income (Loss) - Roll-Forward for AOCI (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/OtherComprehensiveIncomeLossRollForwardforAOCIDetails</Role>
      <ShortName>Other Comprehensive Income (Loss) - Roll-Forward for AOCI (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.mgic.com/role/OtherComprehensiveIncomeLossTables</ParentRole>
      <Position>71</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R72.htm</HtmlFileName>
      <LongName>9954512 - Disclosure - Benefit Plans - Components of Net Periodic Benefit Costs (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/BenefitPlansComponentsofNetPeriodicBenefitCostsDetails</Role>
      <ShortName>Benefit Plans - Components of Net Periodic Benefit Costs (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>72</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R73.htm</HtmlFileName>
      <LongName>9954513 - Disclosure - Benefit Plans - Development of Funded Status (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/BenefitPlansDevelopmentofFundedStatusDetails</Role>
      <ShortName>Benefit Plans - Development of Funded Status (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>73</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R74.htm</HtmlFileName>
      <LongName>9954514 - Disclosure - Benefit Plans - Accumulated Other Comprehensive Income (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/BenefitPlansAccumulatedOtherComprehensiveIncomeDetails</Role>
      <ShortName>Benefit Plans - Accumulated Other Comprehensive Income (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>74</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R75.htm</HtmlFileName>
      <LongName>9954515 - Disclosure - Benefit Plans - Change in Project Benefit/Accumulated Benefit Obligations (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/BenefitPlansChangeinProjectBenefitAccumulatedBenefitObligationsDetails</Role>
      <ShortName>Benefit Plans - Change in Project Benefit/Accumulated Benefit Obligations (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>75</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R76.htm</HtmlFileName>
      <LongName>9954516 - Disclosure - Benefit Plans - Change in Plan Assets (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/BenefitPlansChangeinPlanAssetsDetails</Role>
      <ShortName>Benefit Plans - Change in Plan Assets (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>76</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R77.htm</HtmlFileName>
      <LongName>9954517 - Disclosure - Benefit Plans - Change in Accumulated Other Comprehensive Income (AOCI) and Expected Amortization (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/BenefitPlansChangeinAccumulatedOtherComprehensiveIncomeAOCIandExpectedAmortizationDetails</Role>
      <ShortName>Benefit Plans - Change in Accumulated Other Comprehensive Income (AOCI) and Expected Amortization (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>77</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R78.htm</HtmlFileName>
      <LongName>9954518 - Disclosure - Benefit Plans - Actuarial Assumptions and Year-End Asset Allocations (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/BenefitPlansActuarialAssumptionsandYearEndAssetAllocationsDetails</Role>
      <ShortName>Benefit Plans - Actuarial Assumptions and Year-End Asset Allocations (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>78</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R79.htm</HtmlFileName>
      <LongName>9954519 - Disclosure - Benefit Plans - Fair Value of Plan Assets (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/BenefitPlansFairValueofPlanAssetsDetails</Role>
      <ShortName>Benefit Plans - Fair Value of Plan Assets (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>79</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R80.htm</HtmlFileName>
      <LongName>9954520 - Disclosure - Benefit Plans - Additional Disclosures (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/BenefitPlansAdditionalDisclosuresDetails</Role>
      <ShortName>Benefit Plans - Additional Disclosures (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>80</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R81.htm</HtmlFileName>
      <LongName>9954521 - Disclosure - Benefit Plans - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/BenefitPlansNarrativeDetails</Role>
      <ShortName>Benefit Plans - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>81</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R82.htm</HtmlFileName>
      <LongName>9954522 - Disclosure - Income Taxes (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/IncomeTaxesDetails</Role>
      <ShortName>Income Taxes (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.mgic.com/role/IncomeTaxesTables</ParentRole>
      <Position>82</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R83.htm</HtmlFileName>
      <LongName>9954523 - Disclosure - Shareholders' Equity (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/ShareholdersEquityDetails</Role>
      <ShortName>Shareholders' Equity (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.mgic.com/role/ShareholdersEquity</ParentRole>
      <Position>83</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R84.htm</HtmlFileName>
      <LongName>9954524 - Disclosure - Statutory Information - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/StatutoryInformationNarrativeDetails</Role>
      <ShortName>Statutory Information - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>84</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R85.htm</HtmlFileName>
      <LongName>9954525 - Disclosure - Statutory Information - Statutory financial information of insurance subsidiaries (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/StatutoryInformationStatutoryfinancialinformationofinsurancesubsidiariesDetails</Role>
      <ShortName>Statutory Information - Statutory financial information of insurance subsidiaries (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>85</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R86.htm</HtmlFileName>
      <LongName>9954526 - Disclosure - Statutory Information - Surplus contributions and dividends of insurance subsidiaries (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/StatutoryInformationSurpluscontributionsanddividendsofinsurancesubsidiariesDetails</Role>
      <ShortName>Statutory Information - Surplus contributions and dividends of insurance subsidiaries (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>86</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R87.htm</HtmlFileName>
      <LongName>9954527 - Disclosure - Share-based Compensation Plans (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/SharebasedCompensationPlansDetails</Role>
      <ShortName>Share-based Compensation Plans (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.mgic.com/role/SharebasedCompensationPlansTables</ParentRole>
      <Position>87</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R88.htm</HtmlFileName>
      <LongName>9954528 - Disclosure - Share-based Compensation Plans - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/SharebasedCompensationPlansNarrativeDetails</Role>
      <ShortName>Share-based Compensation Plans - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>88</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R89.htm</HtmlFileName>
      <LongName>9954529 - Disclosure - Leases (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/LeasesDetails</Role>
      <ShortName>Leases (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.mgic.com/role/LeasesTables</ParentRole>
      <Position>89</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R90.htm</HtmlFileName>
      <LongName>9954530 - Disclosure - SCHEDULE I - SUMMARY OF INVESTMENTS - OTHER THAN INVESTMENTS IN RELATED PARTIES (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/SCHEDULEISUMMARYOFINVESTMENTSOTHERTHANINVESTMENTSINRELATEDPARTIESDetails</Role>
      <ShortName>SCHEDULE I - SUMMARY OF INVESTMENTS - OTHER THAN INVESTMENTS IN RELATED PARTIES (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.mgic.com/role/SCHEDULEISUMMARYOFINVESTMENTSOTHERTHANINVESTMENTSINRELATEDPARTIES</ParentRole>
      <Position>90</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R91.htm</HtmlFileName>
      <LongName>9954531 - Disclosure - SCHEDULE II - CONDENSED FINANCIAL INFORMATION OF REGISTRANT (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/SCHEDULEIICONDENSEDFINANCIALINFORMATIONOFREGISTRANTDetails</Role>
      <ShortName>SCHEDULE II - CONDENSED FINANCIAL INFORMATION OF REGISTRANT (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.mgic.com/role/SCHEDULEIICONDENSEDFINANCIALINFORMATIONOFREGISTRANT</ParentRole>
      <Position>91</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R92.htm</HtmlFileName>
      <LongName>9954532 - Disclosure - SCHEDULE II - CONDENSED FINANCIAL INFORMATION OF REGISTRANT - SUPPLEMENTARY NOTES (Details)</LongName>
      <ReportType>Notes</ReportType>
      <Role>http://www.mgic.com/role/SCHEDULEIICONDENSEDFINANCIALINFORMATIONOFREGISTRANTSUPPLEMENTARYNOTESDetails</Role>
      <ShortName>SCHEDULE II - CONDENSED FINANCIAL INFORMATION OF REGISTRANT - SUPPLEMENTARY NOTES (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>92</Position>
    </Report>
    <Report instance="mtg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R93.htm</HtmlFileName>
      <LongName>9954533 - Disclosure - SCHEDULE IV - REINSURANCE (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/SCHEDULEIVREINSURANCEDetails</Role>
      <ShortName>SCHEDULE IV - REINSURANCE (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.mgic.com/role/SCHEDULEIVREINSURANCE</ParentRole>
      <Position>93</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-K" isDefinitelyFs="true" isUsgaap="true" original="mtg-20231231.htm">mtg-20231231.htm</File>
    <File>mtg-20231231.xsd</File>
    <File>mtg-20231231_cal.xml</File>
    <File>mtg-20231231_def.xml</File>
    <File>mtg-20231231_lab.xml</File>
    <File>mtg-20231231_pre.xml</File>
  </InputFiles>
  <SupplementalFiles>
    <File>mtg-20231231_g1.jpg</File>
    <File>mtg-20231231_g2.jpg</File>
    <File>mtg-20231231_g3.jpg</File>
  </SupplementalFiles>
  <BaseTaxonomies>
    <BaseTaxonomy items="2">http://fasb.org/srt/2023</BaseTaxonomy>
    <BaseTaxonomy items="1694">http://fasb.org/us-gaap/2023</BaseTaxonomy>
    <BaseTaxonomy items="38">http://xbrl.sec.gov/dei/2023</BaseTaxonomy>
    <BaseTaxonomy items="4">http://xbrl.sec.gov/ecd/2023</BaseTaxonomy>
  </BaseTaxonomies>
  <HasPresentationLinkbase>true</HasPresentationLinkbase>
  <HasCalculationLinkbase>true</HasCalculationLinkbase>
</FilingSummary>
