Days inventory outstanding calculator
See how long inventory waits before it is sold: 50000 of average inventory against 365000 of annual cost of goods sold is 50 days inventory outstanding. Works for a year, a quarter or any period you choose. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Average inventory
- 50,000
- Cost of goods sold
- 365,000
- Days
- 365
- Average daily cogs
- 1,000
- Days inventory outstanding
- 50
- Inventory turnover
- 7.3
Days inventory outstanding — also called days sales of inventory, inventory days, or the inventory holding period — answers a working-capital question every merchandising or manufacturing business eventually has to ask: how many days, on average, does it take this company to turn stock into cost of goods sold? The figure is not a guess from a warehouse snapshot. It is a closed-form ratio: average inventory divided by cost of goods sold for the same window, then scaled by the number of days in that window. This days inventory outstanding calculator accepts those two ledger totals, optionally a period length that defaults to a 365-day year, and returns DIO together with average daily cost of goods sold.
How days inventory outstanding and days sales of inventory are computed
The days inventory outstanding ratio and days sales of inventory are the same working-capital identity written under two classroom names. Start with average inventory on the balance sheet — typically the mean of opening and closing stock, or the ending balance if that is the convention your close already uses. Pair it with cost of goods sold from the income statement for a matching window: a calendar year, a quarter, or a custom period you choose.
Divide average inventory by cost of goods sold to obtain the fraction of the period's cost book that is still sitting in the warehouse. Multiply that fraction by the number of days in the window. The product is DIO, the average number of days a dollar of inventory remains on hand before it is recognized as cost of goods sold.
A 360-day banker's year or a 90-day quarter is just a different days value — the formula does not change. Inventory turnover, reported when average inventory is positive, is cost of goods sold divided by average inventory, and DIO is then days divided by that turnover. Zero inventory with positive cost of goods sold is a legitimate books-clean case: DIO is zero because nothing is waiting to be sold.
Negative inventory is rejected. Cost of goods sold of zero is rejected because it would divide by zero and leave DIO undefined. Negative cost of goods sold is rejected for the same reason.
The arithmetic is a handful of finite operations; there is no SKU aging, no FIFO layer, and no forecast of what will leave the warehouse next week.
Where a days inventory outstanding calculator earns its keep
Controllers and treasurers use a days inventory outstanding calculator at close to turn two trial-balance lines into a single operating metric they can put next to stated production or purchasing cycle times and see whether the book is actually turning stock on that promise. Operations and supply-chain managers compare this year's DIO with last year's and with a peer median before they change safety stock, order quantities, or markdown cadence.
Lenders and underwriters drop the same two totals into a covenant worksheet so a rising inventory period is visible before it becomes a cash-conversion surprise. Failed validation does not consume balance.
What you can do with it
Month-end and year-end close
Turn average inventory and period cost of goods sold into days inventory outstanding next to cycle-time targets before the close pack is locked.
Supply-chain and markdown reviews
Compare this window's inventory days with last year or a peer set before changing safety stock, order quantities, or markdown cadence.
Covenant and underwriting worksheets
Drop the same two ledger totals into a lender or board worksheet so a lengthening inventory period is visible before cash conversion slips.
FAQ
What happens if cost of goods sold is zero?
Cost of goods sold must be a finite number greater than zero; a zero figure makes days inventory outstanding undefined and is not billed.
Should I use ending inventory or average inventory?
Either convention is valid if you stay consistent. The formula does not average two balances for you.
Can I compute quarterly or 360-day DIO?
Yes. Set days to 90 for a quarter, 360 for a banker's year, or any other positive period length. Omit days to use the textbook 365-day year.
How do I calculate days inventory outstanding?
Divide average inventory by cost of goods sold for the same period, then multiply by the days in that period. With 50000 of inventory and 365000 of annual cost of goods sold, DIO is 50 days.
How does inventory turnover relate to DIO?
Turnover is cost of goods sold divided by average inventory, 7.3 in the example of 50000 against 365000. DIO is the number of days in the period divided by that turnover.
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/days-inventory-outstanding \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"average_inventory":50000,"cost_of_goods_sold":365000}'const res = await fetch("https://api.kit.forhosting.com/fin/days-inventory-outstanding", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"average_inventory": 50000,
"cost_of_goods_sold": 365000
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/fin/days-inventory-outstanding",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"average_inventory": 50000,
"cost_of_goods_sold": 365000
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/fin/days-inventory-outstanding", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"average_inventory":50000,"cost_of_goods_sold":365000}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"average_inventory":50000,"cost_of_goods_sold":365000}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/fin/days-inventory-outstanding", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"average_inventory": 50000,
"cost_of_goods_sold": 365000
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "fin.days_inventory_outstanding",
"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
Zero cost of goods sold makes the ratio undefined, so the task fails with invalid_input and is not billed.
How days inventory outstanding and days sales of inventory are computed
Equivalently, first form average daily cost of goods sold as cost_of_goods_sold divided by days, then divide average inventory by that daily run-rate; both routes are algebraically identical and this capability uses the first form. When you omit days the endpoint defaults to 365, which is the textbook annual convention.
Input contract, response shape, and error behaviour
Example: fifty thousand of average inventory against three hundred sixty-five thousand of annual cost of goods sold yields a fifty-day inventory outstanding figure and one thousand of average daily cost of goods sold. POST a JSON body with two required finite numbers and one optional period length. average_inventory is the inventory figure for the window (average of opening and closing, or ending inventory if that is the convention you already use internally); aliases inventory and avg_inventory map to the same field. cost_of_goods_sold is cost of goods sold for the same window; aliases cogs and cogs_sold are accepted so ledgers can keep their column names. days is the number of days in that window and defaults to 365 when omitted; aliases period_days, days_in_period, and number_of_days are accepted. Each numeric field may arrive as a JSON number or a numeric string. Missing fields, empty strings, and non-finite values fail with invalid_input naming the field. If average_inventory is negative the request fails. If days is supplied and is not greater than zero the request fails. Those failures are not billed. On success the body echoes average_inventory, cost_of_goods_sold, and days, then reports average_daily_cogs and days_inventory_outstanding. When inventory is positive the body also includes inventory_turnover. Pair the JSON with your own SKU aging if you need a warehouse-level story; this endpoint returns the period average, not a schedule of lots.
Where a days inventory outstanding calculator earns its keep
Keep cost_of_goods_sold strictly positive, keep average_inventory non-negative, pin the rounded day figure in tests, and you get reproducible inventory-days figures for close checklists, LMS plugins, and edge workers without standing up a warehouse engine of your own.
Technical questions
How is days inventory outstanding calculated?
DIO = (average_inventory / cost_of_goods_sold) × days. days defaults to 365 when omitted. Equivalently, divide average inventory by average daily cost of goods sold (cost_of_goods_sold / days). Both routes are the same ratio.
What does the days inventory outstanding calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.