How to Calculate Exact Age in Years, Months and Days
By Nesim Razon, independent Android developer · 2026-11-10
Subtracting birth year from this year only gives a rough age. To say someone is 31 years, 2 months and 27 days old, you have to deal with months of different lengths. This article shows the hand method step by step, with worked examples, and then explains what the Age Calculator app does with the same problem.
Why simple subtraction is not enough
If someone was born in 1995 and it is 2026, the quick answer is 31. That is only correct if their birthday has already passed this year. Before the birthday they are still 30. And if you want months and days, you need more than the year.
Exact age means counting complete years first, then complete months after the last birthday, then the days left over. It sounds fiddly, but it is the same idea as telling the time: you count whole units first and leave the remainder to the smaller unit.
The hand method, step by step
- Write the birth date and today's date as day, month, year.
- Subtract the years. This gives a first guess for the age in years.
- Subtract the months. If the result is negative, take one year away from the years and add 12 to the months.
- Subtract the days. If the result is negative, take one month away from the months and add the number of days in the month before today's month.
- Repeat the month check if borrowing a month made the months negative again.
The last point is where most mistakes happen. You borrow the length of the month that comes just before the current month, because that is the month you are completing.
Worked example one: no borrowing problem
Born on 14 August 1995, and today is 10 November 2026. Years: 2026 minus 1995 is 31. Months: 11 minus 8 is 3. Days: 10 minus 14 is minus 4, which is negative, so we borrow a month. Months become 2, and we add the length of October, 31 days, to the days: 31 minus 4 is 27.
The result is 31 years, 2 months and 27 days. You can check it by counting forward. From 14 August 1995 add 31 years to reach 14 August 2026, add 2 months to reach 14 October 2026, and then 27 more days to reach 10 November 2026.
Worked example two: borrowing twice
Born on 25 December 1990, and today is 10 November 2026. Years: 2026 minus 1990 is 36. Months: 11 minus 12 is minus 1, so we take one year away, giving 35 years, and add 12 months, giving 11. Days: 10 minus 25 is minus 15, so we take one month away, giving 10 months, and add 31 days for October: 31 minus 15 is 16.
The result is 35 years, 10 months and 16 days. Notice that this person turns 36 on 25 December, which is about six weeks away, so the answer of 35 is correct for today.
How many days until the next birthday
Take the next birthday date and count the days from today. For someone born on 20 May, with today being 10 November 2026, the next birthday is 20 May 2027. Count the rest of November (30 minus 10 is 20), then December 31, January 31, February 28, March 31, April 30 and finally 20 days in May: 20 + 31 + 31 + 28 + 31 + 30 + 20 = 191 days.
The age they will turn is simply the year of the next birthday minus the birth year. For a person born in 1990, the 2027 birthday is their 37th. If the date falls in a leap year, February has 29 days and you must add one more.
Month lengths and end-of-month dates
Months have 28, 29, 30 or 31 days, and that creates edge cases. What is one month after 31 January? There is no 31 February, so calendars usually land on the last day of February, the 28th (or the 29th in a leap year). If you count from 31 January to 1 March in an ordinary year, one common convention gives 1 month and 1 day: one month takes you to 28 February, and one more day reaches 1 March.
Other methods may give an answer that is a day or two different in cases like this. Neither is a mistake, they follow slightly different conventions. For everyday use, such as a child's age or a work anniversary, the difference is invisible; it only matters if you compare tools on the 29th, 30th or 31st of a month.
Example three: why the right month matters
Born on 20 January 2000, and today is 5 March 2026. Years: 2026 minus 2000 is 26. Months: 3 minus 1 is 2. Days: 5 minus 20 is minus 15, so we borrow. Months become 1. Which month length do we add? The month before March is February, which has 28 days in 2026. So the days are 28 minus 15, which is 13. The answer is 26 years, 1 month and 13 days.
A frequent slip is to add 30 or 31 out of habit. With 31 you would get 16 days, which is wrong. Check by counting forward: 20 January 2026 plus one month is 20 February, then 8 days left in February plus 5 days in March makes 13.
Common slips to avoid
- Borrowing the wrong month length. Use the month just before the current month, not the birth month.
- Forgetting leap days when you count total days. Every 29 February in the range adds a day.
- Counting both the start day and the end day. The difference between two dates counts each day once, so 1 January to 2 January is one day.
- Stopping at the year difference. Always check whether the birthday has already happened this year.
Totals: weeks, days and beyond
You can also express age as total months, total weeks or total days. Total days is the difference between the two dates, and it has to include leap days. From 1 January 2000 to 1 January 2001 is 366 days, because 2000 was a leap year. Total weeks is total days divided by 7, ignoring the remainder. Hours, minutes and seconds follow by multiplying days by 24, 60 and 60, which is why those numbers look impressive but add little information.
What the Age Calculator app does
The Age Calculator app uses the date arithmetic built into the phone's programming platform, which handles month ends and leap years, so you do not need to borrow in your head. Enter a birth date and it shows years, months and days, the total months, weeks and days, how long until the next birthday, and the age being reached. If you enter a future date, it shows the time remaining instead. You can also save a list of birthdays and anniversaries for friends and family.
Frequently asked questions
How do I calculate my exact age by hand?
Subtract years, months and days in turn. When a result is negative, borrow one year (12 months) or one month (the length of the previous month).
Which month's length do I borrow for the days?
The month just before the current month, because that is the month you are finishing.
How do I find how many days are left until my birthday?
Count the remaining days in this month, add the whole months in between, then add the day number of your birthday.
Why do two age calculators sometimes differ by a day?
Month-end dates such as the 31st can be counted by slightly different conventions.
Does a leap year change the number of days?
Yes. A year with 29 February has 366 days, which changes total days and days until a birthday.
More from the blog
- Leap Day Birthdays: How Do You Count Age on 29 February?
How We Guarantee a Mahjong Solitaire Board Is Solvable
Mahjong Solitaire History and How It Differs From Mahjong- How a Daily Puzzle Can Be the Same for Everyone, No Server
- How Hundreds of Puzzle Levels Are Generated and Checked
- Tic-Tac-Toe: A Solved Game, an Early Computer and Its Variants