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

    <schemaVersion>X0303</schemaVersion>

    <documentType>4</documentType>

    <periodOfReport>2011-02-07</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>12000</value>
                    <footnoteId id="F1"/>
                </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="F2"/>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>I</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value>By Trust</value>
                </natureOfOwnership>
            </ownershipNature>
        </nonDerivativeHolding>
    </nonDerivativeTable>

    <derivativeTable></derivativeTable>

    <footnotes>
        <footnote id="F1">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="F2">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>Form 4 (2 of 2)</remarks>

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