Enter a date of birth and the date you want the age on. You get the exact age, the age in months, weeks, days, hours, minutes and seconds, and the days until the next birthday.
Table of Contents
-
What you can do on this page
-
What is this calculation used for?
-
How to Use
-
Formula
-
Symbols and terms
-
Good to know before you start
-
How to calculate it in Excel
-
How to calculate it in Google Sheets
-
How to calculate it in Python
-
How to write it in LaTeX and other math languages (copy and paste)
-
How to have ChatGPT do the calculation
-
DataChef Features
-
Related Features
-
NumberChef Calculators List
What you can do on this page
- Enter a date of birth and get the exact age in years, months and days on the spot. Change the second date to find the age on any day, such as the first day of a new job or the date of an exam
- The age is also shown in months, weeks, days (days since birth), hours, minutes and seconds, together with the number of days until the next birthday
- Use it to check the age to write on a form, a baby's age in weeks and months, or how many days have passed since an anniversary
- A plain-language explanation of how age is counted and copy-and-paste formulas for Excel, Google Sheets (the DATEDIF function) and Python are all on this page
What is this calculation used for?
Many forms ask for your age "as of" a certain date, such as the date you submit an application or the first day of a program. Close to a birthday, the age on the day you fill in the form and the age on the deadline can be different, so it is safest to count the age on the date the form asks for.
The same calculation checks rules such as "must be at least 16 years old on the day of the test" or the "age as of" date that youth sports leagues use to place players in age groups.
In most US states, a child starts kindergarten in the fall if they turn 5 by the state's cutoff date, which is often around September 1. Enter the child's date of birth and the cutoff date to see whether they will be 5 by then.
For example, a child born on September 3, 2021 is still 4 years old on September 1, 2026, so with a September 1 cutoff they would start kindergarten a year later. Cutoff dates vary by state and school district, so check your local rule.
Many rights and programs start at a set age: voting at 18, Medicare at 65, and full Social Security retirement benefits at 67 for people born in 1960 or later. Put in a future date to see how old you will be then, or how many days are left until your next birthday.
Be aware that some agencies count differently. The Social Security Administration treats you as reaching an age on the day before your birthday. Always confirm the exact rule with the official source before you plan.
Well-child checkups and vaccine schedules are usually given as "at 2 months", "at 4 months" and so on, and for newborns people often count in weeks. A month is counted on the same day number in the next month (the corresponding date), so this calculator also gives the right answer for babies born at the end of a month, when "one month later" can be confusing.
The "Age in days" also counts the birth date as day 0, the usual way to count days since birth.
"How many days since our wedding?" "When is our 1,000th day together?" Enter the anniversary date in place of the date of birth, and the same calculation works.
One thing to note: the "days" here are days elapsed, with the start date as day 0. If you want to celebrate "day 1,000" counting the start date as day 1, then 999 days elapsed is your "day 1,000". Decide which way you count before you plan the celebration.
Formula
Symbols and terms
Symbols
| \(A\) | A | The age in years, from the first letter of "age". |
| \(Y_1\), \(Y_2\) | Y sub 1, Y sub 2 | The birth year (\(Y_1\)) and the year of the date you want the age on (\(Y_2\)). (Example - born in 1990, age in 2026: \(Y_1 = 1990\), \(Y_2 = 2026\)) |
| \((M_2, D_2) < (M_1, D_1)\) | comparing month-day pairs | Means "the month and day of the date (\(M_2, D_2\)) come before the month and day of the birthday (\(M_1, D_1\))". Compare the months first, and compare the days only when the months are the same - the same way words are ordered in a dictionary. |
| \(d\) | d | The adjustment in the age formula. It is 1 if that year's birthday has not come yet, and 0 on the birthday or after it. |
| \(M\), \(m\) | M (capital and lowercase) | The total months (\(M\)) and the extra months (\(m\)). For "36 years 5 months", \(m = 5\) and the total is \(M = 12 \times 36 + 5 = 437\) months. |
| \(N\) | N | The number of days elapsed since birth (days since birth). It counts the actual calendar days, with the birth date as day 0. |
| \(W\), \(r\) | W, r | The weeks (\(W\)) and the extra days (\(r\)). Divide the days elapsed by 7. The whole-number answer is \(W\) and the remainder is \(r\). |
| \(T_h,\ T_m,\ T_s\) | T sub h, T sub m, T sub s | The elapsed time written in hours, minutes and seconds. The small letter at the lower right (the subscript) is the first letter of the unit. |
Terms
| chronological age | Age counted from the date of birth, starting at 0 and going up by 1 on each birthday. It is the age used in everyday life and on official documents. Doctors and schools also use this name to tell it apart from other measures such as developmental age. |
| corresponding date | The same day number in a later month or year. For January 15, the corresponding date in the next month is February 15. The extra months in an age are counted by whether this date has been reached. When the next month has no such day, as with January 31, the last day of that month takes its place, and the month is complete when that last day ends. For example, a baby born on January 31, 2023 is "0 months 28 days" old on February 28, 2023 (not yet 1 month) and "1 month 1 day" old on March 1. The extra days are then counted again from the substitute day (February 28), so the age jumps from "0 months 28 days" straight to "1 month 1 day", and there is no day that reads "exactly 1 month 0 days". |
| leap year | A year with a February 29. It usually comes every 4 years, but years divisible by 100 are common years unless they are divisible by 400 (2100 is not a leap year, 2000 was). In this calculator, a person born on February 29 turns one year older on March 1 in common years. Laws and agencies do not all agree (some use February 28), so check the official rule when a legal age matters. |
| cutoff date | The date by which a child must reach a certain age, for example to start kindergarten. In most US states a child starts kindergarten in the fall if they turn 5 by the state's cutoff date, which is often around September 1 but varies by state. Children with birthdays just after the cutoff wait a year and become the oldest in their class. |
| days since birth | The number of days counted with the birth date as day 0. The "Age in days" in this calculator uses this count. It is 1 less than a count that calls the birth date "day 1", so be careful which one you need. |
| Social Security age rule | The US Social Security Administration treats a person as reaching an age on the day before their birthday. So for its rules, someone born on January 2 reaches the age on January 1. This calculator uses the everyday rule (a year older on the birthday), so it can differ by one day for such rules. |
Good to know before you start
Here is what helps you use the calculation on this page with real understanding, not just by pressing the button.
If you get stuck, going back over these topics is the quickest way forward.
| Subtracting larger numbers (Grade 4) |
|
| Time and the calendar (Grades 3–4) |
|
| Multi-digit multiplication (Grades 4–5) |
|
| Division with remainders (Grade 4) |
|
How to calculate it in Excel
| Date of birth | 1990-01-15 |
| Age on this date | 2026-07-03 |
| Age (years) | =DATEDIF(B1,B2,"Y") |
| Extra months | =DATEDIF(B1,B2,"YM") |
| Extra days | =DATEDIF(B1,B2,"MD") |
| Date of birth | 1990-01-15 |
| Age on this date | 2026-07-03 |
| Total months | =DATEDIF(B1,B2,"M") |
| Total days (days since birth) | =B2-B1 |
| Weeks | =INT((B2-B1)/7) |
| Extra days (remainder after weeks) | =MOD(B2-B1,7) |
| Date of birth | 1990-01-15 |
| Age on this date | 2026-07-03 |
| Age in hours | =(B2-B1)*24 |
| Age in minutes | =(B2-B1)*1440 |
| Age in seconds | =(B2-B1)*86400 |
| Date of birth | 1990-01-15 |
| Age today (years) | =DATEDIF(B1,TODAY(),"Y") |
In the first table, B3 = 36, B4 = 5 and B5 = 18, so the age is "36 years, 5 months, 18 days". In the second table, the total is 13,318 days, which is 1,902 weeks and 4 days. If "=B2-B1" shows up as a date, change the cell format to "Number".
Note: DATEDIF with "MD" is known to be off by 1 or 2 days, or even to give odd values, around the ends of months (for example, for people born on the 31st). When the extra days matter, use this calculator's result as your guide.
With TODAY() as in the last table, the age updates to "age today" every time you open the file.
How to calculate it in Google Sheets
| Date of birth | 1990-01-15 |
| Age on this date | 2026-07-03 |
| Age (years) | =DATEDIF(B1,B2,"Y") |
| Extra months | =DATEDIF(B1,B2,"YM") |
| Extra days | =DATEDIF(B1,B2,"MD") |
| Date of birth | 1990-01-15 |
| Age on this date | 2026-07-03 |
| Total months | =DATEDIF(B1,B2,"M") |
| Total days (days since birth) | =B2-B1 |
| Weeks | =INT((B2-B1)/7) |
| Extra days (remainder after weeks) | =MOD(B2-B1,7) |
| Date of birth | 1990-01-15 |
| Age on this date | 2026-07-03 |
| Age in hours | =(B2-B1)*24 |
| Age in minutes | =(B2-B1)*1440 |
| Age in seconds | =(B2-B1)*86400 |
| Date of birth | 1990-01-15 |
| Age today (years) | =DATEDIF(B1,TODAY(),"Y") |
As in Excel, DATEDIF with "MD" can be off by 1 or 2 days around the ends of months.
How to calculate it in Python
from datetime import date
birth = date(1990, 1, 15) # date of birth
ref = date(2026, 7, 3) # the date to find the age on (use date.today() for today)
# Age: subtract the years, then subtract 1 if the birthday has not come yet
age = ref.year - birth.year - ((ref.month, ref.day) < (birth.month, birth.day))
total_days = (ref - birth).days # days elapsed since birth
weeks, extra_days = divmod(total_days, 7) # weeks and extra days
print(f"Age: {age} years")
print(f"Days elapsed: {total_days} days ({weeks} weeks and {extra_days} days)")
print(f"Hours: {total_days * 24} / Minutes: {total_days * 1440} / Seconds: {total_days * 86400}")
How to write it in LaTeX and other math languages (copy and paste)
A = Y₂ − Y₁ − d (d = 1 if the date is before that year's birthday, 0 on or after it)
A = Y_2 - Y_1 - d, \quad d = \begin{cases} 1 & ((M_2, D_2) < (M_1, D_1)) \\ 0 & (\text{otherwise}) \end{cases}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>A</mi><mo>=</mo>
<msub><mi>Y</mi><mn>2</mn></msub><mo>−</mo>
<msub><mi>Y</mi><mn>1</mn></msub><mo>−</mo>
<mi>d</mi><mo>,</mo><mspace width="0.7em"/>
<mi>d</mi><mo>=</mo>
<mrow>
<mo>{</mo>
<mtable columnalign="center left">
<mtr>
<mtd><mn>1</mn></mtd>
<mtd><mrow><mo>(</mo><msub><mi>M</mi><mn>2</mn></msub><mo>,</mo><msub><mi>D</mi><mn>2</mn></msub><mo>)</mo><mo><</mo><mo>(</mo><msub><mi>M</mi><mn>1</mn></msub><mo>,</mo><msub><mi>D</mi><mn>1</mn></msub><mo>)</mo></mrow></mtd>
</mtr>
<mtr>
<mtd><mn>0</mn></mtd>
<mtd><mtext>otherwise</mtext></mtd>
</mtr>
</mtable>
</mrow>
</mrow>
</math>
A = Y_2 - Y_1 - d, d = {(1, if (M_2, D_2) < (M_1, D_1)), (0, otherwise):}
age = y2 - y1 - Boole[m2 < m1 || (m2 == m1 && d2 < d1)]
age := y2 - y1 - piecewise(m2 < m1 or (m2 = m1 and d2 < d1), 1, 0);
age = y2 - y1 - (m2 < m1 | (m2 == m1 & d2 < d1));
A = Y_2 - Y_1 - d (d = 1 if the date is before that year's birthday, 0 on or after it)
M = 12A + m
M = 12A + m
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>M</mi><mo>=</mo>
<mn>12</mn><mi>A</mi>
<mo>+</mo><mi>m</mi>
</mrow>
</math>
M = 12A + m
totalMonths = 12*age + extraMonths
totalMonths := 12*age + extraMonths;
total_months = 12*age + extra_months;
M = 12A + m
Tₕ = 24N, Tₘ = 1440N, Tₛ = 86400N, N = 7W + r (0 ≤ r ≤ 6)
T_h = 24N,\quad T_m = 1440N,\quad T_s = 86400N,\quad N = 7W + r\ \ (0 \le r \le 6)
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<msub><mi>T</mi><mi>h</mi></msub><mo>=</mo><mn>24</mn><mi>N</mi><mo>,</mo><mspace width="0.7em"/>
<msub><mi>T</mi><mi>m</mi></msub><mo>=</mo><mn>1440</mn><mi>N</mi><mo>,</mo><mspace width="0.7em"/>
<msub><mi>T</mi><mi>s</mi></msub><mo>=</mo><mn>86400</mn><mi>N</mi><mo>,</mo><mspace width="0.7em"/>
<mi>N</mi><mo>=</mo><mn>7</mn><mi>W</mi><mo>+</mo><mi>r</mi><mspace width="0.7em"/>
<mo>(</mo><mn>0</mn><mo>≤</mo><mi>r</mi><mo>≤</mo><mn>6</mn><mo>)</mo>
</mrow>
</math>
T_h = 24N, T_m = 1440N, T_s = 86400N, N = 7W + r (0 <= r <= 6)
hours = 24*days; minutes = 1440*days; seconds = 86400*days; {weeks, remDays} = QuotientRemainder[days, 7]
hours := 24*days; minutes := 1440*days; seconds := 86400*days; weeks := iquo(days, 7); remDays := irem(days, 7);
num_hours = 24*num_days; num_minutes = 1440*num_days; num_seconds = 86400*num_days; num_weeks = floor(num_days/7); rem_days = mod(num_days, 7);
T_h = 24N, T_m = 1440N, T_s = 86400N, N = 7W + r (0 ≤ r ≤ 6)
How to have ChatGPT do the calculation
You are an age calculation assistant. Do the following calculation by actually running Python code, and base your answer only on the numbers from the execution result (do not answer by mental math or guessing). The date of birth is January 15, 1990. For the date July 3, 2026, find each of the following: 1. The exact age in years, months and days (count a month as complete on the same day number in the next month; if that month has no such day, count the month as complete at the end of the month's last day) 2. The total number of days since birth (counting the birth date as day 0), and the same number written as "X weeks and Y days" 3. How many days are left until the next birthday (assume the age goes up by 1 on the birthday itself) Show the code you used and the numbers from the execution result.
How to Use
-
1Enter your numbersType the numbers you want to calculate with into the input fields
-
2CalculatePress the "Calculate" button
-
3Check the resultThe result appears on the spot. The same page also explains the idea behind the calculation and the formula
DataChef Features
No technical knowledge required.
Intuitive and user-friendly operation.
Can be used without registering personal information.
Automatic file deletion by clicking "download".
and rapid file conversion.
No attribution required.
No need to contact us for commercial use permission.
