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

    <schemaVersion>X0508</schemaVersion>

    <documentType>4</documentType>

    <periodOfReport>2025-05-08</periodOfReport>

    <notSubjectToSection16>0</notSubjectToSection16>

    <issuer>
        <issuerCik>0001178670</issuerCik>
        <issuerName>ALNYLAM PHARMACEUTICALS, INC.</issuerName>
        <issuerTradingSymbol>ALNY</issuerTradingSymbol>
    </issuer>

    <reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0001661908</rptOwnerCik>
            <rptOwnerName>Sigal Charles Elliott</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerStreet1>675 WEST KENDALL STREET</rptOwnerStreet1>
            <rptOwnerStreet2>HENRI A. TERMEER SQUARE</rptOwnerStreet2>
            <rptOwnerCity>CAMBRIDGE</rptOwnerCity>
            <rptOwnerState>MA</rptOwnerState>
            <rptOwnerZipCode>02142</rptOwnerZipCode>
            <rptOwnerStateDescription></rptOwnerStateDescription>
        </reportingOwnerAddress>
        <reportingOwnerRelationship>
            <isDirector>1</isDirector>
            <isOfficer>0</isOfficer>
            <isTenPercentOwner>0</isTenPercentOwner>
            <isOther>0</isOther>
        </reportingOwnerRelationship>
    </reportingOwner>

    <aff10b5One>0</aff10b5One>

    <nonDerivativeTable>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Common Stock</value>
            </securityTitle>
            <transactionDate>
                <value>2025-05-08</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>A</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>775</value>
                    <footnoteId id="F1"/>
                </transactionShares>
                <transactionPricePerShare>
                    <value>0.0</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>A</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>775</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
        <nonDerivativeHolding>
            <securityTitle>
                <value>Common Stock</value>
            </securityTitle>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>2000</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>I</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value>by Trust</value>
                    <footnoteId id="F2"/>
                </natureOfOwnership>
            </ownershipNature>
        </nonDerivativeHolding>
    </nonDerivativeTable>

    <derivativeTable>
        <derivativeTransaction>
            <securityTitle>
                <value>Stock Option  (right to buy)</value>
            </securityTitle>
            <conversionOrExercisePrice>
                <value>258.35</value>
            </conversionOrExercisePrice>
            <transactionDate>
                <value>2025-05-08</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>A</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>1558</value>
                </transactionShares>
                <transactionPricePerShare>
                    <value>0.0</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>A</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <exerciseDate>
                <value>2026-05-08</value>
                <footnoteId id="F3"/>
            </exerciseDate>
            <expirationDate>
                <value>2035-05-08</value>
            </expirationDate>
            <underlyingSecurity>
                <underlyingSecurityTitle>
                    <value>Common Stock</value>
                </underlyingSecurityTitle>
                <underlyingSecurityShares>
                    <value>1558</value>
                </underlyingSecurityShares>
            </underlyingSecurity>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>1558</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </derivativeTransaction>
    </derivativeTable>

    <footnotes>
        <footnote id="F1">These shares are represented by restricted stock units (RSUs) granted under the Amended and Restated 2018 Stock Incentive Plan. Each RSU represents a contingent right to receive one share of common stock. The RSUs will vest in full upon the earlier of the first anniversary of the grant date and the date of any earlier retirement or resignation of the Reporting Person, provided such date of retirement or resignation occurs no more than 90 days prior to the first anniversary of the grant date.</footnote>
        <footnote id="F2">Shares held by Sigal Family Investments, LLC, of which the reporting person is Managing Member.</footnote>
        <footnote id="F3">The stock option vests in full upon the earlier of the first anniversary of the grant date and the date of any earlier retirement or resignation of the Reporting Person, provided such date of retirement or resignation occurs no more than 90 days prior to the first anniversary of the grant date.</footnote>
    </footnotes>

    <ownerSignature>
        <signatureName>By: Brett Budzinski, Attorney-in-Fact For: Charles Elliott Sigal</signatureName>
        <signatureDate>2025-05-12</signatureDate>
    </ownerSignature>
</ownershipDocument>
