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

    <schemaVersion>X0303</schemaVersion>

    <documentType>4/A</documentType>

    <periodOfReport>2009-01-29</periodOfReport>

    <dateOfOriginalSubmission>2009-02-02</dateOfOriginalSubmission>

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

    <reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0001178921</rptOwnerCik>
            <rptOwnerName>KOMANECKI JOSEPH J</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerStreet1>MGIC PLAZA</rptOwnerStreet1>
            <rptOwnerStreet2>250EAST KILBOURN AVENUE</rptOwnerStreet2>
            <rptOwnerCity>MILWAUKEE</rptOwnerCity>
            <rptOwnerState>WI</rptOwnerState>
            <rptOwnerZipCode>53202</rptOwnerZipCode>
            <rptOwnerStateDescription></rptOwnerStateDescription>
        </reportingOwnerAddress>
        <reportingOwnerRelationship>
            <isDirector>0</isDirector>
            <isOfficer>1</isOfficer>
            <isTenPercentOwner>0</isTenPercentOwner>
            <isOther>0</isOther>
            <officerTitle>SVP, Controller &amp; CAO</officerTitle>
        </reportingOwnerRelationship>
    </reportingOwner>

    <nonDerivativeTable>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Common Stock</value>
            </securityTitle>
            <transactionDate>
                <value>2009-01-29</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>A</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>23850</value>
                    <footnoteId id="F2"/>
                </transactionShares>
                <transactionPricePerShare>
                    <value>0</value>
                    <footnoteId id="F3"/>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>A</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>93304</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value></value>
                </natureOfOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Common Stock</value>
                <footnoteId id="F1"/>
            </securityTitle>
            <transactionDate>
                <value>2009-01-29</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>A</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>17900</value>
                </transactionShares>
                <transactionPricePerShare>
                    <value>0</value>
                    <footnoteId id="F3"/>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>A</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>111204</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value></value>
                </natureOfOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
    </nonDerivativeTable>

    <footnotes>
        <footnote id="F1">This amended Form 4 is being filed to correct vesting information contained in the footnote to this transaction.  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">These shares are subject to certain restrictions, and vest when such restrictions lapse.  Partial vesting of these shares occurs on February 10 of each of the three years beginning in 2010, based on certain performance standards.  If it is not possible to determine whether the performance standards have been met on any particular vesting date, the vesting date will be extended until such determination can be made.  Any of these shares not vested as of February 10, 2012 will be forfeited.</footnote>
        <footnote id="F3">These shares were awarded to the reporting person pursuant to the Issuer's 2002 Stock Incentive Plan and no price was paid by the reporting person for the shares.</footnote>
    </footnotes>

    <remarks></remarks>

    <ownerSignature>
        <signatureName>Dan D. Stilwell</signatureName>
        <signatureDate>2009-02-02</signatureDate>
    </ownerSignature>
</ownershipDocument>
