Expiration Date Calculator
A product made on March 15, 2026 with an 18-month shelf life expires on September 15, 2027. This expiration date calculator adds a shelf life to a production, packaging, or purchase date and returns the exact expiry date, how many days remain, and whether the item has already passed its date. It handles days, weeks, months, and years, and it correctly resolves calendar edge cases like January 31 plus one month, where the target month has no 31st day to land on. The tool covers more than groceries. People use it for canned and packaged food, prescription and over-the-counter medication, cosmetics and sunscreen, cleaning chemicals, contact lens solution, and infant formula, plus non-food items that follow the same start-date-plus-duration pattern, such as passports, warranties, professional certifications, and food-safety inventory logs. Anywhere a label reads "use within 12 months of opening" or "valid for 5 years from issue," the same date math applies. Getting the expiry date right matters for different reasons depending on the item. For food and medicine, an accurate date protects against spending money on something already past its window, or discarding something still fine. For inventory, compliance, and personal documents, an accurate date keeps stock rotation, audits, and renewals on schedule instead of relying on memory or a note stuck to the fridge.
Quick answer
Expiration date = production date + shelf life.
Expiration
Expires January 28, 2028 (549 days left)
Expiration date
2028-01-28
Days remaining
549
What this tells you
- •Expiration date = production date + shelf life.
- •Days and weeks add exact day counts, so 14 days from July 10 is always July 24 regardless of which months it crosses.
- •Months and years move the calendar date forward by that many months, keeping the same day of month whenever the target month has enough days.
- •When the target month is shorter, the date clamps to that month's last day, so January 31 plus 1 month becomes February 28, not March 3.
- •A whole-year shelf life added to a leap day, February 29, clamps to February 28 the next year, since most years have no 29th.
- •The days-remaining count compares the computed expiry against today's date and switches to a days-past-expiry count once the item is overdue.
- •Shelf life for months and years must be a whole number, because calendar months don't split evenly into days the way weeks do.
How to Use
- 1Enter the production, packaging, or purchase date shown on the label or receipt.
- 2Enter the shelf life number and pick its unit: days, weeks, months, or years.
- 3Click Calculate to see the expiration date, a formatted summary, and the days remaining.
- 4If the item has already passed its date, the result switches to show how many days past expiry it is instead of days remaining.
- 5For products with a separate opened-shelf-life rule, such as sauces or eye drops, run the calculation twice: once for the printed shelf life from the packaging date, and once for the shorter opened-shelf window from the date you opened it.
- 6For documents and warranties, use the issue date as the start date and the validity period as the shelf life, the same way you would for a food item.
How It Works
Formula
expiration date = start date + shelf lifeFor day and week shelf lives, the calculator adds the exact number of days: a 2-week shelf life adds exactly 14 days regardless of which months it crosses. For months and years, it moves the calendar forward the stated number of months while keeping the same day of month wherever that day exists in the target month. A 6-month shelf life from March 15 lands on September 15 because September has 15 days to spare. When the target month is shorter than the start day, such as one month past January 31, the calculator clamps the result to the last day of that month instead of overflowing into the next one, so the answer is February 28 rather than March 3. The days-remaining figure is the rounded difference, in whole days, between the expiration date and today. A positive number means time left, and a negative number, shown as "expired X days ago," means the item is past its calculated date.
Calculation note: values are processed in the order shown above, using the current input units.
Worked Examples
Canned food with an 18-month shelf life
18 calendar months forward from March 15, 2026 lands on September 15, 2027, keeping the same day of month because both months have at least 15 days. This is a typical shelf life for shelf-stable canned goods.
Fresh milk, 14 days from packaging
Days add as an exact count, so 14 days after July 10 is July 24 with no calendar-month adjustment involved. Dairy and other short-shelf-life items are almost always tracked in days rather than months.
Medication bought January 31 with a 1-month supply window
February has no 31st day in 2026, so the date clamps to the month's last day, February 28, instead of rolling into March. This clamp rule applies whenever the start day is higher than the number of days in the target month.
Sunscreen with a 3-year shelf life
Three years adds 36 months, and June has enough days to keep the 1st in the target year. Sunscreen and many other cosmetics commonly carry a 2-to-3-year shelf life measured from the manufacture date.
Document issued on a leap day
February 29, 2024 was a leap day, and 2025 is not a leap year, so the calculator clamps the anniversary date to February 28 instead of rolling into March 1. Any yearly renewal issued on a leap day hits this same clamp in every non-leap year.
Vitamins with a 6-week shelf life after opening
Weeks convert to exact days behind the scenes, so 6 weeks becomes 42 days added to May 1, landing on June 12, 2026. This shorter window matches the opened-shelf-life dates many supplements and liquid medications print separately from their unopened date.
Typical Shelf Lives
Common products and how long they usually keep, unopened and stored properly.
| Product | Typical shelf life |
|---|---|
| Fresh milk | 5-14 days |
| Eggs (refrigerated) | 3-5 weeks |
| Bread | 5-7 days |
| Canned vegetables | 1-5 years |
| Dried pasta | 1-2 years |
| Most medications | 1-5 years |
| Sunscreen | 3 years |
| Infant formula (unopened) | 12-24 months |
| Cosmetics (opened) | 6-12 months |
| Contact lens solution (opened) | 1-3 months |
Best-before, use-by, and expiration: what the labels mean
Packaging language is not consistent, and this calculator's "expiration date" output can stand in for several different label terms depending on the product. Best-before dates describe peak quality, not safety, so shelf-stable food is often still fine to eat after that date passes, just with softer texture or duller flavor. Use-by dates on perishables like fresh meat, deli food, and some dairy are closer to a hard safety cutoff, because bacteria growth becomes a real risk once that date passes.
Medications and infant formula use expiration dates that manufacturers back with stability testing, so the printed date is the one to follow rather than a smell or appearance check. Cosmetics and sunscreen typically show a period-after-opening symbol, a small open-jar icon with a number like "12M," which counts from the day you first opened the container rather than from manufacture.
Whichever label style your product uses, the input to this calculator is the same: a start date and a duration. Type the production date printed on the package, or the date you personally opened or purchased the item if that is the clock your product actually runs on, then let the shelf life duration do the rest. Matching the right start date to the right duration is the part that trips people up more often than the date math itself.
Common mistakes
- Counting from the purchase date when the label counts from production. Weeks can pass between the two for shelf-stable goods.
- Treating best-before as unsafe-after. Best-before marks peak quality, while use-by on perishables is the actual safety line.
- Ignoring the opened clock. Many products switch to a much shorter life once opened, whatever the printed date says.
- Picking the wrong unit in the dropdown. Entering "6" as months instead of weeks moves the date roughly four times further out, which matters most on short-shelf items like opened sauces or eye drops.
- Assuming a whole-year shelf life from a leap day lands on February 29 again. It clamps to February 28 in every non-leap year, so a one-year renewal from February 29 is due February 28, not March 1.
- Reading days remaining as a safety margin. The count is calendar math only, so an item left in a hot car or a torn package can spoil well before the computed date arrives.
Embed this calculator on your site
Drop this single line where you want the calculator to appear. It is responsive, mobile-friendly, resizes automatically, and is free to use with attribution.
<script src="https://calctide.com/embed.js" data-tool="expiration-date-calculator" async></script>Preview the embed at /embed/expiration-date-calculator/.