Age Calculator
Free age calculator — type a birthdate and a reference date and get exact age in years, months and days. Defaults to today. Runs in your browser.
Type a birthdate and (optionally) a reference date — the “as of” date. The calculator returns the exact age in years, months and days.
The algorithm
It’s straightforward calendar arithmetic:
- Years = reference-year − birth-year.
- Months = reference-month − birth-month.
- Days = reference-day − birth-day.
- If days is negative, borrow from the previous month (add the number of days in that month) and decrement months by 1.
- If months is negative, add 12 and decrement years by 1.
Someone born 2000-12-31 evaluated on 2025-06-15:
days = 15 − 31 = −16; borrow 31 (May), so days = 15, months − 1. months = (6 − 12) − 1 = −7; +12 = 5, years − 1. years = (2025 − 2000) − 1 = 24 years, 5 months, 15 days.
(Their 25th birthday hasn’t happened yet.)
Why a “reference date” input
A pure function can’t read the system clock and stay pure. So the second input is the “as of” date — defaults to today’s date at build time. To get your exact age right now, update the “As of” field to today.
Avoiding the off-by-one
The naive shortcut current year − birth year is wrong by up to a year whenever the birthday hasn’t happened yet this year. This calculator does the full calendar math, so it’s correct on the day before the birthday and on the day after.
Leap year birthdays
For Feb 29 birthdays, this calculator uses strict math: a Feb 29 birth evaluated on Feb 28 in a non-leap year is counted as one day shy of the birthday. In law and convention this varies — some jurisdictions count the birthday on Feb 28, some on Mar 1 — but the math is unambiguous.
Worked examples
-
Born January 1, 2000, as of May 12, 2026
26 years, 4 months and 11 days old.
-
Born December 31, 2000, as of June 15, 2025 (birthday not yet)
24 years, 5 months and 15 days old.
Frequently asked questions
How is age calculated?
Calendar arithmetic. Years are the difference of the year parts; months and days are adjusted by borrowing if the reference month/day is before the birth month/day. So someone born Dec 31, 2000 evaluated on June 15, 2025 is 24 years, 5 months and 15 days old — not 25 — because their 25th birthday hasn't happened yet.
Why does this need an \"as of\" date?
Pure calculator functions can't read the current time without becoming irreproducible. The reference date defaults to today's date at build time; for the most accurate "right now" age, update the "as of" field to the current date before hitting submit.
What about leap-year birthdays (Feb 29)?
Feb 29 birthdays are handled by the calendar rule: in non-leap years, the birthday is conventionally observed on Mar 1 (legal) or Feb 28 (some cultures). This calculator does the strict math: a Feb 29 birth evaluated against Feb 28 of a non-leap year counts as 1 day before the birthday, so the year hasn't ticked yet.
Does it handle BCE / very old dates?
Dates before 1900 work but ISO date input fields may not pre-populate them well in older browsers. For chronological year-counting (history, genealogy), the simpler day-difference calculator is more robust.
How accurate is this vs. just \"current year − birth year\"?
Much more accurate. The shortcut (subtract years) is wrong by up to a year whenever the birthday hasn't happened yet this year — a common source of off-by-one errors in software.