For example, can you cancel out the entire $10,000 capital gain for 2024 and avoid paying taxes on it if you have a $20,000 capital loss for 2023 that you can carry forward and a $10,000 capital gain for 2024? Is there a cap on the amount of capital loss that can be applied against capital gains in a given year?
In a given tax year, you can use up to $3,000 of capital loss carryover to offset capital gains or as a deduction against ordinary income.
If your net capital losses exceed this threshold, you can indefinitely carry the remaining losses to future tax years until they are exhausted. So, there is no limit to the number of years you might have a capital loss carryover.
It is also important to report capital losses on Schedule D when filing your taxes
No upper bound. You might use $13k in your example. $3k to offset regular income and $10k to offset the gain. After that, you would have $7k left aside for 2023.
Edit: Just to be clear, you may utilize it in more ways than one. Assuming you have at least $3k in income to offset, you have to. Carryovers are not saved for a later time. If you can, you must utilize them.