How does the random date generator pick a date?
The generator counts every day from January 1 of the start year to December 31 of the end year, picks one of those days at random, and writes it as YYYY-MM-DD. Because it chooses a day rather than a month, every date in the range has exactly the same chance, and the result is always a real calendar date, with February 29 appearing only in leap years. You can ask for up to 50 dates per click.
Generating dates
- Type a Start year and End year, each a whole number from 1 to 9999. The defaults are 2000 and 2030.
- Set the Dates slider (1 to 50).
- Click Generate and copy the list.
With a start year of 2030 and an end year of 2024, one run gave:
2027-08-16
2030-11-16
2027-05-25
The years were entered backwards on purpose: the tool swaps them, so you don't have to.
How the year fields are read
| You enter | What the generator does |
|---|---|
| 1990 and 2005 | Uses 1990 through 2005, 16 years in all |
| 2030 and 2024 | Swaps them to 2024 through 2030 |
| The same year twice | Only dates within that year |
A year below 1000, such as 5 |
Works, printed zero-padded as 0005-03-03 |
Blank, 0, -5, 1.5 or text like abc |
Shows an error and generates nothing |
| A year above 9999 | Shows an error and generates nothing |
Rejecting bad years matters most for typos. If you type 20O0 with a letter O, you get "Start year must be a whole number from 1 to 9999." rather than a list of dates from a range you didn't ask for.
Every day has the same chance
Some date generators pick a year, then a month, then a day. That gives every month one twelfth of the results whatever its length, so a day in February comes up about 11% more often than a day in a 31-day month. This generator avoids that by drawing a single day number across the whole range.
For a single-year range such as 2026 to 2026, each specific day has a 1 in 365 chance. For 2024 to 2030, which spans 2,557 days including the leap days of 2024 and 2028, each day has a 1 in 2,557 chance, and the two leap years each get 366 shares rather than 365.
That makes the output suitable both for filling a birthday column or a booking form and for sampling days for an audit or survey, where every day should have the same chance of being chosen.
About the format
2027-05-25 is the calendar date format from ISO 8601, and the full-date production in RFC 3339, which requires exactly four year digits. It's the safest format to hand to another program: databases, spreadsheets and JavaScript's Date constructor all read it without guessing whether 03/04 means March or April. Because every year is padded to four digits, the output also sorts correctly as plain text.
Dates before 1582, when the Gregorian calendar was introduced, are computed on the proleptic Gregorian calendar, the same model ECMAScript uses for all time values. So a "random date in 1066" follows today's leap-year rules, not the Julian calendar a historian would use.
Putting the dates to work
- Test users. Generate birthdates over a range like 1950 to 2008, then confirm your form's age check with the age calculator.
- Timestamps. Combine a date with a value from the random time generator to get
2027-05-25T21:22:43. - Epoch values. If your system stores Unix time, convert a date with the epoch converter.
Randomness comes from the browser's crypto.getRandomValues(), and nothing you enter leaves the page.
Last updated