Age Calculator Widget
Add an age calculator to your website. Visitors enter a date of birth and get their exact age on any date, the same age in months, weeks and days, the weekday they were born and a countdown to their next birthday.
Live preview
Exactly what your visitors will seeUnder the widget on your page: Powered by A2Z Tools
Embed code
<iframe src="https://a2z.tools/embed/w/age-calculator" title="Age Calculator by A2Z Tools" width="100%" height="470" style="border:0;width:100%" loading="lazy" allow="clipboard-write"></iframe>
A plain iframe. Works everywhere, including site builders that strip scripts. Adjust height if your content needs more room.
<div data-a2z-widget="age-calculator" data-height="470"></div> <script async src="https://a2z.tools/embed.js"></script>
Adds a small script (what it does) that sizes the widget to fit its content, loads it lazily and keeps it isolated from your page's CSS.
Works with
How it works
The widget follows the same conventions as the A2Z Age Calculator. It counts whole months from the birth date to the chosen date and then the days left over, so 15 May 1990 to 1 October 2026 is 36 years, 4 months and 16 days. Dates are handled as plain calendar days rather than clock times, so the visitor's time zone and daylight saving can never move the answer by a day. For someone born on 29 February the birthday in a common year is taken as 1 March, and when a birth day does not exist in a month (the 31st in a 30-day month) that month's anniversary also falls on the 1st of the next month. Each date is turned into a serial day number with Howard Hinnant's days-from-civil algorithm, so leap years follow the full Gregorian rule (2000 was a leap year, 1900 and 2100 are not) and the day count between any two dates is an exact subtraction. The same numbers give the weekday of birth, the age expressed only in months, only in weeks or only in days, and the next birthday with how many days remain. The "Age on" date can be any day, past or future, which is what admission and recruitment rules need: a child born on 2 August 2020 is still 5 years, 11 months and 30 days old on a 1 August 2026 cut-off, one day short of six.
Calculation method
- Whole months = (Y2 - Y1) x 12 + (M2 - M1), minus 1 if D2 < D1
- Remaining days = as-of date - the last monthly anniversary (a missing day of month rolls to the 1st of the next month)
- Years = floor(whole months / 12); months = whole months mod 12
- Total days = difference of the two calendar-day numbers (proleptic Gregorian calendar); weeks = floor(days / 7)
- Next birthday = the birthday on or after the as-of date; 29 February becomes 1 March in common years
Worked examples
An adult's exact age
Inputs: Date of birth 1990-05-15, age on 2026-10-01
Result: 36 years, 4 months, 16 days; 436 months and 16 days; 1,898 weeks and 2 days; 13,288 days; born on a Tuesday; next birthday Sat 15 May 2027, in 226 days, turns 37
436 whole months end on 15 September 2026, and 16 days remain to 1 October.
A 29 February birthday
Inputs: Date of birth 2004-02-29, age on 2026-10-01
Result: 22 years, 7 months, 2 days; 8,250 days; born on a Sunday; next birthday Mon 1 Mar 2027, turns 23
2027 is a common year, so the birthday is counted on 1 March and the widget adds a note saying so.
A school admission cut-off
Inputs: Date of birth 2020-08-02, age on 2026-08-01
Result: 5 years, 11 months, 30 days; next birthday Sun 2 Aug 2026, in 1 day, turns 6
A rule such as "six years old on 1 August" is not met: the child turns six one day after the cut-off.
Limitations
- Gregorian dates only; Hijri, Vikram Samvat, Hebrew and other calendars are not converted.
- The time of birth is not used, so the age changes at midnight rather than at the hour of birth.
- Laws differ on 29 February birthdays - some treat 28 February as the birthday in common years; this widget always uses 1 March.
- East Asian age reckoning (counting one year at birth) is not supported.
- Old dates are read in the Gregorian calendar even where it was not yet in use (Britain switched from the Julian calendar in 1752, Russia in 1918), so a historical birth date recorded Old Style must be converted first.
- Years before 0001 are refused.
Where publishers use it
- School admission pages that check a child's age on the cut-off date
- Government-job and exam portals where candidates confirm age limits on a given date
- Parenting and baby blogs showing age in months and weeks
- Birthday party and greeting sites with a next-birthday countdown
Questions
Why can two age calculators disagree by a day?
They differ in whether the end date counts and in how they handle month ends - for example, whether one month after 31 January is 28 February or 3 March. This widget counts whole months on matching day numbers and rolls a missing day to the first of the next month.
Can I calculate age on a specific date, not today?
Yes. Change "Age on" to any date, such as an exam's age cut-off date. Publishers can preset it with v_asof=2026-08-01.
How are 29 February birthdays handled?
In common years the birthday is counted on 1 March, the same convention as the full A2Z Age Calculator, and the widget notes it.
Why is 31 January to 1 March one month and not one month and one day?
February has no 31st, so the one-month anniversary of 31 January is taken as 1 March. Other calculators sometimes use 28 February instead, which can give one extra day.
Is my date of birth stored?
No. The calculation happens in your browser and nothing you type is sent anywhere.
Why does another site give me one day more in total days?
Some calculators count both the birth date and today, which adds one. This widget counts elapsed days, like a stopwatch: someone born yesterday is 1 day old, not 2.
Sources
- ISO 8601 date and time format - ISO . Gregorian calendar dates written YYYY-MM-DD, including the proleptic calendar before 1582
- chrono-Compatible Low-Level Date Algorithms (days_from_civil, civil_from_days) - Howard Hinnant . Serial day numbers and weekdays for the proleptic Gregorian calendar
Cite or recommend this tool
If you reference this tool in an article, course or documentation, these formats are ready to copy. They are optional - nothing is added to your site unless you paste it.
A2Z Tools Age Calculator https://a2z.tools/age-calculator
<a href="https://a2z.tools/age-calculator">A2Z Tools Age Calculator</a>
[A2Z Tools Age Calculator](https://a2z.tools/age-calculator)
Age Calculator by A2Z Tools - https://a2z.tools/age-calculator
Related widgets
-
Years, months and days between two dates or date-times, plus totals in days, weeks and hours.
-
Live days, hours, minutes and seconds to a date you set, with an "event has started" message.
-
A keyboard-friendly month calendar with today highlighted and your own marked dates.
-
Count working days between dates or add N business days, with your weekend and holidays.
-
Convert a date and time between any two time zones, with daylight-saving gaps and overlaps explained.
-
A large live digital clock for any time zone, with seconds, date and a 12/24-hour switch.