<?xml version="1.0"?>
<ownershipDocument>

    <schemaVersion>X0303</schemaVersion>

    <documentType>4/A</documentType>

    <periodOfReport>2008-09-30</periodOfReport>

    <dateOfOriginalSubmission>2008-10-01</dateOfOriginalSubmission>

    <issuer>
        <issuerCik>0000876437</issuerCik>
        <issuerName>MGIC INVESTMENT CORP</issuerName>
        <issuerTradingSymbol>MTG</issuerTradingSymbol>
    </issuer>

    <reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0001086328</rptOwnerCik>
            <rptOwnerName>KEARNEY DANIEL P</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerStreet1>13 FLINT STREET</rptOwnerStreet1>
            <rptOwnerStreet2></rptOwnerStreet2>
            <rptOwnerCity>MARBLEHEAD</rptOwnerCity>
            <rptOwnerState>MA</rptOwnerState>
            <rptOwnerZipCode>01945</rptOwnerZipCode>
            <rptOwnerStateDescription></rptOwnerStateDescription>
        </reportingOwnerAddress>
        <reportingOwnerRelationship>
            <isDirector>1</isDirector>
            <isOfficer>0</isOfficer>
            <isTenPercentOwner>0</isTenPercentOwner>
            <isOther>0</isOther>
        </reportingOwnerRelationship>
    </reportingOwner>

    <derivativeTable>
        <derivativeTransaction>
            <securityTitle>
                <value>Share Units</value>
                <footnoteId id="F1"/>
                <footnoteId id="F2"/>
            </securityTitle>
            <conversionOrExercisePrice>
                <footnoteId id="F3"/>
            </conversionOrExercisePrice>
            <transactionDate>
                <value>2008-09-30</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>P</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>4160.7397</value>
                    <footnoteId id="F4"/>
                </transactionShares>
                <transactionPricePerShare>
                    <value>7.03</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>A</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <exerciseDate>
                <footnoteId id="F5"/>
            </exerciseDate>
            <expirationDate>
                <footnoteId id="F5"/>
            </expirationDate>
            <underlyingSecurity>
                <underlyingSecurityTitle>
                    <value>Common Stock</value>
                </underlyingSecurityTitle>
                <underlyingSecurityShares>
                    <value>4160.7397</value>
                </underlyingSecurityShares>
            </underlyingSecurity>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>23523.3655</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value></value>
                </natureOfOwnership>
            </ownershipNature>
        </derivativeTransaction>
    </derivativeTable>

    <footnotes>
        <footnote id="F1">This amended Form 4 is being filed to correct the number of Share Units acquired by the reporting person through compensation deferral and to correct the resulting number of Share Units beneficially owned by the reporting person following such acquisition.  Pursuant to Instruction 9(b) to Form 4, only the lines of the original Form 4 requiring correction or amendment are being restated on this amended Form 4.</footnote>
        <footnote id="F2">The reporting person participates in the MGIC Investment Corporation Deferred Compensation Plan for Non-Employee Directors under which units corresponding to shares of Common Stock of the Issuer (&quot;Share Units&quot;) are acquired through compensation deferral.  Dividends which would have been received on shares represented by Share Units are also invested in Share Units. The Share Units are settled in cash, generally at the time the reporting person ceases to be a Director of the Issuer.</footnote>
        <footnote id="F3">These Share Units do not have a specified dollar-denominated exercise or conversion price.  (Their value is based, on a one-for-one basis, on the price of the Issuer's common stock on the New York Stock Exchange.)</footnote>
        <footnote id="F4">These Share Units were acquired through compensation deferral.</footnote>
        <footnote id="F5">These Share Units do not become exercisable or expire on a fixed date.  (Generally, the Share Units become payable at the time the reporting person ceases to be a Director of the Issuer.)</footnote>
    </footnotes>

    <remarks>This Form 4 is being signed by the reporting person's attorney-in-fact pursuant to a previously filed power of attorney.</remarks>

    <ownerSignature>
        <signatureName>Dan D. Stilwell, Attorney-in-fact</signatureName>
        <signatureDate>2008-10-08</signatureDate>
    </ownerSignature>
</ownershipDocument>
