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

    <schemaVersion>X0609</schemaVersion>

    <documentType>4</documentType>

    <periodOfReport>2026-10-01</periodOfReport>

    <issuer>
        <issuerCik>0000755001</issuerCik>
        <issuerName>UNITIL CORP</issuerName>
        <issuerTradingSymbol>UTL</issuerTradingSymbol>
        <issuerForeignTradingSymbol></issuerForeignTradingSymbol>
    </issuer>

    <reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0001763779</rptOwnerCik>
            <rptOwnerName>Lewis-Raymond Jane</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerNonUSAddressFlag>false</rptOwnerNonUSAddressFlag>
            <rptOwnerStreet1>6 LIBERTY LANE WEST</rptOwnerStreet1>
            <rptOwnerStreet2></rptOwnerStreet2>
            <rptOwnerCity>HAMPTON</rptOwnerCity>
            <rptOwnerState>NH</rptOwnerState>
            <rptOwnerZipCode>03842</rptOwnerZipCode>
            <rptOwnerStateDescription></rptOwnerStateDescription>
        </reportingOwnerAddress>
        <reportingOwnerRelationship>
            <isDirector>true</isDirector>
            <isOfficer>false</isOfficer>
            <isTenPercentOwner>false</isTenPercentOwner>
            <isOther>false</isOther>
        </reportingOwnerRelationship>
    </reportingOwner>

    <aff10b5One>false</aff10b5One>

    <nonDerivativeTable>
        <nonDerivativeHolding>
            <securityTitle>
                <value>Common stock, no par value</value>
            </securityTitle>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>298.97</value>
                    <footnoteId id="F1"/>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </nonDerivativeHolding>
    </nonDerivativeTable>

    <derivativeTable>
        <derivativeTransaction>
            <securityTitle>
                <value>Restricted stock units</value>
            </securityTitle>
            <conversionOrExercisePrice>
                <footnoteId id="F2"/>
            </conversionOrExercisePrice>
            <transactionDate>
                <value>2026-10-01</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>A</transactionCode>
                <equitySwapInvolved>false</equitySwapInvolved>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>2272</value>
                </transactionShares>
                <transactionPricePerShare>
                    <value>0</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>A</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <exerciseDate>
                <footnoteId id="F2"/>
            </exerciseDate>
            <expirationDate>
                <footnoteId id="F2"/>
            </expirationDate>
            <underlyingSecurity>
                <underlyingSecurityTitle>
                    <value>Common stock</value>
                </underlyingSecurityTitle>
                <underlyingSecurityShares>
                    <value>2272</value>
                </underlyingSecurityShares>
            </underlyingSecurity>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>4707</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </derivativeTransaction>
    </derivativeTable>

    <footnotes>
        <footnote id="F1">Includes 2.628 shares of common stock acquired on November 28, 2025, 2.676 shares of common stock acquired on February 27, 2026, 2.711 shares of common stock acquired on May 29, 2026, and 2.629 shares of common stock acquired on August 31, 2026, in each case resulting from the reinvestment of dividends pursuant to Unitil Corporation's Dividend Reinvestment and Stock Purchase Plan.</footnote>
        <footnote id="F2">Each restricted stock unit is equivalent in value to one share of Unitil Corporation's common stock, no par value (&quot;Common Stock&quot;), and represents the right to receive a combination of cash and Common Stock after separation from service on Unitil Corporation's Board of Directors.  Each restricted stock unit is fully vested upon grant and is payable 70% in Common Stock and 30% in cash, based upon the closing price of Common Stock on the day prior to settlement.</footnote>
    </footnotes>

    <ownerSignature>
        <signatureName>/s/ Thomas P. Meissner, Jr., attorney-in-fact for Jane Lewis-Raymond</signatureName>
        <signatureDate>2026-10-02</signatureDate>
    </ownerSignature>
</ownershipDocument>
