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

    <schemaVersion>X0306</schemaVersion>

    <documentType>4</documentType>

    <periodOfReport>2015-08-03</periodOfReport>

    <notSubjectToSection16>0</notSubjectToSection16>

    <issuer>
        <issuerCik>0000921547</issuerCik>
        <issuerName>HERITAGE OAKS BANCORP</issuerName>
        <issuerTradingSymbol>HEOP</issuerTradingSymbol>
    </issuer>

    <reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0001356248</rptOwnerCik>
            <rptOwnerName>Gould Howard</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerStreet1>1222 VINE STREET</rptOwnerStreet1>
            <rptOwnerStreet2></rptOwnerStreet2>
            <rptOwnerCity>PASO ROBLES</rptOwnerCity>
            <rptOwnerState>CA</rptOwnerState>
            <rptOwnerZipCode>93446</rptOwnerZipCode>
            <rptOwnerStateDescription></rptOwnerStateDescription>
        </reportingOwnerAddress>
        <reportingOwnerRelationship>
            <isDirector>1</isDirector>
            <isOfficer>0</isOfficer>
            <isTenPercentOwner>0</isTenPercentOwner>
            <isOther>0</isOther>
            <officerTitle></officerTitle>
            <otherText></otherText>
        </reportingOwnerRelationship>
    </reportingOwner>

    <nonDerivativeTable>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Common stock</value>
                <footnoteId id="F1"/>
            </securityTitle>
            <transactionDate>
                <value>2015-08-03</value>
            </transactionDate>
            <deemedExecutionDate></deemedExecutionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>A</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>3113</value>
                </transactionShares>
                <transactionPricePerShare>
                    <value>8.03</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>A</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>3113</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>I</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value>Please see note (1)</value>
                    <footnoteId id="F1"/>
                </natureOfOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
        <nonDerivativeHolding>
            <securityTitle>
                <value>Common stock</value>
                <footnoteId id="F2"/>
                <footnoteId id="F3"/>
            </securityTitle>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>5876607</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </nonDerivativeHolding>
    </nonDerivativeTable>

    <derivativeTable></derivativeTable>

    <footnotes>
        <footnote id="F1">Restricted shares granted pursuant to the Company's 2015 Equity Incentive Plan.  The shares vest 100% one year from the grant date.  The shares are subject to forfeiture.</footnote>
        <footnote id="F2">Reporting person by virtue of being a managing member of Carpenter Fund Manager GL, LLP (&quot;Manager&quot;), the general partner of each of Carpenter Community BancFund-A, LP (&quot;Fund A&quot;), Carpenter Community BancFund, LP (&quot;Fund LP&quot;), and Carpenter Community BancFund-CA LP (&quot;Fund CA&quot;, the &quot;Funds&quot;), may be deemed to beneficially own shares held by the Funds, but disclaims beneficial ownership thereof.</footnote>
        <footnote id="F3">Fund LP is the record holder of 193,066 shares, Fund A is the record holder of 5,491,752 shares, and Fund CA is the record holder of 188,198 shares.</footnote>
    </footnotes>

    <remarks></remarks>

    <ownerSignature>
        <signatureName>Ryan Alvord attorney-in-fact for Howard N. Gould</signatureName>
        <signatureDate>2015-08-05</signatureDate>
    </ownerSignature>
</ownershipDocument>
