content: <?xml version="1.0" encoding="UTF-8"?><edgarSubmission xmlns="http://www.sec.gov/edgar/ownership" xmlns:com="http://www.sec.gov/edgar/common">
    <headerData>
      <submissionType>144</submissionType>
      <filerInfo>
        <filer>
          <filerCredentials>
            <cik>0001041958</cik>
            <ccc>XXXXXXXX</ccc>
          </filerCredentials>
        </filer>
        <liveTestFlag>LIVE</liveTestFlag>
  
  
      </filerInfo>
    </headerData>
    <formData>
      <issuerInfo>
        <issuerCik>0000876437</issuerCik>
        <issuerName>MGIC INVESTMENT CORP</issuerName>
        <secFileNumber>001-10816</secFileNumber>
        <issuerAddress>
          <com:street1>250 EAST KILBOURN AVENUE</com:street1>
          <com:city>MILWAUKEE</com:city>
          <com:stateOrCountry>WI</com:stateOrCountry>
          <com:zipCode>53202</com:zipCode>
        </issuerAddress>
        <issuerContactPhone>4143476480</issuerContactPhone>
        <nameOfPersonForWhoseAccountTheSecuritiesAreToBeSold>CULVER CURT S</nameOfPersonForWhoseAccountTheSecuritiesAreToBeSold>
        <relationshipsToIssuer>
          <relationshipToIssuer>Director</relationshipToIssuer>
        </relationshipsToIssuer>
      </issuerInfo>
      <securitiesInformation>
        <securitiesClassTitle>Common stock</securitiesClassTitle>
        <brokerOrMarketmakerDetails>
          <name>Fidelity Brokerage Services LLC</name>
          <address>
            <com:street1>245 Summer Street</com:street1>
            <com:city>Boston   </com:city>
            <com:stateOrCountry>MA</com:stateOrCountry>
            <com:zipCode>02110</com:zipCode>
          </address>
        </brokerOrMarketmakerDetails>
        <noOfUnitsSold>150000</noOfUnitsSold>
        <aggregateMarketValue>3676500.00</aggregateMarketValue>
        <noOfUnitsOutstanding>259233744</noOfUnitsOutstanding>
        <approxSaleDate>08/02/2024</approxSaleDate>
        <securitiesExchangeName>NYSE</securitiesExchangeName>
      </securitiesInformation>
      <securitiesToBeSold>
        <securitiesClassTitle>Common stock	</securitiesClassTitle>
        <acquiredDate>11/20/2018</acquiredDate>
        <natureOfAcquisitionTransaction>Gift</natureOfAcquisitionTransaction>
        <nameOfPersonfromWhomAcquired>Curt &amp; Sue Culver</nameOfPersonfromWhomAcquired>
        <isGiftTransaction>Y</isGiftTransaction>
        <donarAcquiredDate>01/27/2016</donarAcquiredDate>
        <amountOfSecuritiesAcquired>25000</amountOfSecuritiesAcquired>
        <paymentDate>11/20/2018</paymentDate>
        <natureOfPayment>N/A</natureOfPayment>
      </securitiesToBeSold>
      <securitiesToBeSold>
        <securitiesClassTitle>Common stock	</securitiesClassTitle>
        <acquiredDate>11/06/2023</acquiredDate>
        <natureOfAcquisitionTransaction>Gift</natureOfAcquisitionTransaction>
        <nameOfPersonfromWhomAcquired>Curt &amp; Sue Culver	</nameOfPersonfromWhomAcquired>
        <isGiftTransaction>Y</isGiftTransaction>
        <donarAcquiredDate>02/11/2011</donarAcquiredDate>
        <amountOfSecuritiesAcquired>125000</amountOfSecuritiesAcquired>
        <paymentDate>11/06/2023</paymentDate>
        <natureOfPayment>N/A</natureOfPayment>
      </securitiesToBeSold>
      <nothingToReportFlagOnSecuritiesSoldInPast3Months>Y</nothingToReportFlagOnSecuritiesSoldInPast3Months>
      <remarks>Shares are being sold from Curt &amp; Sue Culver Family Foundation</remarks>
      <noticeSignature>
        <noticeDate>08/02/2024</noticeDate>
        <signature>/s/ Myra King, as a duly authorized representative of Fidelity Brokerage Services LLC, as attorney-in-fact for Curt S. Culver</signature>
      </noticeSignature>
    </formData>
  </edgarSubmission>
metadata_documents: [{"type": "144", "sequence": "1", "filename": "primary_doc.xml", "secsgml_size_bytes": 3569}]
text: 144
  0001041958
  XXXXXXXX
  LIVE
  0000876437
  MGIC INVESTMENT CORP
  001-10816
  250 EAST KILBOURN AVENUE
  MILWAUKEE
  WI
  53202
  4143476480
  CULVER CURT S
  Director
  Common stock
  Fidelity Brokerage Services LLC
  245 Summer Street
  Boston
  MA
  02110
  150000
  3676500.00
  259233744
  08/02/2024
  NYSE
  Common stock
  11/20/2018
  Gift
  Curt & Sue Culver
  Y
  01/27/2016
  25000
  11/20/2018
  N/A
  Common stock
  11/06/2023
  Gift
  Curt & Sue Culver
  Y
  02/11/2011
  125000
  11/06/2023
  N/A
  Y
  Shares are being sold from Curt & Sue Culver Family Foundation
  08/02/2024
  /s/ Myra King, as a duly authorized representative of Fidelity Brokerage Services LLC, as attorney-in-fact for Curt S. Culver