Calculate age from date of birth online
This Date to Age Calculator lets you create a new age variable from an existing date-of-birth field in a CSV or Excel dataset. The original date-of-birth variable is preserved and the calculated age is appended as the last column.
You can calculate age as of today or use another reference date, such as an interview date, survey date, enrollment date or reporting date.
How to create an age variable from date of birth
- Upload a CSV, XLSX or XLS file, or paste CSV data.
- Select the worksheet if you are using an Excel workbook.
- Click Load Variables.
- Select the date-of-birth variable.
- Enter a name for the new age variable.
- Select the date on which age should be calculated.
- Click Calculate Age Variable.
- Download the resulting CSV or Excel dataset.
How age is calculated
Age is calculated in completed years. The tool subtracts the year of birth from the reference year and then checks whether the person's birthday has already occurred by the reference date.
For example, someone born on 15 April 2000 is 25 years old on 14 April 2026 and turns 26 on 15 April 2026.
Example: date of birth to age
name,date_of_birth Ali,2000-04-15 Sara,1995-11-02
If the selected reference date is 10 September 2026, the tool appends a new age column:
name,date_of_birth,age Ali,2000-04-15,26 Sara,1995-11-02,30
Calculate age as of a survey or interview date
Age does not always need to be calculated as of today. In survey research, demographic analysis and monitoring systems, you may need age as of a specific interview, enrollment or reporting date.
Enter that date as the reference date and the age variable will be calculated consistently for the entire dataset.
Create age groups after calculating age
After creating the age variable, you can use the Custom Group Generator to recode ages into categories such as 0–17, 18–34, 35–59 and 60 or above.
Supported date formats
For CSV files, the recommended date format is YYYY-MM-DD, such as 2000-04-15. The tool also accepts day/month/year values such as 15/04/2000.
Native Excel date cells are also supported when reading XLSX and XLS workbooks.
Original date of birth is preserved
The original date-of-birth variable is not overwritten. A new age variable is appended to the end of the dataset, allowing you to keep both the original date and calculated age.
Frequently asked questions
Can I calculate age from date of birth online?
Yes. Upload your CSV or Excel dataset, select the date-of-birth variable and reference date, and the tool creates a new age variable.
Can I calculate age as of a specific date?
Yes. You can choose any reference date instead of using today's date.
Does the tool calculate completed years?
Yes. Age is calculated in completed years based on whether the person's birthday has occurred by the selected reference date.
Can I calculate age in an Excel file?
Yes. XLSX and XLS files are supported in addition to CSV.
Does this replace my date-of-birth variable?
No. The original date-of-birth field remains unchanged and the new age variable is appended as the last column.
What happens to blank or invalid dates?
The age value is left blank and the record is counted as invalid or missing.
Can I create age groups after calculating age?
Yes. You can download the result and use the Custom Group Generator to recode the calculated age variable into your own age groups.
Is my data uploaded to a server?
No. CSV and Excel processing takes place locally in your browser.