ForHosting KIT · Home, food & hobbies

Leftover food safety window

Cooked meat that went into the fridge on 20 July 2026 should be eaten between 23 and 24 July, a window of 3 to 4 days. Choose the leftover category and the day it was refrigerated, and add today's date to see how many days remain. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Category
Cooked meat
Refrigerated date
2026-07-20
Today
2026-07-23
You get
Category label
Cooked meat and meat casseroles
Guideline days min
3
Guideline days max
4
Use by earliest
2026-07-23

Everyone who cooks at home eventually faces the same question standing in front of the refrigerator: is this container of chili still safe to eat? General food-safety guidance, such as the cold-storage recommendations published by the USDA, gives every category of leftover a short refrigerator life measured in days, and this tool turns that guidance into concrete calendar dates. Enter the food category and the date the food went into the fridge at forty degrees Fahrenheit or below, and the calculator returns the recommended use-by window as both a day range and absolute calendar dates, computed with pure integer Julian Day arithmetic and no host clock. Add an optional reference date to learn how many days the food has already been stored, how many days remain before the end of the safe window, and whether it is still within the window or already past it. Unrecognized categories and impossible calendar dates are rejected with a clear validation error instead of a guess.

How the use-by window is computed

Each entry carries a minimum and a maximum number of days the food is generally considered safe when held in a refrigerator at four degrees Celsius or below, counted from the day it was refrigerated. The refrigeration date you supply is validated as a strict ISO calendar day, including Gregorian leap-year rules, and converted to an astronomical Julian Day Number with the Fliegel and Van Flandern integer formula.

Adding the minimum guideline days yields the earliest use-by date, and adding the maximum yields the latest use-by date; the inverse integer conversion turns both day numbers back into ordinary year, month, and day strings. When you also supply a reference date, the tool subtracts the two day numbers to get days already stored and derives the days remaining before the latest use-by date plus a simple status flag.

Food safety context and honest limits

These windows are general guidelines, not laboratory measurements of your specific container. The USDA-style cold-storage chart assumes the food was cooled promptly, within roughly two hours of cooking, and held continuously at or below four degrees Celsius in a clean, sealed container; a refrigerator that runs warm, food that sat on the counter overnight, or cross-contamination can shorten the safe life well below the numbers shown, while freezing stops the clock entirely and is the right answer for anything you will not eat within the window.

The conservative reading is the classic rule: when in doubt, throw it out, because the bacteria that cause food poisoning often leave no change in smell, taste, or appearance. Meal-prep services, commercial kitchens, and catering operations use tools like this one to label containers with computed discard dates and to audit refrigerators against written logs, while households use it to plan the week so the oldest leftovers get eaten first.

Remember that the result expresses general guidance for healthy adults; people who are pregnant, elderly, or immunocompromised should follow stricter advice from their local food-safety authority.

Everyday leftover checks at home

Type the category and the day you put the container in the fridge to see the exact use-by dates, so tonight's dinner decision is based on guidance instead of a sniff test.

Where do the day ranges come from?

They follow general USDA-style cold-storage guidance for refrigerators at 4 °C (40 °F) or below: most cooked leftovers keep three to four days, some categories slightly more or less. They are general guidelines, not a measurement of your specific container.

Why is there no automatic 'days left' without a today field?

The capability is deterministic and never reads the host clock.

What date format do the fields require?

Strict ISO YYYY-MM-DD with a four-digit year and two-digit month and day. Impossible calendar dates such as 2025-02-29 are rejected with an explanation instead of being silently rolled over.

Can I tell if leftovers are still good by smelling them?

No. The bacteria that cause food poisoning often leave no change in smell, taste or appearance, so a dish can seem fine and still be unsafe. When in doubt, throw it out.

What can make leftovers spoil before the end of the window?

The windows assume food was cooled within about two hours and kept at 4 °C (40 °F) or below in a clean, sealed container. A warm fridge, a night on the counter or cross-contamination shortens them; freezing stops the clock.

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.

POSThttps://api.kit.forhosting.com/life/leftover-food-safety-window

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.

curl -X POST https://api.kit.forhosting.com/life/leftover-food-safety-window \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"category":"cooked_meat","refrigerated_date":"2026-07-20"}'
{
  "category": "cooked_meat",
  "refrigerated_date": "2026-07-20"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "life.leftover_food_safety_window",
  "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.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

How the use-by window is computed

The calculator starts from a fixed table of USDA-style cold-storage guideline day ranges, one entry per leftover food category: cooked meat, cooked poultry, cooked fish, soups and stews, cooked rice and pasta, cooked vegetables, deli meats, pizza, cooked egg dishes, raw ground meat, raw poultry pieces, and hard-boiled eggs.

What you send and what you get back

An optional today field supplies the reference date used to compute elapsed and remaining time; leaving it out is deliberate and useful, because the absolute use-by range needs no current date at all, which keeps the capability deterministic and safe to run anywhere. Send two required fields: category, chosen from the documented closed list of leftover categories, and refrigerated_date, the strict ISO day the food entered the refrigerator. On success the response echoes the normalized category with a human-readable label, the refrigeration date, the guideline minimum and maximum days, and the use_by_earliest and use_by_latest calendar dates. With a reference date it also returns days_stored, days_remaining_to_latest (which goes negative once the window has closed), and a status of within_window or past_window. Every failure is a typed invalid_input error that names the offending field: an unknown category lists the accepted values, a malformed or impossible date explains what shape was expected, and a reference date earlier than the refrigeration date is rejected as nonsense. Validation failures are not charged; successful API calls cost the published base of $0.002 per item.

Food safety context and honest limits

The API price for a successful lookup is $0.002 per item, and because validation errors are free, you can safely wire the capability into inventory scripts that probe many categories.

Meal-prep labeling and discard dates

Batch-cooked containers can be labeled with the computed use_by_latest date, turning a weekly cooking session into an organized, rotation-friendly refrigerator.

Kitchen and catering audits

Scripts can feed category plus refrigeration date for every logged container and flag anything whose status is past_window, automating a tedious line of the food-safety checklist.

What happens if I send a category the tool does not know?

The request fails with a typed invalid_input error listing the accepted categories, and it is not charged. Category names are lowercase snake_case, such as cooked_meat or deli_meat.

What does it cost?

The browser tool is free and runs locally on the same function as the API. Successful API requests use prepaid KIT balance at $0.002 per item; invalid input is never charged.

Read the full KIT documentation →