# Age Calculator

- **URL:** https://codeasystem.com/calculators/dates/age-calculator/
- **Category:** dates
- **Description:** Work out an exact age in years, months and days from a date of birth, plus total days and weeks lived, using precise calendar arithmetic.
- **Primary output:** Exact age: 36 years, 2 months, 8 days

## Inputs
- Date of birth (name: `dob`, type: date, example: 1990-06-15)
- As-of date (optional) (name: `asOf`, type: date, example: 2026-08-23)

## Outputs
- Exact age: 36 years, 2 months, 8 days
- Total days lived: 13,218
- Total weeks lived: 1,888 weeks (2 days)
- Measured as of: 2026-08-23

## Formula / methodology
```
Age = full calendar years between dates, plus leftover whole months, plus leftover days
Total days = (as-of − birth) ÷ 86,400,000 s
```

We count complete calendar years first, then complete months within the remaining period, then leftover days; exactly how people describe ages in everyday speech. Leap-year February 29 birthdays are handled by real calendar month lengths rather than a fixed 365.25-day year.

All arithmetic happens on UTC midnight timestamps built from the yyyy-mm-dd strings you enter, so no timezone or daylight-saving rule can shift a result by a day.

## Assumptions & limitations
- Dates are treated as pure calendar dates with no timezone shifting.
- A Feb 29 birthday reaches its yearly mark on Mar 1 in non-leap years for anniversary counting.
- The as-of date defaults to today when left blank.

## How to use
1. **Enter the date of birth**; Use the YYYY-MM-DD format provided by the date picker.
2. **Optionally set an as-of date**; Leave it blank to use today, or pick any date to answer “how old was/will they be on…?”.
3. **Read the breakdown**; The headline gives exact years/months/days; the rows show total days and weeks lived.

## Example
Someone born on 1990-06-15 was 36 years, 2 months and 8 days old as of 2026-08-23.

Result for these inputs:

```
Exact age: 36 years, 2 months, 8 days
```

## About this calculator
### Why ages are trickier than they look

Months have 28–31 days and years occasionally gain a day, so “divide the day difference by 365.25” drifts within a few years. Calendar-aware counting; borrowing days from the actual previous month when the day-of-month falls short; matches legal and cultural conventions everywhere.

### Leap-day birthdays

People born on February 29 legally age on March 1 in most jurisdictions during common years. This calculator follows that convention: on 2023-02-28 someone born 2000-02-29 is still 22, turning 23 only after Feb 29 exists again in leap years like 2024.

### Determinism first

Because every computation is anchored to UTC midnight of the entered calendar dates, the same input always yields the same output; on your laptop, on a server, or inside an automated test.

## FAQs
### How does the leap-year birthday work?

Anniversaries follow real calendar months, so a Feb 29 birthday reaches its yearly mark on Mar 1 in non-leap years; the day-by-day breakdown stays exact either way.

### Does my timezone change the result?

No. Dates are interpreted as calendar dates at UTC midnight, deliberately ignoring timezone offsets so results are reproducible everywhere.

### Can I calculate an age at a past or future date?

Yes; fill in the optional as-of date. Future as-of dates give the age the person will have reached on that day.

### Why do total days differ from the years/months/days line?

They measure different things: total days is the raw elapsed count, while the breakdown follows calendar borrowing rules where partial months contribute irregular day counts.

## Related calculators
- [Days Between Dates Calculator](https://codeasystem.com/calculators/dates/days-between-dates-calculator/)
- [Working Days Calculator](https://codeasystem.com/calculators/dates/working-days-calculator/)
- [Time Unit Converter](https://codeasystem.com/calculators/conversion/time-unit-converter/)

---
Last updated: 2026-08-23 · Version: 1.0.0 · [HTML version](https://codeasystem.com/calculators/dates/age-calculator/)
