How age is counted, and why calculators disagree
Why two age calculators give different answers for the same dates, how month-end arithmetic breaks, and which convention applies for passports, exams and insurance.
Last reviewed · 1,525 words
In short
- Age is counted in completed years, months and days. You turn 30 on your birthday, not during the year leading up to it.
- Month lengths are not equal, so subtracting dates digit by digit produces negative days. The fix is to borrow from the correct month, not from a fixed 30.
- Insurance often uses age nearer birthday, which can make you a year older than your actual age and change the premium.
- Someone born on 29 February has a legal birthday of 1 March in most Indian and UK contexts, and 28 February in some others.
- Total days between two dates is unambiguous; age in years, months and days is a convention, and conventions vary.
Age looks like the simplest calculation on this site. Subtract one date from another. In practice it is one of the few where two competent implementations can disagree by a day or a month, and where the "right" answer depends on who is asking.
The convention: completed units
Almost everywhere in the world, age means completed years. A person who was born on 15 June 1995 is 30 years old from 15 June 2025 until 14 June 2026, and 31 from the day after.
This is not universal. Under the traditional East Asian reckoning still used informally in parts of Korea and China, a baby is one at birth and gains a year at new year, so a child born in December is two years old a few weeks later. South Korea legislated the international system as its default in 2023 precisely because the coexistence of three systems had become unworkable.
Every calculator here uses the international convention: completed years, then completed months, then remaining days.
Why the days go negative
The naive algorithm subtracts each component and borrows when one goes negative:
years = y2 - y1
months = m2 - m1
days = d2 - d1
if days < 0 { days += 30; months -= 1 }
if months < 0 { months += 12; years -= 1 }
The days += 30 is the bug. Months are not thirty days long, and the borrow has to come from the length of the month actually being borrowed from.
Take 31 January 2024 to 1 March 2024. Naively: days 1 − 31 = −30, so add 30 to get 0 and borrow a month; months 3 − 1 − 1 = 1. Answer: "1 month, 0 days". But January has 31 days, so borrowing 30 is borrowing the wrong amount, and a variant of the same code produces the widely-seen "0 months, −1 days".
The correct approach is to anchor to real calendar months. Add whole months to the start date until adding one more would overshoot the end date, then count the actual days remaining. From 31 January, adding one month lands on 29 February 2024 — February has no 31st, so the day clamps to the month's last day — and 1 March is one day later. The answer is 1 month, 1 day, and the arithmetic never sees a negative.
| From | To | Naive borrow-30 | Anchored months |
|---|---|---|---|
| 31 Jan 2024 | 1 Mar 2024 | 0 months, −1 days | 1 month, 1 day |
| 31 Mar 2024 | 30 Apr 2024 | 0 months, 29 days | 0 months, 30 days |
| 31 Dec 2023 | 29 Feb 2024 | 1 month, 29 days | 1 month, 29 days |
The third row agrees, which is why the bug survives so long in production code: it is only wrong at month boundaries.
Leap years, and the 29 February problem
A leap year has 366 days. The rule is that a year divisible by 4 is a leap year, except centuries, except centuries divisible by 400 — so 1900 was not and 2000 was.
Someone born on 29 February has a birthday in only one year out of four. Legally, most jurisdictions treat their birthday in a common year as 1 March, on the reasoning that they turn a year older once 28 February has fully elapsed. India and the United Kingdom both take this view for majority and for statutory age limits. Some contexts — a handful of US states, and certain insurance contracts — use 28 February instead, which matters for anyone whose eligibility falls on exactly that date.
This calculator uses 1 March, consistent with Indian practice.
Age nearer birthday, and why insurance says you are older
Life insurers frequently price on age nearer birthday rather than age last birthday. If you are more than six months past your last birthday, you are treated as already being the next age.
Someone aged 34 years and 7 months has an insurance age of 35. The premium difference is small at 35 and material at 55, where mortality tables climb steeply.
The practical consequence is that buying a policy shortly before you cross the six-month mark can be meaningfully cheaper than buying it shortly after, for a difference of days. If you are within a few weeks of that boundary, it is worth checking which convention the insurer uses — some use age last birthday and a few use age next birthday, which is more expensive still.
| Convention | Age at 34 years 7 months | Typical use |
|---|---|---|
| Age last birthday | 34 | Most general purposes, exams, employment |
| Age nearer birthday | 35 | Life insurance pricing |
| Age next birthday | 35 | Some older insurance products |
Where the date of birth actually matters
Examinations. Indian competitive exams specify an age limit as of a fixed cut-off date — typically 1 August or 1 January of the exam year — not as of the exam date. Someone who crosses the limit in September is still eligible for an exam with an August cut-off.
School admission. Most states require a child to have completed a minimum age as of 31 March or 1 June of the academic year. A child born in July can therefore be nearly a year behind a classmate born the previous August, which is the single largest source of within-class age variation.
Retirement. Government service in India ends on the last day of the month in which the employee turns 60 — except for those born on the first of a month, who retire on the last day of the previous month, having completed 60 years on the last day of that month.
Majority. Eighteen years completed, not the year in which you turn eighteen. Voting eligibility uses a qualifying date of 1 January and now also 1 April, 1 July and 1 October since the quarterly revision of electoral rolls began.
Total days, and why it is the safer number
Where a calculation must be unambiguous, count days rather than years and months.
The number of days between two dates has one correct answer. There is no convention to disagree about, no month length to borrow from, and no leap-day edge case beyond counting 29 February when it occurs. Interest accrual, notice periods and medical dosing all work this way for exactly that reason.
Age in years, months and days is a human summary of the same interval, and summaries lose information. If two systems disagree about your age, comparing the total-day counts will usually show they agree about the underlying interval and differ only in how they present it.
Counting business days and notice periods
A great many practical questions are not about age at all but about an interval measured in a particular kind of day, and the convention has to be stated before the count means anything.
Inclusive or exclusive? A thirty-day notice period served from 1 April ends on 30 April if the first day counts and 1 May if it does not. Indian contract practice generally excludes the day of the event and includes the last day, which is the rule the General Clauses Act applies to statutory periods. Contracts often say something different, and the contract wins.
Which days count? Business days exclude weekends and gazetted holidays, and the holiday list differs by state and by industry. A settlement described as "T+1" for a share sale means one trading day, which across a long weekend can be four calendar days.
What happens at a deadline that falls on a holiday? Most Indian statutes move it to the next working day. A few, notably certain tax deadlines, do not.
None of this changes the arithmetic; it changes which arithmetic to do. When an interval carries a consequence — a limitation period, a probation confirmation, a loan reset date — read the definition before counting, because the count itself is never the part that goes wrong.
Age from a date of birth, worked through
Take a date of birth of 15 June 1995 and measure to 11 September 2026.
Whole years come first. 15 June 2026 is the last birthday on or before the as-on date, so 31 years are complete. Whole months next: counting on from 15 June, 15 August is the last month-date that does not pass 11 September, so 2 more months are complete. The days left over run from 15 August to 11 September, which is 27 days.
| Measure | Result |
|---|---|
| Age | 31 years, 2 months, 27 days |
| Total months | 374 |
| Total weeks | 1,630 |
| Total days | 11,411 |
The total in days, 11,411, counts every calendar day, including the leap days of 1996, 2000, 2004, 2008, 2012, 2016, 2020 and 2024. It is the figure to use when a rule is written in days; the years, months and days figure is what a form means by "age as on".
What this calculator assumes
- Age is measured in completed years, then completed months, then remaining days, using anchored calendar months rather than a fixed 30-day month.
- The proleptic Gregorian calendar is used throughout, so dates before 1582 are counted as though the Gregorian rules had always applied.
- The birthday of a 29 February birth falls on 1 March in common years.
- Both dates are treated as local calendar dates with no time component, so time zones do not shift the result.
- The end date is exclusive of its own day, so the interval from a date to itself is zero rather than one day.