<?xml version="1.0"?>
<ownershipDocument>
    <schemaVersion>X0201</schemaVersion>

    <documentType>5</documentType><periodOfReport>2003-06-30</periodOfReport>
    <form3HoldingsReported>0</form3HoldingsReported>

    <form4TransactionsReported>0</form4TransactionsReported>

    <issuer>
        <issuerCik>0000092679</issuerCik>
        <issuerName>SPARTON CORP</issuerName>
        <issuerTradingSymbol>SPA</issuerTradingSymbol></issuer><reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0001252321</rptOwnerCik>
            <rptOwnerName>WIDENER SUSAN E</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerStreet1>2400 EAST GANSON STREET</rptOwnerStreet1>
            <rptOwnerStreet2></rptOwnerStreet2>
            <rptOwnerCity>JACKSON</rptOwnerCity>
            <rptOwnerState>MI</rptOwnerState>
            <rptOwnerZipCode>49202</rptOwnerZipCode>
            <rptOwnerStateDescription></rptOwnerStateDescription>
        </reportingOwnerAddress>
            <reportingOwnerRelationship>
<isDirector>0</isDirector><isOfficer>1</isOfficer><isTenPercentOwner>0</isTenPercentOwner><isOther>0</isOther><officerTitle>Asst Treasurer/Asst Secretary</officerTitle></reportingOwnerRelationship></reportingOwner><nonDerivativeTable><nonDerivativeTransaction><securityTitle><value>Common Stock</value></securityTitle><transactionDate><value>2003-06-30</value></transactionDate><transactionCoding><transactionFormType>5</transactionFormType><transactionCode>L</transactionCode><equitySwapInvolved>0</equitySwapInvolved></transactionCoding><transactionAmounts><transactionShares><value>304.23</value></transactionShares><transactionPricePerShare><value>8.20</value></transactionPricePerShare><transactionAcquiredDisposedCode><value>A</value></transactionAcquiredDisposedCode></transactionAmounts><postTransactionAmounts><sharesOwnedFollowingTransaction><value>461.34</value><footnoteId id="F1"/></sharesOwnedFollowingTransaction></postTransactionAmounts><ownershipNature><directOrIndirectOwnership><value>I</value></directOrIndirectOwnership><natureOfOwnership><value>Held by Qualified 401(k) Plan maintained by Issuer</value></natureOfOwnership></ownershipNature></nonDerivativeTransaction></nonDerivativeTable><derivativeTable><derivativeTransaction><securityTitle><value>Employee Stock Option (Right to Purchase)</value></securityTitle><conversionOrExercisePrice><value>8.10</value><footnoteId id="F2"/></conversionOrExercisePrice><transactionDate><value>2002-08-23</value></transactionDate><transactionCoding><transactionFormType>5</transactionFormType><transactionCode>A</transactionCode><equitySwapInvolved>0</equitySwapInvolved></transactionCoding><transactionAmounts><transactionShares><value>5250</value><footnoteId id="F2"/></transactionShares><transactionPricePerShare><footnoteId id="F4"/></transactionPricePerShare><transactionAcquiredDisposedCode><value>A</value></transactionAcquiredDisposedCode></transactionAmounts><exerciseDate><value>2003-08-23</value><footnoteId id="F3"/></exerciseDate><expirationDate><value>2007-08-23</value></expirationDate><underlyingSecurity><underlyingSecurityTitle><value>Common Stock</value></underlyingSecurityTitle><underlyingSecurityShares><value>5250</value><footnoteId id="F2"/></underlyingSecurityShares></underlyingSecurity><postTransactionAmounts><sharesOwnedFollowingTransaction><value>5250</value><footnoteId id="F2"/></sharesOwnedFollowingTransaction></postTransactionAmounts><ownershipNature><directOrIndirectOwnership><value>D</value></directOrIndirectOwnership><natureOfOwnership><value/></natureOfOwnership></ownershipNature></derivativeTransaction></derivativeTable><footnotes><footnote id="F1">Includes an increase in shares held as a result of a 5% stock dividend distributed February 18, 2003</footnote><footnote id="F2">The exercise price and number of shares have been adjusted to reflect the effect of the 5% stock dividend distributed February 18, 2003.</footnote><footnote id="F3">The stock options are exercisable in four equal cumulative annual installments, commencing on 08/23/03.</footnote><footnote id="F4">The stock option was granted pursuant to the Amended and Restated Sparton Corporation Stock Incentive Plan dated October 24, 2001.</footnote></footnotes><remarks/><ownerSignature><signatureName>By Richard L. Langley pursuant to Special Power of Attorney executed by Susan E. Widener</signatureName><signatureDate>2003-08-13</signatureDate></ownerSignature></ownershipDocument>

