
Age Calculator API
Find your exact age in years, months and days from your date of birth, plus total weeks, days and hours, the day you were born and a countdown to your next birthday.
Send your API key as a Bearer token in the Authorization header (Authorization: Bearer YOUR_API_KEY), or in an X-API-Key header.
120 requests per minute
2 endpoints available
Overview
Works out exact age in years, months and days from a date of birth, plus total months, weeks, days and hours, the weekday of birth, the next birthday and the next 1,000-day milestone.
Dates and time zones
- Dates are plain calendar dates written
YYYY-MM-DD(years 0001 to 9999). They have no time zone, so a date never shifts. - If you leave out
asOf, the age is measured to today's date in UTC on the server. The date that was used comes back asasOf. SendasOfyourself for results that do not change from day to day. - Month-end dates are clamped: one month after January 31 is the last day of February.
- People born on February 29 can have their common-year birthday counted on February 28 (
feb28, the default) or March 1 (mar1). totalHoursis whole days times 24, counted from midnight. It does not use a time of birth.
Response
age (years, months, days), totalMonths, totalWeeks, weekRemainderDays, totalDays, totalHours, bornOnWeekday, nextBirthday (date, weekday, turning, daysUntil, isToday, countdown) and nextMilestone (daysOld, date, daysUntil). All numbers are numbers. A date after 9999-12-31 comes back as null.
Endpoints
https://opentools.ca/api/v1/tools/age-calculatorRequest Body
Content-Type: application/json
| Parameter | Type | Required | Description |
|---|---|---|---|
| birthDate | string | Required | Date of birth, YYYY-MM-DD. |
| asOf | string | Optional | Date to measure the age on, YYYY-MM-DD. Must not be before birthDate. Defaults to today's date in UTC on the server.Default: today (UTC) |
| leapDayRule | string Enum: feb28, mar1 | Optional | For a February 29 birthday: count it on February 28 or March 1 in years with no February 29.Default: feb28 |
Response Example
{
"success": true,
"birthDate": "1990-05-17",
"asOf": "2026-11-25",
"leapDayRule": "feb28",
"age": {
"years": 36,
"months": 6,
"days": 8
},
"totalMonths": 438,
"totalWeeks": 1905,
"weekRemainderDays": 6,
"totalDays": 13341,
"totalHours": 320184,
"bornOnWeekday": "Thursday",
"nextBirthday": {
"date": "2027-05-17",
"weekday": "Monday",
"turning": 37,
"daysUntil": 173,
"isToday": false,
"countdown": {
"years": 0,
"months": 5,
"days": 22
}
},
"nextMilestone": {
"daysOld": 14000,
"date": "2028-09-14",
"daysUntil": 659
}
}Error Codes
https://opentools.ca/api/v1/tools/age-calculatorQuery Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| birthDate | string | Required | Date of birth, YYYY-MM-DD. |
| asOf | string | Optional | Date to measure the age on, YYYY-MM-DD. Must not be before birthDate. Defaults to today's date in UTC on the server.Default: today (UTC) |
| leapDayRule | string Enum: feb28, mar1 | Optional | For a February 29 birthday: count it on February 28 or March 1 in years with no February 29.Default: feb28 |
Response Example
{
"success": true,
"birthDate": "1990-05-17",
"asOf": "2026-11-25",
"leapDayRule": "feb28",
"age": {
"years": 36,
"months": 6,
"days": 8
},
"totalMonths": 438,
"totalWeeks": 1905,
"weekRemainderDays": 6,
"totalDays": 13341,
"totalHours": 320184,
"bornOnWeekday": "Thursday",
"nextBirthday": {
"date": "2027-05-17",
"weekday": "Monday",
"turning": 37,
"daysUntil": 173,
"isToday": false,
"countdown": {
"years": 0,
"months": 5,
"days": 22
}
},
"nextMilestone": {
"daysOld": 14000,
"date": "2028-09-14",
"daysUntil": 659
}
}Error Codes
Code Examples
# Age on a given date
curl -X POST https://opentools.ca/api/v1/tools/age-calculator \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"birthDate": "1990-05-17",
"asOf": "2026-11-25"
}'
# Leap day birthday counted on March 1
curl -X POST https://opentools.ca/api/v1/tools/age-calculator \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"birthDate": "2000-02-29",
"asOf": "2026-02-28",
"leapDayRule": "mar1"
}'
# The same request as a GET with query parameters
curl "https://opentools.ca/api/v1/tools/age-calculator?birthDate=1990-05-17&asOf=2026-11-25" \
-H "Authorization: Bearer YOUR_API_KEY"Rather use it in your browser? Open the Age Calculator