Calculators
Tax-loss-harvesting benefit API
Estimate the tax benefit of harvesting a loss = loss x marginal rate, net of transaction cost, plus the potential carryforward beyond the $3,000/yr ordinary-income offset limit, and whether it's worthwhile. Estimate only; mind wash-sale rules. Answers 'tax benefit of harvesting a $20k loss','should I tax-loss-harvest','how much loss carries forward','tax savings from realizing a loss'.
Price$0.01per request
MethodPOST
Route/v1/calc/tax-loss-harvest
StatusLive
MIME typeapplication/json
Rate limit120/minute
CacheNo cache
taxtax-loss-harvestlosscarryforwardmarginal-rateinvestingportfoliocalc
API URL
Integration docshttps://x402.hexl.dev/v1/calc/tax-loss-harvestExample request
{
"unrealizedLoss": 20000,
"marginalRate": 0.24
}Example response
{
"harvestedLoss": 20000,
"marginalRate": 0.24,
"grossTaxBenefit": 4800,
"transactionCost": 0,
"netTaxBenefit": 4800,
"ordinaryOffsetLimit": 3000,
"potentialCarryforwardIfNoGains": 17000,
"worthwhile": true,
"note": "Estimate. Benefit = loss x marginal rate. Excess losses offset gains fully, then up to $3,000/yr of ordinary income, then carry forward. Mind wash-sale rules."
}Input schema
{
"type": "object",
"required": [
"unrealizedLoss",
"marginalRate"
],
"properties": {
"unrealizedLoss": {
"type": "number",
"description": "Positive magnitude of the loss in USD",
"examples": [
20000
]
},
"marginalRate": {
"type": "number",
"description": "Marginal tax rate as a decimal 0-1",
"examples": [
0.24
]
},
"ordinaryOffsetLimit": {
"type": "number",
"description": "Annual ordinary-income offset cap, default 3000"
},
"transactionCost": {
"type": "number",
"description": "Cost to execute the harvest in USD"
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}