<?xml version='1.0' encoding='utf-8'?>
<FilingSummary>
  <Version>3.20.4</Version>
  <ProcessingTime/>
  <ReportFormat>html</ReportFormat>
  <ContextCount>416</ContextCount>
  <ElementCount>598</ElementCount>
  <EntityCount>1</EntityCount>
  <FootnotesReported>false</FootnotesReported>
  <SegmentCount>102</SegmentCount>
  <ScenarioCount>0</ScenarioCount>
  <TuplesReported>false</TuplesReported>
  <UnitCount>9</UnitCount>
  <MyReports>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R1.htm</HtmlFileName>
      <LongName>0001001 - 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-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R2.htm</HtmlFileName>
      <LongName>1001002 - 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>2</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R3.htm</HtmlFileName>
      <LongName>1002003 - 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>3</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R4.htm</HtmlFileName>
      <LongName>1003004 - 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>4</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R5.htm</HtmlFileName>
      <LongName>1004005 - 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>5</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R6.htm</HtmlFileName>
      <LongName>1005006 - 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>6</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R7.htm</HtmlFileName>
      <LongName>1006007 - 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>7</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R8.htm</HtmlFileName>
      <LongName>2101101 - 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>8</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R9.htm</HtmlFileName>
      <LongName>2103102 - 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>9</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R10.htm</HtmlFileName>
      <LongName>2104103 - 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>10</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R11.htm</HtmlFileName>
      <LongName>2108104 - 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>11</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R12.htm</HtmlFileName>
      <LongName>2111105 - Disclosure - Investments</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/Investments</Role>
      <ShortName>Investments</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>12</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R13.htm</HtmlFileName>
      <LongName>2116106 - 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>13</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R14.htm</HtmlFileName>
      <LongName>2121107 - Disclosure - Debt</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/Debt</Role>
      <ShortName>Debt</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>14</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R15.htm</HtmlFileName>
      <LongName>2125108 - Disclosure - Loss Reserves</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/LossReserves</Role>
      <ShortName>Loss Reserves</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>15</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R16.htm</HtmlFileName>
      <LongName>2132109 - Disclosure - Reinsurance</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/Reinsurance</Role>
      <ShortName>Reinsurance</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>16</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R17.htm</HtmlFileName>
      <LongName>2140110 - 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>17</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R18.htm</HtmlFileName>
      <LongName>2143111 - Disclosure - Benefit Plans</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/BenefitPlans</Role>
      <ShortName>Benefit Plans</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>18</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R19.htm</HtmlFileName>
      <LongName>2155112 - Disclosure - Income Taxes</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/IncomeTaxes</Role>
      <ShortName>Income Taxes</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>19</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R20.htm</HtmlFileName>
      <LongName>2158113 - Disclosure - Shareholders' Equity</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/ShareholdersEquity</Role>
      <ShortName>Shareholders' Equity</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>20</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R21.htm</HtmlFileName>
      <LongName>2160114 - Disclosure - Statutory Information</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/StatutoryInformation</Role>
      <ShortName>Statutory Information</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>21</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R22.htm</HtmlFileName>
      <LongName>2165115 - 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>22</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R23.htm</HtmlFileName>
      <LongName>2168116 - Disclosure - Leases</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/Leases</Role>
      <ShortName>Leases</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>23</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R24.htm</HtmlFileName>
      <LongName>2171117 - 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>24</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R25.htm</HtmlFileName>
      <LongName>2173118 - Disclosure - Unaudited Quarterly Financial Data</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/UnauditedQuarterlyFinancialData</Role>
      <ShortName>Unaudited Quarterly Financial Data</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>25</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R26.htm</HtmlFileName>
      <LongName>2176119 - 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-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R27.htm</HtmlFileName>
      <LongName>2178120 - 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-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R28.htm</HtmlFileName>
      <LongName>2181121 - 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-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R29.htm</HtmlFileName>
      <LongName>2205201 - 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>29</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R30.htm</HtmlFileName>
      <LongName>2306301 - Disclosure - Significant Accounting Policies (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/SignificantAccountingPoliciesTables</Role>
      <ShortName>Significant Accounting Policies (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.mgic.com/role/SignificantAccountingPolicies</ParentRole>
      <Position>30</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R31.htm</HtmlFileName>
      <LongName>2309302 - 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>31</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R32.htm</HtmlFileName>
      <LongName>2312303 - 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>32</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R33.htm</HtmlFileName>
      <LongName>2317304 - 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>33</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R34.htm</HtmlFileName>
      <LongName>2322305 - 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>34</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R35.htm</HtmlFileName>
      <LongName>2326306 - 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>35</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R36.htm</HtmlFileName>
      <LongName>2333307 - 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>36</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R37.htm</HtmlFileName>
      <LongName>2341308 - 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>37</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R38.htm</HtmlFileName>
      <LongName>2344309 - 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>38</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R39.htm</HtmlFileName>
      <LongName>2356310 - 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>39</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R40.htm</HtmlFileName>
      <LongName>2361311 - 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>40</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R41.htm</HtmlFileName>
      <LongName>2366312 - 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>41</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R42.htm</HtmlFileName>
      <LongName>2369313 - 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>42</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R43.htm</HtmlFileName>
      <LongName>2374314 - Disclosure - Unaudited Quarterly Financial Data (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/UnauditedQuarterlyFinancialDataTables</Role>
      <ShortName>Unaudited Quarterly Financial Data (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.mgic.com/role/UnauditedQuarterlyFinancialData</ParentRole>
      <Position>43</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R44.htm</HtmlFileName>
      <LongName>2402401 - 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-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R45.htm</HtmlFileName>
      <LongName>2407402 - Disclosure - Significant Accounting Policies (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/SignificantAccountingPoliciesDetails</Role>
      <ShortName>Significant Accounting Policies (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.mgic.com/role/SignificantAccountingPoliciesTables</ParentRole>
      <Position>45</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R46.htm</HtmlFileName>
      <LongName>2410403 - 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>46</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R47.htm</HtmlFileName>
      <LongName>2413404 - 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>47</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R48.htm</HtmlFileName>
      <LongName>2414405 - Disclosure - Investments, Investment Income By Category (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/InvestmentsInvestmentIncomeByCategoryDetails</Role>
      <ShortName>Investments, Investment Income By Category (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>48</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R49.htm</HtmlFileName>
      <LongName>2415406 - Disclosure - Investments, Gain (Loss) on Investments (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/InvestmentsGainLossonInvestmentsDetails</Role>
      <ShortName>Investments, Gain (Loss) on Investments (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>49</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R50.htm</HtmlFileName>
      <LongName>2418407 - 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>50</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R51.htm</HtmlFileName>
      <LongName>2419408 - Disclosure - Fair Value Measurements - Unobservable Input Reconciliation (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/FairValueMeasurementsUnobservableInputReconciliationDetails</Role>
      <ShortName>Fair Value Measurements - Unobservable Input Reconciliation (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>51</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R52.htm</HtmlFileName>
      <LongName>2420409 - 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>52</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R53.htm</HtmlFileName>
      <LongName>2423410 - 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>53</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R54.htm</HtmlFileName>
      <LongName>2424411 - 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>54</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R55.htm</HtmlFileName>
      <LongName>2427412 - 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>55</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R56.htm</HtmlFileName>
      <LongName>2428413 - 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>56</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R57.htm</HtmlFileName>
      <LongName>2429414 - 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>57</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R58.htm</HtmlFileName>
      <LongName>2430415 - 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>58</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R59.htm</HtmlFileName>
      <LongName>2431416 - 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>59</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R60.htm</HtmlFileName>
      <LongName>2434417 - 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>60</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R61.htm</HtmlFileName>
      <LongName>2435418 - 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>61</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R62.htm</HtmlFileName>
      <LongName>2436419 - 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>62</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R63.htm</HtmlFileName>
      <LongName>2437420 - Disclosure - Reinsurance - Quota Share Reinsurance (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/ReinsuranceQuotaShareReinsuranceDetails</Role>
      <ShortName>Reinsurance - Quota Share Reinsurance (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>63</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R64.htm</HtmlFileName>
      <LongName>2438421 - 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>64</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R65.htm</HtmlFileName>
      <LongName>2439422 - 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>65</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R66.htm</HtmlFileName>
      <LongName>2442423 - Disclosure - Other Comprehensive Income (Loss) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/OtherComprehensiveIncomeLossDetails</Role>
      <ShortName>Other Comprehensive Income (Loss) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.mgic.com/role/OtherComprehensiveIncomeLossTables</ParentRole>
      <Position>66</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R67.htm</HtmlFileName>
      <LongName>2445424 - 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>67</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R68.htm</HtmlFileName>
      <LongName>2446425 - 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>68</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R69.htm</HtmlFileName>
      <LongName>2447426 - 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>69</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R70.htm</HtmlFileName>
      <LongName>2448427 - 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>70</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R71.htm</HtmlFileName>
      <LongName>2449428 - 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>71</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R72.htm</HtmlFileName>
      <LongName>2450429 - 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>72</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R73.htm</HtmlFileName>
      <LongName>2451430 - 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>73</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R74.htm</HtmlFileName>
      <LongName>2452431 - 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>74</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R75.htm</HtmlFileName>
      <LongName>2453432 - 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>75</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R76.htm</HtmlFileName>
      <LongName>2454433 - 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>76</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R77.htm</HtmlFileName>
      <LongName>2457434 - 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>77</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R78.htm</HtmlFileName>
      <LongName>2459435 - 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>78</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R79.htm</HtmlFileName>
      <LongName>2462436 - 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>79</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R80.htm</HtmlFileName>
      <LongName>2463437 - 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>80</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R81.htm</HtmlFileName>
      <LongName>2464438 - 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>81</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R82.htm</HtmlFileName>
      <LongName>2467439 - 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>82</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R83.htm</HtmlFileName>
      <LongName>2470440 - 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>83</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R84.htm</HtmlFileName>
      <LongName>2472441 - Disclosure - Litigation and Contingencies (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/LitigationandContingenciesDetails</Role>
      <ShortName>Litigation and Contingencies (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.mgic.com/role/LitigationandContingencies</ParentRole>
      <Position>84</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R85.htm</HtmlFileName>
      <LongName>2475442 - Disclosure - Unaudited Quarterly Financial Data (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.mgic.com/role/UnauditedQuarterlyFinancialDataDetails</Role>
      <ShortName>Unaudited Quarterly Financial Data (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.mgic.com/role/UnauditedQuarterlyFinancialDataTables</ParentRole>
      <Position>85</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R86.htm</HtmlFileName>
      <LongName>2477443 - 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>86</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R87.htm</HtmlFileName>
      <LongName>2479444 - 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>87</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R88.htm</HtmlFileName>
      <LongName>2480445 - 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>88</Position>
    </Report>
    <Report instance="mtg-20201231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R89.htm</HtmlFileName>
      <LongName>2482446 - 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>89</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" original="mtg-20201231.htm">mtg-20201231.htm</File>
    <File>mtg-123120xex1012.htm</File>
    <File>mtg-123120xex10224.htm</File>
    <File>mtg-123120xex10241.htm</File>
    <File>mtg-123120xex21.htm</File>
    <File>mtg-123120xex23.htm</File>
    <File>mtg-123120xex311.htm</File>
    <File>mtg-123120xex312.htm</File>
    <File>mtg-123120xex43.htm</File>
    <File>mtg-20201231.xsd</File>
    <File>mtg-20201231_cal.xml</File>
    <File>mtg-20201231_def.xml</File>
    <File>mtg-20201231_lab.xml</File>
    <File>mtg-20201231_pre.xml</File>
    <File>mtg123120-ex32.htm</File>
  </InputFiles>
  <SupplementalFiles>
    <File>mtg-20201231_g1.jpg</File>
    <File>mtg-20201231_g2.jpg</File>
    <File>mtg-20201231_g3.jpg</File>
  </SupplementalFiles>
  <BaseTaxonomies>
    <BaseTaxonomy>http://fasb.org/srt/2019-01-31</BaseTaxonomy>
    <BaseTaxonomy>http://fasb.org/us-gaap/2019-01-31</BaseTaxonomy>
    <BaseTaxonomy>http://xbrl.sec.gov/dei/2020-01-31</BaseTaxonomy>
  </BaseTaxonomies>
  <HasPresentationLinkbase>true</HasPresentationLinkbase>
  <HasCalculationLinkbase>true</HasCalculationLinkbase>
</FilingSummary>
