Age Calculator
Calculates exact age in years, months, days and total in hours/minutes/seconds from a birth date.
- Total in days
- Total in hours
How is the calculation done?
To reach the difference, it's broken first into full years, then months, and finally the leftover days. All of it on the Gregorian calendar, with leap years handled correctly.
On top of that, the totals show up in days, hours, minutes and seconds, in case you want a quick cross-check.
Your data isn't sent anywhere.
How age is actually calculated
Calculating a person's age looks trivial: take the current year and subtract the year of birth. In practice that shortcut only works on or after the birthday in the current year. The standard algorithm is: subtract the years, then check whether the current month and day are before the month and day of birth. If they are, the person has not had their birthday yet this year, so you subtract one from the year difference.
A more general approach calculates a triple of years, months, and days. Start by subtracting day from day; if the result is negative, borrow days from the previous month (using the actual number of days in that month) and decrement the month difference. Then subtract month from month; if negative, borrow twelve months and decrement the year difference. Finally subtract year from year. This is essentially the algorithm used by spreadsheets like Excel through the DATEDIF function and by libraries such as Java's Period.between or JavaScript's date-fns differenceInYears.
A common naive shortcut is to convert both dates to milliseconds, subtract, and divide by the number of milliseconds in a year. That introduces an error of up to several days because no fixed number of milliseconds equals a calendar year: some have 365 days, some have 366, and at the century scale the gregorian rule about years divisible by 100 but not 400 further perturbs the count.
Leap years and February 29
The Gregorian calendar adds an extra day, February 29, in years divisible by four, except in years divisible by 100 unless they are also divisible by 400. That is why 2000 was a leap year but 1900 and 2100 are not. A person born on February 29 only sees their literal birthday once every four years on average, which raises a practical question: in non-leap years, should the birthday be observed on February 28 or March 1?
Practice varies. In the United Kingdom and New Zealand, leap-day babies legally age up on March 1 in non-leap years, which matters for driving licences, voting eligibility, and age-restricted activities. In Hong Kong, the law moves the birthday to March 1 as well. In Taiwan and parts of mainland China, the legal birthday is February 28. In the United States there is no single federal rule and most states default to whichever date the person would naturally reach an age threshold first. Brazilian doctrine generally treats March 1 as the date on which a leapling reaches majority, although socially many people celebrate on February 28.
Legal ages in Brazil
Article 5 of the 2002 Civil Code sets full civil majority at 18, replacing the 21-year threshold of the 1916 code. From 16 to 18, a person is described as relatively incapable and can do certain acts with assistance: marry with parental consent, sign as a witness, or open a bank account with a representative. Article 27 of the Penal Code makes criminal imputability begin at 18; offenders below that age are governed by the Estatuto da Criança e do Adolescente (ECA) and may receive socio-educational measures rather than criminal sentences.
Voting is optional at 16 and 17, mandatory from 18 to 70, and optional again after 70. A driving licence (CNH) is issued from 18. Alcohol consumption is restricted to 18 and above by federal statute, and the same threshold applies to most age-restricted entertainment. Retirement under the post-2019 reform requires 65 years for men or 62 for women combined with minimum contribution time, with transition rules for those who were already contributing.
Biological versus chronological age
Chronological age counts how many revolutions of the Earth around the Sun have happened since you were born. Biological age tries to estimate how worn the body actually is. The leading methods include the Horvath epigenetic clock, which uses DNA methylation patterns at hundreds of CpG sites to predict age within a few years; the PhenoAge and GrimAge scores developed by Levine and colleagues, which combine clinical biomarkers; and telomere length measurements, where shorter telomeres correlate with cellular senescence and disease risk.
These tools can show that two 50-year-olds have biological ages differing by a decade in either direction, depending on smoking, sleep, exercise, chronic stress, and disease. They are useful for research and personalised medicine but do not change the legal or chronological age that determines retirement, voting, or insurance pricing.
Days, hours, and seconds of precision
Counting age in days is straightforward once you handle leap years: convert both dates to a serial day number (the number of days since a fixed epoch like January 1, 1970) and subtract. Counting in hours or seconds requires assumptions about time zones, daylight saving transitions, and leap seconds. The Gregorian calendar itself drifts about three days every ten thousand years compared to the tropical year, so over a millennium the cumulative error is visible but negligible for any individual lifespan.
Other age contexts
Gestational age is counted from the first day of the last menstrual period, not from conception, so it overstates fetal age by about two weeks. Corrected age for premature babies subtracts the weeks of prematurity from chronological age until about two years, when developmental milestones converge. Pet ages are often expressed in human-equivalent years: a popular formula for dogs is 16 ln(age) + 31, which fits epigenetic data better than the old "multiply by seven" rule. On Mars, a year is 687 Earth days, so a 30-year-old human would be about 16 in Martian years.
Common mistakes
- Mixing up DD/MM/YYYY and MM/DD/YYYY when entering or copying dates between locales.
- Letting the local time zone shift the date by one day when storing or parsing ISO strings.
- Dividing milliseconds by 365.25 days and rounding, which can drop or add a day near a birthday.
- Forgetting that a person born on the 31st of a long month has no "same day" in February.
- Treating February 29 as identical to February 28 or March 1 without checking the legal context.
FAQ
Why does the calculator show one day less than I expected? Probably a time-zone issue when the input field was parsed as UTC midnight and your local time is behind UTC. Always pick the date from the picker rather than typing across locales.
Can I use this calculator to confirm legal age for a contract? The result is accurate as a date calculation, but the legal effect of reaching a certain age depends on the jurisdiction. Brazilian civil majority is reached on the day the person turns 18, starting at the first instant of that day.
Why are months not always 30 days in the breakdown? The months figure counts complete calendar months, so the day count reflects the actual length of the partial month between the last birthday-of-month and the reference date.
Does the calculator handle dates before 1582? Modern date libraries use the proleptic Gregorian calendar, projecting current rules backward. Historical dates may differ from local calendars in use at the time, such as Julian or regional variants.
Calculate exact age
Anyone can count age in years. The tricky part is the leftover months and days up to today's date. Starting from a birth date, this tool breaks the age down into years, months and days, and throws in the total hours, minutes and seconds you've already lived.
It helps with that form demanding an exact age, figuring out how many months old a baby is, checking whether you meet some age requirement, or just satisfying the urge to see your own existence turned into oddly large numbers. Any date works, from a newborn to someone from centuries ago.
Enter the birth date and the detailed age shows up right away. The math happens in your own browser, and the date you type isn't stored anywhere.
Read more on this
Related Tools
Time Lived Calculator
Discover exactly how long you have lived: years, months, days, hours and weeks since your date of birth.
Gestational Age Calculator (LMP)
Calculate gestational age in weeks and days from the last menstrual period (LMP). Track the pregnancy week by week with precision.
Date Difference Calculator
Calculate the difference in days, weeks, months and years between two dates. Instant result in the browser.