For U.S. federal income tax on individuals, long-term capital gain and qualified dividend rates are keyed to taxable income, not adjusted gross income (AGI); AGI matters only because it sits upstream in the arithmetic that produces taxable income and because certain thresholds and phaseouts are themselves defined by AGI or modified AGI (MAGI). Short-term capital gains are not taxed at preferential rates at all: they are folded into ordinary income and taxed at the ordinary brackets. The rest of this answer unpacks that distinction, shows the arithmetic, and flags the places where the question's framing can mislead—especially the "bump zone" where a dollar of ordinary income can push a dollar of gain from 0% to 15%, the difference between the 15% and 20% breakpoints, and the Net Investment Income Tax, which is triggered by MAGI rather than by taxable income.
The statutory architecture: ordinary income first, gains stacked on top
The Internal Revenue Code does not apply a single flat rate to long-term capital gains. Section 1(h) creates a set of rate brackets (0%, 15%, and 20% for most individuals) that apply to "adjusted net capital gain"—net long-term capital gain plus qualified dividends, reduced by net short-term capital loss—but only after ordinary income has been taxed. Mechanically, the preferential rates apply to the layer of income that sits above the ordinary-income portion of taxable income.
The practical consequence is that the rate on a long-term gain depends on where the gain lands in the stack of taxable income, and the top of that stack is taxable income, not AGI. Taxable income is AGI minus the standard deduction or itemized deductions (and minus the qualified business income deduction, if claimed). AGI is gross income minus "above-the-line" adjustments such as contributions to a traditional IRA, health savings account contributions, alimony under pre-2019 divorce instruments, and student loan interest. Because the standard deduction and itemized deductions come after AGI, taxable income is almost always lower than AGI—sometimes by a lot.
That gap is exactly why "based on AGI or taxable?" is not a trivial wording quibble. A taxpayer with $120,000 of AGI and a $30,000 standard deduction has $90,000 of taxable income; the 0%/15% capital gain breakpoint is defined by reference to taxable income, so using AGI would overstate the taxpayer's rate exposure.
A worked example that separates the two concepts
Assume a single filer, tax year 2025 (the rules and the general shape are stable; exact bracket dollar amounts are indexed annually, so a later year's figures will differ). Suppose:
Wages and other ordinary income: $60,000 Long-term capital gain: $40,000 Above-the-line adjustments: $0 Standard deduction: $15,000 (approximate; the actual figure is indexed)
AGI = $100,000. Taxable income = $85,000. The ordinary-income slice is $60,000 (the wages), and the long-term gain occupies the $60,000–$100,000 band of taxable income—but taxable income stops at $85,000, so $25,000 of the gain is in taxable income and $0 of it is above the top of the stack.
Now the rate question: for a single filer in 2025 the 0% long-term capital gain bracket runs up to roughly $48,350 of taxable income (the exact indexed figure), and the 15% bracket runs from there to roughly $533,400. Because the gain sits above $60,000 of ordinary taxable income and taxable income tops out at $85,000, the first ~$25,000 of gain that fits inside taxable income is taxed at 15%—none of it falls in the 0% band, because the 0% band is already "used up" by ordinary income up to $48,350.
The point of the example is not the precise dollars. It is that the boundary that decides the rate is a taxable-income boundary. If you substituted AGI ($100,000) for taxable income, you would get the wrong answer in the other direction in many real cases—for instance, a retiree with large above-the-line deductions, or someone with a big itemized deduction year.
Where the confusion comes from: AGI does show up, just not as the rate base
Three distinct places create the impression that "capital gains rates are based on AGI":
1: Threshold definitions in the statute sometimes use AGI or MAGI, but the gain-rate brackets themselves use taxable income. The 3.8% Net Investment Income Tax (NIIT) applies to the lesser of net investment income or the excess of MAGI over $200,000 (single), $250,000 (married filing jointly), $125,000 (married filing separately), or $200,000 (head of household). Those are MAGI thresholds, not taxable-income thresholds, and they are not part of the §1(h) rate schedule. A taxpayer can be entirely inside the 15% capital gain bracket and still owe NIIT because MAGI crosses $200,000.
2: Phaseouts and eligibility rules are frequently AGI-based. Examples include the IRA deduction phaseout, the Roth IRA contribution income limits (MAGI), the child tax credit phaseout (MAGI), the education credits (MAGI), and the phaseout of the exclusion for U.S. savings bond interest used for education (MAGI). These affect the amount of income that reaches taxable income, and some affect how much gain is even recognized—but they are not the rate schedule.
3: Software and worksheets often ask for AGI first. Form 1040 flows from AGI to taxable income to tax, and the Qualified Dividends and Capital Gain Tax Worksheet (and the Schedule D Tax Worksheet) begins with taxable income as its starting figure. Lenders and financial aid formulas use AGI as a shorthand for "income," which reinforces the colloquial association.
There is also a genuine ambiguity worth naming early: "capital gains rate" can mean the statutory preferential rate on long-term gain, or the effective rate actually paid on the gain once NIIT and state tax are included, or the marginal rate on an additional dollar of gain. The statutory preferential rate is based on taxable income. The NIIT layer is based on MAGI. State income tax is based on the state's own definition of income, which varies. If the question is about "what bracket will my gain fall into," taxable income is the right base; if it is about "will I owe the extra 3.8%," MAGI is the right base.
Short-term versus long-term: the holding period changes the whole framework
A capital gain is long-term only if the asset was held for more than one year (the day of acquisition is generally excluded; the day of sale is included). Short-term gains are taxed as ordinary income—they are not "capital gains rates" at all in the preferential sense. So a taxpayer with $50,000 of short-term gains and $50,000 of wages has $100,000 of ordinary income; the preferential schedule never applies. Confusion sometimes arises because a brokerage 1099-B reports both short-term and long-term transactions on the same form, and the taxpayer sees a single "capital gains" line.
Qualified dividends are treated like long-term gains under §1(h)(11), and the same stacking and breakpoint logic applies. Nonqualified dividends are ordinary. Real estate gains on depreciable property can include unrecaptured §1250 gain taxed at up to 25%, which is a separate slice within the §1(h) stack and is easy to overlook in the "0/15/20" shorthand.
The "bump zone": why an extra dollar of ordinary income can cost more than a dollar
Because the preferential rate applies to the gain layer sitting above ordinary taxable income, adding ordinary income can push gain upward into a higher capital-gain bracket—even though the ordinary income itself is taxed at its own marginal rate. This is the "bump zone" or "capital gains bump." Suppose a single filer's taxable income is just below the 0%/15% breakpoint, with a large long-term gain. An additional $1,000 of ordinary income (say, from a year-end bonus) is taxed at the ordinary marginal rate, but it also shifts $1,000 of gain from the 0% band into the 15% band, producing an additional $150 of capital gains tax on top. The combined marginal cost can therefore exceed the nominal ordinary rate.
This is not a quirk of AGI-versus-taxable-income; it is a direct consequence of stacking on taxable income. It is also why tax planning around the 0% bracket requires looking at both ordinary income and gain together, not each in isolation. The "bump zone" is narrow—its width is the amount of gain that would otherwise have been in the lower bracket—but for a taxpayer with a large realized gain it can be substantial.
The 15%/20% boundary and the role of the top bracket
The 20% rate applies to long-term gain and qualified dividends above the top threshold (for 2025, roughly $533,400 for single filers, $600,050 for married filing jointly, and $300,000 for married filing separately; these are indexed). The 15% rate fills the space between the 0% ceiling and the 20% floor. For estates and trusts, the brackets compress dramatically, so a trust can reach the 20% rate at a much lower taxable-income level—another reason a single "AGI" figure cannot describe the rate schedule across entity types.
There is a subtle but important interaction with the ordinary brackets at the top: the top ordinary rate (37%) and the top capital gains rate (20%) are separate schedules applied to separate slices of the same taxable-income stack. A high-income taxpayer's long-term gain does not "use up" the ordinary brackets, and ordinary income does not get taxed at 20%; the two are layered. This is often misreported in popular summaries as "cap gains are taxed at your ordinary rate above a threshold," which is not how §1(h) works.
What is unknown here, and what can still be answered
The question does not specify the jurisdiction (U.S. federal is assumed, since "AGI" is a U.S. federal concept; state rules differ and some states tax capital gains as ordinary income), the tax year (bracket dollar amounts are indexed annually), filing status, or whether the gain is short-term or long-term. Those gaps mean no single dollar answer is possible. What is answerable, and stable across years, is the structural point: the preferential long-term capital gain and qualified dividend rates are applied to taxable income, with AGI entering only through the upstream computation and through separate MAGI-based provisions such as the NIIT and various phaseouts.
A useful way to keep the distinction straight: AGI answers "how much income did I have after adjustments?" Taxable income answers "how much income is left after deductions, and therefore where does my gain sit in the rate schedule?" The rate schedule asks the second question.
Practical implications and common mistakes
Do not project your capital gains rate from AGI. If you have large deductions (standard or itemized), your taxable income—and therefore your gain's bracket—may be materially lower than AGI suggests. Do not ignore MAGI-based surtaxes. The 3.8% NIIT is computed on the lesser of net investment income and MAGI over the threshold; it is not part of the 0/15/20 schedule and can apply even when the gain is in the 15% bracket. Remember the stacking order. Ordinary income first, then qualified dividends and net long-term gain. Short-term gain and nonqualified dividends are ordinary. Check the year's indexed figures. The 0%, 15%, and 20% breakpoints, the standard deduction, and the NIIT thresholds are all fixed in statute at specific dollar amounts that are adjusted for inflation (the NIIT thresholds are not indexed). Using a prior year's numbers produces small but real errors. State treatment is separate. Some states conform to federal preferential rates; others tax all capital gains as ordinary income; a few have their own long-term rates. The federal answer does not travel. Wash sales, carryforwards, and the §121 home-sale exclusion change the amount of gain that reaches the schedule in the first place, so the rate question is downstream of the amount question.
The short version: the rate is set by taxable income; AGI matters because it is an input to taxable income and because separate MAGI-based rules (notably the NIIT and various phaseouts) use it. Keeping those two roles separate prevents most of the errors that arise when taxpayers, software prompts, or shorthand summaries blur them together.