The first age bug I shipped was in a signup form. The rule was simple enough on paper: users had to be at least 18. The implementation was the one everybody writes on the first pass — take the difference between two timestamps, divide by 365.25 days, floor it. It worked in testing because the test fixtures were birthdays from the 1980s, comfortably clear of the boundary. It failed in production for a user born on 29 February, who was told he was seventeen on the morning of his eighteenth birthday. He was, understandably, not delighted.
That is the thing about age. Everyone knows what it means, nobody agrees on how to compute it, and the naive version is wrong in ways that only surface at boundaries — leap days, month ends, the day before a birthday. A year is not 365 days. A month is not 30 days. "One month after 31 January" does not have a single correct answer, and the answer you pick changes the result. None of this matters until it does: until you are checking eligibility, filling in a form that wants "years and months," calculating a pension date, or explaining to a user why your form thinks he is seventeen.
I build developer tools for a living — toolz.dev, the WP Adminify plugin, a stack of Laravel and React apps — and date arithmetic is the category of bug I have learned to stop doing by hand. The Age Calculator on toolz.dev takes a date of birth and a target date and gives you the exact age as years, months, and days, computed with real calendar arithmetic rather than an average-month approximation. It also gives you the totals people actually ask for — how many days, weeks, hours — plus the weekday you were born on and a countdown to your next birthday.
This guide explains what the tool does, how the arithmetic works underneath, and where the genuinely hard cases are. If you only want the number, the calculator is one click away. If you have ever had to defend an age calculation to a compliance officer, read the deep dive.
TL;DR: Exact age is years, then months, then days, with days borrowed from the true length of the preceding month — not from a 30-day average. Leap days are counted. A 29 February birthday is treated as 1 March in non-leap years. The Age Calculator applies all of that in-browser, shows the totals in days, weeks, hours, and minutes, and never sends your date of birth anywhere.
Key Features
Calendar-correct years, months, and days
The headline number is an exact breakdown: 33 years, 11 months, 28 days. Not "33.97 years," not "407 months," but the three-part figure that forms and registrars ask for. The days component is computed by borrowing from the actual length of the month before the target date. If you are measuring on 14 March, the borrow comes from February — 28 days most years, 29 in a leap year — not from a notional 30-day month. That single detail is the difference between a result that matches the calendar and one that drifts by a day or two depending on the season.
Leap year and 29 February handling
Leap days are counted in every total, and the 29 February birthday case is handled explicitly rather than left to chance. The calculator treats a leap-day birthday as falling on 1 March in years that have no 29 February, and it says so in the output rather than silently making a decision on your behalf. This is the convention most common-law jurisdictions use, and it is applied consistently to both the age breakdown and the next-birthday countdown, so the two never contradict each other.
Full totals breakdown
Under the headline you get the numbers people actually search for: total months, total weeks, total days, total hours, and total minutes lived. Every one of them is derived from the exact calendar distance between the two dates, so leap days are included and nothing is rounded through an "average year" of 365.25 days. If you were born on 1 January 2000, you were 9,132 days old on 1 January 2025 — twenty-five years of 365 days plus the seven leap days in between.
Next birthday countdown
The tool reports the date of your next birthday, the weekday it falls on, the age you will be turning, and how many days remain. Weekday matters more than it sounds: knowing that a birthday lands on a Tuesday two years out is the difference between planning something and discovering the problem the week before. If the target date is the birthday itself, the tool says so rather than rolling forward a full year.
Age at any date, not just today
The second field defaults to today but is fully editable. Set it to a past date to answer "how old was she when the policy started," or to a future date to answer "will he be sixteen by the enrolment cut-off." Eligibility rules are almost always phrased as an age at a specific date, and doing that arithmetic in your head is exactly where mistakes creep in.
Clear validation, not silent wrong answers
An unparseable date, an impossible date like 30 February, a month of 13, or a date of birth after the target date all produce a specific error message. The calculator does not return a negative age, an Invalid Date, or a NaN. Being told precisely what is wrong with the input is worth more than a number you cannot trust.
100% client-side
Every calculation runs in your browser in plain JavaScript. Your date of birth is never uploaded, logged, or stored. That matters more for this tool than for most: a date of birth is one of the three or four fields that identity verification systems key on, and pasting it into a server-side calculator whose privacy policy you have not read is a small, avoidable risk. Once the page has loaded, the tool works with no network connection at all.
How to Use the Age Calculator
Step 1: Enter the date of birth
Type or pick the date in the first field. Any calendar date works — including 29 February, and including dates well over a century back. The field takes an ISO YYYY-MM-DD value, which is what the native date picker produces, so you can type it directly or use the picker. If you paste something the calculator cannot parse, it tells you the expected format rather than guessing.
Step 2: Set the date you are measuring to
The second field, "Age at date," defaults to today. Leave it alone for the common case: how old am I right now. Change it when the question is about a different moment — the day a contract is signed, an exam cut-off, the start of a school year, a retirement date, or a date in the past you are reconstructing for a record. The only constraint is that it must fall on or after the date of birth; the calculator rejects the reverse and explains why.
Step 3: Read the breakdown
Press Calculate and the result appears in three parts. At the top, the exact age as years, months, and days, with the two dates it was computed between. Below that, two cards: the weekday you were born on, and your next birthday with its date, its weekday, the age you will turn, and the days remaining. At the bottom, the totals table — months, weeks, days, hours, and minutes — each with a short note explaining exactly what it counts, because "total months" and "total days" are counted differently and it is worth being explicit.
Step 4: Copy the summary
The copy button puts a plain-English summary on your clipboard: the age, the target date, the weekday of birth, and the total days. It is the format you want when you are pasting into a form, an email, a support ticket, or a record. Then change either date and calculate again — there is no state to reset, and no round trip to a server.
The Technical Deep Dive: Why Age Arithmetic Is Harder Than It Looks
A year is not 365 days, and a month is not 30
The Gregorian year is 365.2425 days long on average. That is why we insert a leap day in years divisible by 4, skip it in years divisible by 100, and reinstate it in years divisible by 400 — which is why 2000 was a leap year and 1900 was not. The consequence for age arithmetic is direct: if you compute age by dividing elapsed days by 365, you gain roughly a day every four years, and your calculation will disagree with the calendar for anyone measured near their birthday. Dividing by 365.25 is better and still wrong, because it drifts the other way across century boundaries.
The month problem is worse, because months are not merely irregular — they are ambiguous. Months are 28, 29, 30, or 31 days. There is no defensible average. Any calculation that treats "one month" as a fixed number of days will produce an age that disagrees with what a human counting on a calendar would say.
The field-wise subtraction algorithm
The correct approach is not to convert to days at all. It is to subtract field by field, borrowing when a field goes negative, exactly as you would subtract two multi-digit numbers by hand.
Take a birth date of 15 March 1990 and a target of 14 March 2024:
- Years: 2024 − 1990 = 34
- Months: 3 − 3 = 0
- Days: 14 − 15 = −1
The days field is negative, so borrow one month. The key question is: a month of how many days? The answer is the length of the month immediately preceding the target date. The target is in March 2024, so the preceding month is February 2024, which has 29 days because 2024 is a leap year. Borrowing gives:
- Months: 0 − 1 = −1
- Days: −1 + 29 = 28
Now the months field is negative, so borrow a year: years 34 − 1 = 33, months −1 + 12 = 11. The final answer is 33 years, 11 months, 28 days — one day short of the 34th birthday, which is exactly right.
You can verify it the other way round: 15 March 1990 plus 33 years is 15 March 2023. Plus 11 months is 15 February 2024. From 15 February to 14 March 2024 is 14 days to the end of February (which has 29 days that year) plus 14 days into March, which is 28. The two methods agree, which is the property you want from a date algorithm.
Note the trap this exposes. If the same calculation ran in a non-leap year — 15 March 1990 to 14 March 2023 — the borrow would come from a 28-day February and the answer would be 33 years, 11 months, 27 days. Same relationship to the birthday, different day count, because the intervening month is a different length. That is not a bug. That is what "months and days" means.
Why one borrow is sometimes not enough
Here is the case that breaks most hand-rolled implementations. Birth date 31 January 2023, target 1 March 2023:
- Days: 1 − 31 = −30
- Borrow February (28 days): −30 + 28 = −2
Still negative. A single borrow is insufficient whenever the birth day-of-month exceeds the length of the month preceding the target. The fix is to borrow again, from the month before that — January, 31 days — giving 29 days and zero months. The answer is 0 years, 0 months, 29 days, which is precisely the number of calendar days between the two dates. If your implementation borrows exactly once, it will emit a negative days field for these inputs and nobody will notice until a user born on the 31st complains.
Why "one month later" has no single correct answer
What is one month after 31 January? There are two defensible answers, and the standards do not settle it:
- Clamping: roll back to the last valid day of the target month — 28 February (or 29 in a leap year). This is what most spreadsheet
EDATEfunctions and many date libraries do. - Rolling forward: overflow into the next month — 3 March. This is what naive
setMonth()arithmetic does in JavaScript, and it is why so many date bugs look like off-by-three-days errors.
Neither is wrong, but they cannot both be used in the same system. The Age Calculator applies the rolling-forward convention consistently, because it is the convention that makes the 29 February rule coherent: if a monthly anniversary of the 29th rolls into 1 March, then a monthly anniversary of the 31st rolls into the next month too. The borrowing algorithm above produces exactly that behaviour without any special-casing, which is one of the reasons to prefer it. A single rule, applied everywhere, beats a pile of exceptions.
The 29 February problem
Roughly one person in 1,461 is born on a leap day. In three years out of four, their birthday does not exist. Jurisdictions have had to decide what to do, and they have not all decided the same thing.
Under the common-law rule used in England, and in most US states, a person attains a given age at the start of the day before the anniversary of their birth — a fiction that neatly makes a leap-day baby's legal birthday fall on 1 March in a non-leap year. Several other systems reach the same answer by a different route, holding that the anniversary is the day following the last day of February. New Zealand and parts of Taiwan, by contrast, use 28 February. Hong Kong's Interpretation and General Clauses Ordinance and several other statutes explicitly pick one and write it down, which is the sensible thing to do.
The Age Calculator uses 1 March, states it in the output when it applies, and applies it consistently to both the age breakdown and the next-birthday countdown. So someone born on 29 February 2000 is 22 years, 11 months, and 30 days old on 28 February 2023, and turns 23 on 1 March 2023. If your local rule is 28 February, subtract a day from the countdown; the total-days figures are unaffected either way, because they are pure calendar distance.
How different systems reckon age at all
Everything above assumes chronological age counted from the moment of birth — the international standard, and what almost every legal and medical system now uses. It is not the only system that has existed.
Traditional East Asian age reckoning counted a newborn as one year old at birth, and added a year to everyone at the lunar new year rather than on individual birthdays. A baby born the day before new year would be considered two years old two days later. Korea maintained the practice in everyday life longest — alongside a separate "calendar age" used for schooling and conscription — until June 2023, when it legally standardised on international age and, in the reporting of the day, made the entire population a year or two younger overnight. China, Japan, and Vietnam had moved to international age decades earlier, though the traditional count survives in cultural and astrological contexts.
Two other reckonings are worth knowing about because they appear in real documents. Gestational age, used in obstetrics, is counted from the first day of the last menstrual period, not conception, and runs about two weeks ahead of embryonic age. And age at last birthday versus age nearest birthday is a live distinction in insurance underwriting: some policies price on the age you most recently turned, others on the age you are closest to, which can differ by a full year for anyone more than six months past their birthday. If a form asks for your age and the answer matters financially, it is worth knowing which one it means.
Timezones, and why this tool ignores them
A date of birth is a calendar date, not an instant. If you store it as a timestamp and render it in a different timezone, it can shift by a day — the classic bug where a birthday displays as the 14th for users in one hemisphere and the 15th in the other. The Age Calculator sidesteps this entirely by doing all arithmetic in UTC on midnight-anchored dates. Daylight-saving transitions, which add or remove an hour, cannot push a date across a midnight boundary, and the weekday-of-birth figure is stable no matter where you are sitting. The hours and minutes totals are counted midnight to midnight for the same reason: they are exact multiples of the day count, not wall-clock measurements.
Common Use Cases
Eligibility and cut-off dates
Almost every rule involving age is phrased as an age at a specific date. School enrolment cut-offs, driving licence eligibility, age-restricted sales, pension qualification, insurance bands, minimum ages in terms of service. The question is never "how old is this person" but "how old will this person be on the relevant date," and the editable target field is the whole point. Set the date to the cut-off and read the years figure.
Forms that want years and months
Immigration applications, medical intake forms, school records, and residency paperwork routinely ask for age in years and months, or years, months, and days. There is no shortcut for this and no way to derive it from a decimal age. It has to be computed properly, and it has to match whatever the receiving office computes, which is why the calendar-borrowing method matters — it is what the person on the other end of the form is doing.
Building age logic into an application
If you are implementing an age check, the rule is: never divide elapsed milliseconds by a year constant. Compare calendar fields. The minimal correct 18-plus check is to construct the date exactly eighteen years after the date of birth and test whether today is on or after it — and then decide, deliberately, what your system does with 29 February. I use the Age Calculator to generate boundary fixtures when I write those tests: the day before the birthday, the day of, the leap-day case, the 31st-of-the-month case. Four test cases catch essentially every age bug that reaches production.
Milestones, anniversaries, and the "how many days" question
Ten thousand days old is a real milestone that falls somewhere around your twenty-seventh birthday. Billion-second birthdays land at roughly 31.7 years. The totals table answers these directly, and the weekday-of-birth figure answers the other question people always ask. The next-birthday countdown, with its weekday, is genuinely useful for planning anything more than a few weeks out.
Reconstructing records
When you are auditing historical data — a medical record, a payroll entry, an old contract — you often need to know how old someone was on a date years in the past. Set both fields explicitly and the tool answers it without any assumptions about "now." This is also the fastest way to check whether a legacy system's stored age field was ever right, which, in my experience, is a question worth asking.
Why compute age in the browser?
Every calculation in the toolz.dev Age Calculator runs client-side. Nothing you type is transmitted, logged, or stored, and the page keeps working with no network connection once it has loaded. A date of birth is not a neutral piece of data — it is one of the fields that identity checks, password resets, and credit applications key on. There is no reason to hand it to a server just to do subtraction that your browser can do in under a millisecond.
If your work involves dates beyond birthdays, the Date Difference Calculator handles the general interval case, and the Timestamp Converter is the tool for when the date is trapped inside a Unix epoch value in a log. For everything numeric, the Percentage Calculator covers the other half of the everyday arithmetic that is easy to get subtly wrong.
FAQ
How do I calculate my exact age in years, months, and days?
Subtract the birth date from the target date field by field: years, then months, then days. If the day is negative, borrow the number of days in the month before the target date; if the month is then negative, borrow 12 months from the years. Enter your date of birth in the calculator and it applies that borrowing automatically, so the result matches a calendar rather than an average-month estimate.
Why does the number of days in my age change depending on the month?
Because months are not the same length. Borrowing days from a 28-day February gives a different remainder than borrowing from a 31-day January, so the same person can be "3 months and 2 days" in one month and "3 months and 5 days" in another after the same elapsed period. The years and total days are unambiguous; only the months-plus-days remainder depends on which months you crossed.
How does the calculator handle a 29 February birthday?
A 29 February birth date is treated as falling on 1 March in years that have no 29 February. So someone born on 29 February 2000 turns 23 on 1 March 2023 and, on 28 February 2023, is still 22 years 11 months and 30 days old. This matches the rule most common-law jurisdictions apply, where the anniversary is the day after the last day of February.
Are leap years included in the total number of days?
Yes. Total days are calculated from the actual calendar distance between the two dates, so every 29 February in the interval is counted. That is why total days divided by 365 will not exactly equal your age in years — the average Gregorian year is 365.2425 days long.
Can I calculate my age on a future or past date?
Yes. The second date field defaults to today but can be set to any date after the date of birth. This is how you check age at a cut-off — school enrolment, a policy start date, a licence eligibility date, or a contract signing — without doing the arithmetic yourself.
Is my age the same everywhere in the world?
Not necessarily. Most countries use chronological age counted from birth, which is what this calculator returns. Traditional East Asian age reckoning counted a newborn as one year old and added a year at every lunar new year, which could make someone up to two years "older" than their chronological age. South Korea legally standardised on international age in June 2023, but the traditional count still appears in cultural contexts.
What day of the week was I born on?
The calculator reports the weekday of the birth date directly. It is derived from the Gregorian calendar, so it is accurate for any date since the calendar was adopted, and it does not depend on your local timezone because all arithmetic is done in UTC.
Is my date of birth stored or sent anywhere?
No. The calculator runs entirely in your browser with plain JavaScript. Nothing you type is transmitted, logged, or stored, and the tool continues to work with no internet connection once the page has loaded.
