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

    <schemaVersion>X0303</schemaVersion>

    <documentType>4</documentType>

    <periodOfReport>2011-02-03</periodOfReport>

    <notSubjectToSection16>0</notSubjectToSection16>

    <issuer>
        <issuerCik>0000717954</issuerCik>
        <issuerName>UNIFIRST CORP</issuerName>
        <issuerTradingSymbol>UNF</issuerTradingSymbol>
    </issuer>

    <reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0001261139</rptOwnerCik>
            <rptOwnerName>CROATTI RONALD D</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerStreet1>C/O UNIFIRST CORPORATION</rptOwnerStreet1>
            <rptOwnerStreet2>68 JONSPIN ROAD</rptOwnerStreet2>
            <rptOwnerCity>WILMINGTON</rptOwnerCity>
            <rptOwnerState>MA</rptOwnerState>
            <rptOwnerZipCode>01887</rptOwnerZipCode>
            <rptOwnerStateDescription></rptOwnerStateDescription>
        </reportingOwnerAddress>
        <reportingOwnerRelationship>
            <isDirector>1</isDirector>
            <isOfficer>1</isOfficer>
            <isTenPercentOwner>1</isTenPercentOwner>
            <isOther>0</isOther>
            <officerTitle>President and CEO</officerTitle>
            <otherText></otherText>
        </reportingOwnerRelationship>
    </reportingOwner>

    <reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0001260756</rptOwnerCik>
            <rptOwnerName>CROATTI CYNTHIA</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerStreet1>C/O UNIFIRST CORPORATION</rptOwnerStreet1>
            <rptOwnerStreet2>68 JONSPIN ROAD</rptOwnerStreet2>
            <rptOwnerCity>WILMINGTON</rptOwnerCity>
            <rptOwnerState>MA</rptOwnerState>
            <rptOwnerZipCode>01887</rptOwnerZipCode>
            <rptOwnerStateDescription></rptOwnerStateDescription>
        </reportingOwnerAddress>
        <reportingOwnerRelationship>
            <isDirector>1</isDirector>
            <isOfficer>1</isOfficer>
            <isTenPercentOwner>1</isTenPercentOwner>
            <isOther>0</isOther>
            <officerTitle>Executive VP and Treasurer</officerTitle>
            <otherText></otherText>
        </reportingOwnerRelationship>
    </reportingOwner>

    <nonDerivativeTable>
        <nonDerivativeHolding>
            <securityTitle>
                <value>Common Stock</value>
            </securityTitle>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>950</value>
                    <footnoteId id="F1"/>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>I</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value>By LLC</value>
                </natureOfOwnership>
            </ownershipNature>
        </nonDerivativeHolding>
        <nonDerivativeHolding>
            <securityTitle>
                <value>Common Stock</value>
            </securityTitle>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>68534</value>
                    <footnoteId id="F2"/>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>I</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value>By LLC</value>
                </natureOfOwnership>
            </ownershipNature>
        </nonDerivativeHolding>
        <nonDerivativeHolding>
            <securityTitle>
                <value>Class B Common Stock</value>
            </securityTitle>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>48000</value>
                    <footnoteId id="F3"/>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>I</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value>By Trust</value>
                </natureOfOwnership>
            </ownershipNature>
        </nonDerivativeHolding>
        <nonDerivativeHolding>
            <securityTitle>
                <value>Common Stock</value>
            </securityTitle>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>12000</value>
                    <footnoteId id="F4"/>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>I</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value>By Trust</value>
                </natureOfOwnership>
            </ownershipNature>
        </nonDerivativeHolding>
        <nonDerivativeHolding>
            <securityTitle>
                <value>Class B Common Stock</value>
            </securityTitle>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>9574</value>
                    <footnoteId id="F5"/>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>I</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value>By Trust</value>
                </natureOfOwnership>
            </ownershipNature>
        </nonDerivativeHolding>
    </nonDerivativeTable>

    <derivativeTable></derivativeTable>

    <footnotes>
        <footnote id="F1">Represents shares owned indirectly by Ronald D. Croatti as the manager of a limited liability company, MMC Trust LLC. Ronald D. Croatti disclaims beneficial ownership of these reported securities, except to the extent of his pecuniary interest therein, and this report shall not be deemed an admission that he is the beneficial owner of these securities for purposes of Section 16 or any other purpose.</footnote>
        <footnote id="F2">Cynthia Croatti is the manager of Trilogy Investment Partners LLC, which as of the date of filing this report, directly owns the reported securities. Cynthia Croatti disclaims beneficial ownership of these reported securities, except to the extent of her pecuniary interest therein, and this report shall not be deemed an admission that she is the beneficial owner of the securities for purposes of Section 16 or any other purpose.</footnote>
        <footnote id="F3">Cynthia Croatti is a trustee of The Samuel E. Brown Gallo Trust - 1989 and The Nicholas C. Brown Gallo Trust - 1989, which as of the date of filing this report, each directly owns a portion of these reported securities. Cynthia Croatti disclaims beneficial ownership of these reported securities, except to the extent of her pecuniary interest therein, and this report shall not be deemed an admission that she is the beneficial owner of the securities for purposes of Section 16 or any other purpose.</footnote>
        <footnote id="F4">Cynthia Croatti is a trustee of The Monica Levenstein Gallo Trust - 1989, which as of the date of filing this report, directly owns the reported securities. Cynthia Croatti disclaims beneficial ownership of these reported securities, except to the extent of her pecuniary interest therein, and this report shall not be deemed an admission that she is the beneficial owner of the securities for purposes of Section 16 or any other purpose.</footnote>
        <footnote id="F5">Cynthia Croatti is a trustee of The Ronald D. Croatti Non-GST Trust - 2006, which as of the date of filing this report, directly owns the reported securities. Cynthia Croatti disclaims beneficial ownership of these reported securities, except to the extent of her pecuniary interest therein, and this report shall not be deemed an admission that she is the beneficial owner of these securities for purposes of Section 16 or any other purpose.</footnote>
    </footnotes>

    <remarks></remarks>

    <ownerSignature>
        <signatureName>/s/ David Whitman, Attorney-in-Fact</signatureName>
        <signatureDate>2011-02-07</signatureDate>
    </ownerSignature>
</ownershipDocument>
