Margin call calculator
Buy a share at 40 with 50% initial margin under a 25% maintenance requirement, and your broker calls for more cash if the price falls to twenty-six and two thirds. Know your trigger price before you trade on margin. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Purchase price
- 40
- Initial margin
- 0.5
- Maintenance margin
- 0.25
- Amount borrowed
- 20
- Equity at purchase
- 20
- Margin call price
- 26.6666666667
The margin call price of a stock bought on margin is the share price at which an investor's equity falls to the broker's maintenance-margin requirement, triggering a demand for more cash or securities. Searchers who type margin call calculator, margin call price, or stock bought on margin want that trigger from three inputs: the purchase price, the initial margin as a decimal fraction, and the maintenance margin as a decimal fraction that must sit strictly below one. The identity is purchase price times one minus initial margin, divided by one minus maintenance margin. Traders, brokerage operations teams, and finance students use the figure whenever they ask how far a leveraged long can fall before the account is called. This calculator accepts those three amounts, rejects a maintenance margin that is not below one instead of dividing by zero, and returns the margin call price together with the restated formula.
What a margin call price means and how the formula works
A margin call price answers one brokerage question: how far can a share bought on margin fall before the investor's equity hits the maintenance-margin floor and the broker demands more cash or securities? Searchers who type margin call calculator, margin call price, or stock bought on margin want that trigger price, not a profit margin on revenue, not Graham's margin of safety against intrinsic value, and not a maintenance-margin dollar amount by itself. Purchase price is the fill at which the long was opened, in currency per share.
Initial margin is the fraction of that fill the investor posted as equity — fifty percent Regulation T is sent as 0.50, never as 50. Maintenance margin is the equity-to-market-value floor the broker enforces, also as a decimal, and it must sit strictly below one so the identity can divide by one minus that floor. The loan on the position is purchase price times one minus initial margin.
Equity at a later share price S is S minus that loan. A result of twenty-six and two thirds on a forty-dollar fill with half initial margin and a quarter maintenance margin means the long is called if the share prints at or below that trigger. The calculator does not fetch a live quote, does not model short sales, and does not add debit interest.
Prefer decimal fractions for both margin rates; a percent figure such as twenty-five is not below one and is rejected rather than silently divided by one hundred.
Where a margin call calculator earns its keep
Desk assistants and brokerage operations teams use a margin call calculator when a leveraged long needs a comparable trigger price before the share prints through the maintenance floor. Educators and corporate-finance homework need an oracle that multiplies purchase price by one minus initial margin, divides by one minus maintenance margin, and rejects a maintenance margin that is not below one the way a marking scheme does, instead of letting a spreadsheet leak Infinity into a gradebook.
Risk scripts that already know the fill and the two house rates can pin the rounded trigger in tests without standing up a brokerage library of their own. Failed validation is not billed. Keep purchase price positive, send both margins as decimals below one, pin the rounded trigger in tests, and you get reproducible call prices for spreadsheets, workflow tools, and edge workers.
Use this capability when you already have the purchase fill, the initial margin fraction, and the maintenance margin fraction; if you have only revenue and cost of goods sold, that is a profit-margin identity, and if you have only intrinsic value versus market price, that is a margin of safety, not a broker call. Retail traders and tutoring platforms can run the same identity on a single-stock long once those three amounts are in hand, without mixing cash accounts with margin accounts or folding overnight debit interest into the trigger.
What you can do with it
Brokerage blotter checks
Convert a fill, an initial-margin fraction, and a maintenance-margin fraction into the share price at which a leveraged long is called, before the print goes through the floor.
Classroom and CFA-style homework
Mark margin-call items with a deterministic oracle that uses purchase price times one minus initial margin over one minus maintenance margin, and fails loudly when maintenance margin is not below one.
Risk scripts and stored scenarios
Pin a rounded trigger next to a trade ticket so a later review can recompute the same call price from the three inputs already on the blotter.
FAQ
What happens if maintenance margin is not below one?
Send 0.25 for a 25% house floor, not 1 and not 25.
Should I send 50 or 0.50 for a 50% initial margin?
Send 0.50. Both margin rates are decimal fractions. A percent figure such as 50 is above one and is rejected rather than silently divided by one hundred.
Does this handle short sales or overnight debit interest?
No. The identity is the textbook long-stock call price from purchase price, initial margin, and maintenance margin. Short proceeds and interest on the debit are out of scope.
Does a higher initial margin lower my margin call price?
Yes. The more of the purchase you pay with your own money, the smaller the loan, so the share has to fall further before your equity hits the maintenance floor. A higher maintenance margin works the other way.
How is my equity worked out as the price falls?
The loan stays fixed at the purchase price times one minus the initial margin, 20 on a 40 share at 50%. Your equity is the current price minus that loan, and the broker asks for more money once equity drops to the maintenance share of the price.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/fin/margin-call \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"purchase_price":40,"initial_margin":0.5,"maintenance_margin":0.25}'const res = await fetch("https://api.kit.forhosting.com/fin/margin-call", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"purchase_price": 40,
"initial_margin": 0.5,
"maintenance_margin": 0.25
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/fin/margin-call",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"purchase_price": 40,
"initial_margin": 0.5,
"maintenance_margin": 0.25
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/fin/margin-call", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"purchase_price":40,"initial_margin":0.5,"maintenance_margin":0.25}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"purchase_price":40,"initial_margin":0.5,"maintenance_margin":0.25}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/fin/margin-call", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"purchase_price": 40,
"initial_margin": 0.5,
"maintenance_margin": 0.25
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "fin.margin_call",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
What a margin call price means and how the formula works
Setting equity over S equal to the maintenance margin and solving for S yields the call price: purchase price times one minus initial margin, divided by one minus maintenance margin. Maintenance margin must be strictly below one; this endpoint fails with invalid_input instead of printing Infinity.
Input contract, response shape, rounding, and error behaviour
Missing fields, empty strings, non-finite values, a zero or negative purchase price, and an initial margin of zero or above one fail the same way. Keep both margin rates on the decimal-fraction basis so the price you store next to a trade blotter is the same price a reviewer can recompute from the three inputs you already published. POST a JSON body with three required finite numbers: purchase_price, initial_margin, and maintenance_margin. purchase_price (aliases price, buy_price, stock_price, and purchase) must be a finite number strictly greater than zero because the trigger scales with the fill. initial_margin (aliases im and initial) must be a finite decimal fraction strictly greater than zero and at most one: send 0.50 for a fifty percent Regulation T posting, never 50. maintenance_margin (aliases mm and maintenance) must be a finite decimal fraction greater than or equal to zero and strictly below one, because the identity divides by one minus that floor; a value of one, or a percent such as twenty-five, fails with invalid_input naming the issue, and those failures are not billed. On success the body echoes the three inputs, returns amount_borrowed as purchase price times one minus initial margin, equity_at_purchase as purchase price times initial margin, margin_call_price as the trigger rounded to twelve decimal places, and a formula string restating the identity. Example: purchase_price of forty against initial_margin 0.50 and maintenance_margin 0.25 yields margin_call_price of forty times one half over three quarters, which is twenty-six and two thirds. Example: purchase_price of eighty against the same half initial margin and a 0.20 maintenance floor yields fifty. Pair the trigger with your own notes if the memo needs a cushion or a house haircut; this endpoint computes the textbook call price only and does not invent overnight interest, short-sale proceeds, or a portfolio-level house call.
Technical questions
How is the margin call price calculated from purchase price and the two margins?
Send finite numbers purchase_price (> 0), initial_margin (a decimal in (0, 1]), and maintenance_margin (a decimal in [0, 1)). The API returns margin_call_price = purchase_price × (1 − initial_margin) / (1 − maintenance_margin).
What does the margin call calculator cost?
The browser tool is free. API requests use prepaid balance at $0.002 per successful call; invalid input is not billed.