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

    <schemaVersion>X0202</schemaVersion>

    <documentType>4</documentType>

    <periodOfReport>2004-11-10</periodOfReport>

    <notSubjectToSection16>0</notSubjectToSection16>

    <issuer>
        <issuerCik>0000709519</issuerCik>
        <issuerName>SUN MICROSYSTEMS INC</issuerName>
        <issuerTradingSymbol>SUNW</issuerTradingSymbol>
    </issuer>

    <reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0001078519</rptOwnerCik>
            <rptOwnerName>OSHMAN M KENNETH</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerStreet1>4150 NETWORK CIRCLE</rptOwnerStreet1>
            <rptOwnerStreet2></rptOwnerStreet2>
            <rptOwnerCity>SANTA CLARA</rptOwnerCity>
            <rptOwnerState>CA</rptOwnerState>
            <rptOwnerZipCode>95054</rptOwnerZipCode>
            <rptOwnerStateDescription></rptOwnerStateDescription>
        </reportingOwnerAddress>
        <reportingOwnerRelationship>
            <isDirector>1</isDirector>
            <isOfficer>0</isOfficer>
            <isTenPercentOwner>0</isTenPercentOwner>
            <isOther>0</isOther>
        </reportingOwnerRelationship>
    </reportingOwner>

    <nonDerivativeTable>
        <nonDerivativeHolding>
            <securityTitle>
                <value>Common Stock</value>
            </securityTitle>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>2232200</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </nonDerivativeHolding>
    </nonDerivativeTable>

    <derivativeTable>
        <derivativeHolding>
            <securityTitle>
                <value>Director Stock Option (Right to Buy)</value>
                <footnoteId id="F1"/>
            </securityTitle>
            <conversionOrExercisePrice>
                <value>50.1563</value>
            </conversionOrExercisePrice>
            <exerciseDate>
                <footnoteId id="F2"/>
            </exerciseDate>
            <expirationDate>
                <value>2005-11-08</value>
            </expirationDate>
            <underlyingSecurity>
                <underlyingSecurityTitle>
                    <value>Common Stock</value>
                </underlyingSecurityTitle>
                <underlyingSecurityShares>
                    <value>20000</value>
                </underlyingSecurityShares>
            </underlyingSecurity>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>20000</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </derivativeHolding>
        <derivativeHolding>
            <securityTitle>
                <value>Director Stock Option (Right to Buy)</value>
                <footnoteId id="F1"/>
            </securityTitle>
            <conversionOrExercisePrice>
                <value>12.59</value>
            </conversionOrExercisePrice>
            <exerciseDate>
                <footnoteId id="F3"/>
            </exerciseDate>
            <expirationDate>
                <value>2006-11-07</value>
            </expirationDate>
            <underlyingSecurity>
                <underlyingSecurityTitle>
                    <value>Common Stock</value>
                </underlyingSecurityTitle>
                <underlyingSecurityShares>
                    <value>10000</value>
                </underlyingSecurityShares>
            </underlyingSecurity>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>10000</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </derivativeHolding>
        <derivativeHolding>
            <securityTitle>
                <value>Director Stock Option (Right to Buy)</value>
                <footnoteId id="F1"/>
            </securityTitle>
            <conversionOrExercisePrice>
                <value>3.40</value>
            </conversionOrExercisePrice>
            <exerciseDate>
                <footnoteId id="F4"/>
            </exerciseDate>
            <expirationDate>
                <value>2007-11-07</value>
            </expirationDate>
            <underlyingSecurity>
                <underlyingSecurityTitle>
                    <value>Common Stock</value>
                </underlyingSecurityTitle>
                <underlyingSecurityShares>
                    <value>10000</value>
                </underlyingSecurityShares>
            </underlyingSecurity>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>10000</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </derivativeHolding>
        <derivativeHolding>
            <securityTitle>
                <value>Director Stock Option (Right to Buy)</value>
                <footnoteId id="F1"/>
            </securityTitle>
            <conversionOrExercisePrice>
                <value>4.2080</value>
            </conversionOrExercisePrice>
            <exerciseDate>
                <footnoteId id="F5"/>
            </exerciseDate>
            <expirationDate>
                <value>2008-11-13</value>
            </expirationDate>
            <underlyingSecurity>
                <underlyingSecurityTitle>
                    <value>Common Stock</value>
                </underlyingSecurityTitle>
                <underlyingSecurityShares>
                    <value>10000</value>
                </underlyingSecurityShares>
            </underlyingSecurity>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>10000</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </derivativeHolding>
        <derivativeTransaction>
            <securityTitle>
                <value>Director Stock Option (Right to Buy)</value>
                <footnoteId id="F1"/>
            </securityTitle>
            <conversionOrExercisePrice>
                <value>4.60</value>
            </conversionOrExercisePrice>
            <transactionDate>
                <value>2004-11-10</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>A</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
            </transactionCoding>
            <transactionTimeliness>
                <value></value>
            </transactionTimeliness>
            <transactionAmounts>
                <transactionShares>
                    <value>10000</value>
                </transactionShares>
                <transactionPricePerShare>
                    <footnoteId id="F7"/>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>A</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <exerciseDate>
                <footnoteId id="F6"/>
            </exerciseDate>
            <expirationDate>
                <value>2009-11-10</value>
            </expirationDate>
            <underlyingSecurity>
                <underlyingSecurityTitle>
                    <value>Common Stock</value>
                </underlyingSecurityTitle>
                <underlyingSecurityShares>
                    <value>10000</value>
                </underlyingSecurityShares>
            </underlyingSecurity>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>10000</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </derivativeTransaction>
    </derivativeTable>

    <footnotes>
        <footnote id="F1">Option granted under Sun Microsystems, Inc. 1988 Director's Stock Option Plan.</footnote>
        <footnote id="F2">Shares vested and became exercisable in four equal annual installments of 5,000 shares beginning November 7, 2001.</footnote>
        <footnote id="F3">A total of 7,500 shares are fully vested and exercisable with the remaining 2,500 shares becoming exercisable with the fourth of four equal annual installments on October 26, 2005.</footnote>
        <footnote id="F4">A total of 5,000 shares are fully vested and exercisable with the remaining 5,000 shares becoming exercisable in two equal annual installments of 2,500 shares on October 26, 2005 and November 2, 2006.</footnote>
        <footnote id="F5">A total of 2,500 shares are fully vested and exercisable with the remaining shares becoming exercisable in three equal annual installments of 2,500 shares on October 26, 2005, November 2, 2006 and the earlier of November 13, 2007 or the date of the 2007 annual shareholders meeting.</footnote>
        <footnote id="F6">Shares vest and become exercisable in four equal annual installments of 2,500 shares as follows: first anniversary- October 26, 2005; second anniversary- November 2, 2006; third anniversary will be the earlier of November 10, 2007 or the date of the 2007 annual shareholders meeting; and fourth anniversary will be the earlier of November 10, 2008 or the date of the 2008 annual shareholders meeting.</footnote>
        <footnote id="F7">The price of the derivative security will be determined at a future date.</footnote>
    </footnotes>

    <ownerSignature>
        <signatureName>/s/ M. Kenneth Oshman</signatureName>
        <signatureDate>2004-11-10</signatureDate>
    </ownerSignature>
</ownershipDocument>

