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>MGIC Plaza 250 East Kilbourn Ave</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>Officer</relationshipToIssuer>
        </relationshipsToIssuer>
      </issuerInfo>
      <securitiesInformation>
        <securitiesClassTitle>common</securitiesClassTitle>
        <brokerOrMarketmakerDetails>
          <name>Fidelity brokerage Services LLc</name>
          <address>
            <com:street1>245 Summer St</com:street1>
            <com:city>Boston</com:city>
            <com:stateOrCountry>MA</com:stateOrCountry>
            <com:zipCode>02110</com:zipCode>
          </address>
        </brokerOrMarketmakerDetails>
        <noOfUnitsSold>200000</noOfUnitsSold>
        <aggregateMarketValue>3014000.00</aggregateMarketValue>
        <noOfUnitsOutstanding>286617757</noOfUnitsOutstanding>
        <approxSaleDate>05/24/2023</approxSaleDate>
        <securitiesExchangeName>NYSE</securitiesExchangeName>
      </securitiesInformation>
      <securitiesToBeSold>
        <securitiesClassTitle>common</securitiesClassTitle>
        <acquiredDate>04/21/2011</acquiredDate>
        <natureOfAcquisitionTransaction>Gift</natureOfAcquisitionTransaction>
        <nameOfPersonfromWhomAcquired>Curt &amp; Sue Culver</nameOfPersonfromWhomAcquired>
        <isGiftTransaction>Y</isGiftTransaction>
        <donarAcquiredDate>04/21/2011</donarAcquiredDate>
        <amountOfSecuritiesAcquired>40000</amountOfSecuritiesAcquired>
        <paymentDate>04/21/2011</paymentDate>
        <natureOfPayment>Gift</natureOfPayment>
      </securitiesToBeSold>
      <securitiesToBeSold>
        <securitiesClassTitle>common</securitiesClassTitle>
        <acquiredDate>02/10/2015</acquiredDate>
        <natureOfAcquisitionTransaction>Gift</natureOfAcquisitionTransaction>
        <nameOfPersonfromWhomAcquired>Curt &amp; Sue Culver</nameOfPersonfromWhomAcquired>
        <isGiftTransaction>Y</isGiftTransaction>
        <donarAcquiredDate>02/10/2015</donarAcquiredDate>
        <amountOfSecuritiesAcquired>34101</amountOfSecuritiesAcquired>
        <paymentDate>02/10/2015</paymentDate>
        <natureOfPayment>Gift</natureOfPayment>
      </securitiesToBeSold>
      <securitiesToBeSold>
        <securitiesClassTitle>common</securitiesClassTitle>
        <acquiredDate>02/25/2015</acquiredDate>
        <natureOfAcquisitionTransaction>Gift</natureOfAcquisitionTransaction>
        <nameOfPersonfromWhomAcquired>Curt &amp; Sue Culver</nameOfPersonfromWhomAcquired>
        <isGiftTransaction>Y</isGiftTransaction>
        <donarAcquiredDate>02/25/2015</donarAcquiredDate>
        <amountOfSecuritiesAcquired>102021</amountOfSecuritiesAcquired>
        <paymentDate>02/25/2015</paymentDate>
        <natureOfPayment>Gift</natureOfPayment>
      </securitiesToBeSold>
      <securitiesToBeSold>
        <securitiesClassTitle>common</securitiesClassTitle>
        <acquiredDate>03/14/2016</acquiredDate>
        <natureOfAcquisitionTransaction>Gift</natureOfAcquisitionTransaction>
        <nameOfPersonfromWhomAcquired>Curt &amp; Sue Culver</nameOfPersonfromWhomAcquired>
        <isGiftTransaction>Y</isGiftTransaction>
        <donarAcquiredDate>03/14/2016</donarAcquiredDate>
        <amountOfSecuritiesAcquired>23878</amountOfSecuritiesAcquired>
        <paymentDate>03/14/2016</paymentDate>
        <natureOfPayment>Gift</natureOfPayment>
      </securitiesToBeSold>
      <nothingToReportFlagOnSecuritiesSoldInPast3Months>Y</nothingToReportFlagOnSecuritiesSoldInPast3Months>
      <noticeSignature>
        <noticeDate>05/24/2023</noticeDate>
        <signature>Jason Coleman as a duly authorized representative of National Financial Services LLC, as attorney-in-fact for Curt &amp; Sue Culver Family Foundation</signature>
      </noticeSignature>
    </formData>
  </edgarSubmission>
metadata_documents: [{"type": "144", "sequence": "1", "filename": "primary_doc.xml", "secsgml_size_bytes": 4649}]
text: 144
  0001041958
  XXXXXXXX
  LIVE
  0000876437
  MGIC Investment corp
  001-10816
  MGIC Plaza 250 East Kilbourn Ave
  Milwaukee
  WI
  53202
  4143476480
  CULVER CURT S
  Officer
  common
  Fidelity brokerage Services LLc
  245 Summer St
  Boston
  MA
  02110
  200000
  3014000.00
  286617757
  05/24/2023
  NYSE
  common
  04/21/2011
  Gift
  Curt & Sue Culver
  Y
  04/21/2011
  40000
  04/21/2011
  Gift
  common
  02/10/2015
  Gift
  Curt & Sue Culver
  Y
  02/10/2015
  34101
  02/10/2015
  Gift
  common
  02/25/2015
  Gift
  Curt & Sue Culver
  Y
  02/25/2015
  102021
  02/25/2015
  Gift
  common
  03/14/2016
  Gift
  Curt & Sue Culver
  Y
  03/14/2016
  23878
  03/14/2016
  Gift
  Y
  05/24/2023
  Jason Coleman as a duly authorized representative of National Financial Services LLC, as attorney-in-fact for Curt & Sue Culver Family Foundation