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

    <schemaVersion>X0508</schemaVersion>

    <documentType>4</documentType>

    <periodOfReport>2024-05-15</periodOfReport>

    <issuer>
        <issuerCik>0001604028</issuerCik>
        <issuerName>ADVANCED DRAINAGE SYSTEMS, INC.</issuerName>
        <issuerTradingSymbol>WMS</issuerTradingSymbol>
    </issuer>

    <reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0001756972</rptOwnerCik>
            <rptOwnerName>HARVEY DARIN S.</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerStreet1>C/O ADVANCED DRAINAGE SYSTEMS, INC.</rptOwnerStreet1>
            <rptOwnerStreet2>4640 TRUEMAN BOULEVARD</rptOwnerStreet2>
            <rptOwnerCity>HILLIARD</rptOwnerCity>
            <rptOwnerState>OH</rptOwnerState>
            <rptOwnerZipCode>43026</rptOwnerZipCode>
            <rptOwnerStateDescription></rptOwnerStateDescription>
        </reportingOwnerAddress>
        <reportingOwnerRelationship>
            <isDirector>false</isDirector>
            <isOfficer>true</isOfficer>
            <isTenPercentOwner>false</isTenPercentOwner>
            <isOther>false</isOther>
            <officerTitle>EVP, Supply Chain &amp; Logistics</officerTitle>
        </reportingOwnerRelationship>
    </reportingOwner>

    <aff10b5One>false</aff10b5One>

    <nonDerivativeTable>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Common Stock</value>
            </securityTitle>
            <transactionDate>
                <value>2024-05-15</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>A</transactionCode>
                <equitySwapInvolved>false</equitySwapInvolved>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>4403</value>
                    <footnoteId id="F1"/>
                </transactionShares>
                <transactionPricePerShare>
                    <value>0</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>A</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>8699</value>
                    <footnoteId id="F2"/>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Common Stock</value>
            </securityTitle>
            <transactionDate>
                <value>2024-05-15</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>F</transactionCode>
                <equitySwapInvolved>false</equitySwapInvolved>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>1319</value>
                    <footnoteId id="F3"/>
                </transactionShares>
                <transactionPricePerShare>
                    <value>176.18</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>D</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>7380</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Common Stock</value>
            </securityTitle>
            <transactionDate>
                <value>2024-05-15</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>F</transactionCode>
                <equitySwapInvolved>false</equitySwapInvolved>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>27</value>
                    <footnoteId id="F3"/>
                </transactionShares>
                <transactionPricePerShare>
                    <value>176.18</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>D</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>7353</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
        <nonDerivativeHolding>
            <securityTitle>
                <value>Common Stock</value>
            </securityTitle>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>15233.3258</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>I</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value>By KSOP</value>
                    <footnoteId id="F4"/>
                </natureOfOwnership>
            </ownershipNature>
        </nonDerivativeHolding>
    </nonDerivativeTable>

    <footnotes>
        <footnote id="F1">Reflects grant of performance-based units, originally granted pursuant to the Issuer's 2017 Omnibus Incentive Plan, earned after the Issuer determined that certain performance goals for the performance period ended March 31, 2024 had been met. Total includes dividend equivalents in the amount of 59 shares, which dividend equivalents are settled in common stock.</footnote>
        <footnote id="F2">Includes 125 shares of common stock acquired under the Advanced Drainage Systems, Inc. Employee Stock Purchase Plan, exempt under Rule 16b-3(c).</footnote>
        <footnote id="F3">Represents shares withheld to satisfy Reporting Person's tax obligations in connection with the vesting of shares of restricted common stock of the Issuer.</footnote>
        <footnote id="F4">Represents current allocation under KSOP.</footnote>
    </footnotes>

    <ownerSignature>
        <signatureName>/s/ Darin S. Harvey, by Scott A. Cottrill as attorney-in-fact</signatureName>
        <signatureDate>2024-05-17</signatureDate>
    </ownerSignature>
</ownershipDocument>
