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

    <schemaVersion>X0202</schemaVersion>

    <documentType>4</documentType>

    <periodOfReport>2007-06-01</periodOfReport>

    <issuer>
        <issuerCik>0001100813</issuerCik>
        <issuerName>OPSWARE INC</issuerName>
        <issuerTradingSymbol>OPSW</issuerTradingSymbol>
    </issuer>

    <reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0001290049</rptOwnerCik>
            <rptOwnerName>CRANNEY MARK D</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerStreet1>C/O OPSWARE INC.</rptOwnerStreet1>
            <rptOwnerStreet2>599 N MATHILDA AVENUE</rptOwnerStreet2>
            <rptOwnerCity>SUNNYVALE</rptOwnerCity>
            <rptOwnerState>CA</rptOwnerState>
            <rptOwnerZipCode>94085</rptOwnerZipCode>
            <rptOwnerStateDescription></rptOwnerStateDescription>
        </reportingOwnerAddress>
        <reportingOwnerRelationship>
            <isDirector>0</isDirector>
            <isOfficer>1</isOfficer>
            <isTenPercentOwner>0</isTenPercentOwner>
            <isOther>0</isOther>
            <officerTitle>EVP-Worldwide Field Operations</officerTitle>
        </reportingOwnerRelationship>
    </reportingOwner>

    <nonDerivativeTable>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Common Stock</value>
            </securityTitle>
            <transactionDate>
                <value>2007-06-01</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>F</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
                <footnoteId id="F1"/>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>4261</value>
                </transactionShares>
                <transactionPricePerShare>
                    <value>9.04</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>D</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>139825</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value></value>
                </natureOfOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Common Stock</value>
            </securityTitle>
            <transactionDate>
                <value>2007-06-04</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>S</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
                <footnoteId id="F2"/>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>8239</value>
                </transactionShares>
                <transactionPricePerShare>
                    <value>9.04</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>D</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>131586</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value></value>
                </natureOfOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
    </nonDerivativeTable>

    <footnotes>
        <footnote id="F1">Represents shares surrendered directly to Issuer to satisfy Mr. Cranney's minimum statutory tax withholding obligation that arises upon the vesting of stock.  As previously disclosed on a Form 4 filed on December 22, 2005, Mr. Cranney was granted a restricted stock award of 200,000 shares of Issuer's common stock.  6.25% of the shares subject to such award vest following  each fiscal quarter of Issuer.</footnote>
        <footnote id="F2">Sales reported on this Form 4 are pursuant to a 10b5-1 Plan adopted by the reporting person on April 3, 2006.  Shares are sold from The Cranney Living Trust u/a dated October 7, 2005, Mark Cranney and K.C. Cranney, Trustees.</footnote>
    </footnotes>

    <remarks></remarks>

    <ownerSignature>
        <signatureName>/s/ Robert R. Ghoorah, Attorney-in fact</signatureName>
        <signatureDate>2007-06-04</signatureDate>
    </ownerSignature>
</ownershipDocument>
