Generate Random Date
Pick one random date or up to 1,000 between any two dates, or random birth dates for an age range. Limit the draw to weekdays, rule out repeats, sort the list, and copy it as ISO, US, day-first, Excel serial, Unix time or SQL dates.
Every allowed day is equally likely · both end dates included
Counting the Days in the Draw
Both end dates count, so 1 to 3 August is three possible dates, not two. Unticking weekdays removes those days from the pool without changing the odds for the rest: each remaining day is equally likely. For 2026:
| Allowed days | Dates in 2026 | Chance of any one date |
|---|---|---|
| All seven | 365 | 1 in 365 |
| Monday to Friday | 261 | 1 in 261 |
| Saturday and Sunday | 104 | 1 in 104 |
Because the draw is by day, longer months turn up more often. Over a whole year, each 31-day month has an 8.5% chance (31 ÷ 365) and February 7.7% (28 ÷ 365). If you need every month equally often, pick the month first and then a day within it. In a leap year, 29 February is one more day in the pool, with the same 1-in-366 chance as any other.
Worked Example: Birth Dates for Ages 18 to 65
A tester needs 20 fake customer records for a sign-up form that only accepts adults of working age, 18 to 65, checked on 13 October 2026. Which birth dates are valid?
Step 1: The youngest allowed person turns 18 today
Step 2: The oldest is 65 until the day before their 66th birthday
Step 3: Draw from that range
The "Birth dates by age" mode does these steps for you and shows each person's age in the results. Test the edges too: someone born 2008-10-14 is still 17 that day and should be rejected, as should 1960-10-13 (already 66). For people born on 29 February, the generator's age check treats 1 March as their birthday in common years. Laws on which day counts differ between countries, so test that case against your own rules.
Uniform dates give every age the same share, so 18-year-olds are as common as 50-year-olds. That's ideal for testing validation, but not realistic for a demo of real customer demographics.
Repeated Dates and the Birthday Problem
Repeats come up much sooner than most people expect. This is the birthday problem: with 23 random dates in a 365-day year, the chance that at least two match is just over 50%. Try the 23 birthdays preset a few times and watch the Repeated dates tile.
| Dates drawn | From | Chance of a repeat |
|---|---|---|
| 5 | 31 days (one month) | 28.8% |
| 10 | 31 days (one month) | 80.4% |
| 23 | 365 days (one year) | 50.7% |
| 50 | 365 days (one year) | 97.0% |
Tick No repeated dates when every date must be different, for example when scheduling one event per day. The page then shuffles the allowed dates and takes the first ones, so the result is still fair and can't run out of attempts.
Date Formats for Spreadsheets, Databases and Code
The same date, Monday 17 August 2026, in every format the generator offers:
| Format | Output | Best for |
|---|---|---|
| ISO 8601 | 2026-08-17 | Files, APIs, sorting as text; never ambiguous |
| US | 08/17/2026 | US-locale spreadsheets and forms |
| Day first | 17/08/2026 | UK, Europe, Australia, India |
| Excel serial | 46251 | Pasting into Excel without locale mix-ups |
| Unix seconds | 1786924800 | Code and databases that store epoch time |
| RFC 3339 | 2026-08-17T00:00:00Z | JSON timestamps, midnight UTC |
| SQL | DATE '2026-08-17' | INSERT statements for test data |
Excel serial numbers count days from 1 January 1900, but Excel treats 1900 as a leap year (a bug kept for Lotus 1-2-3 compatibility), so serials only line up with real dates from 1 March 1900 (serial 61). Earlier dates show "n/a". Format the pasted column as a date to see it. To convert epoch values in either direction, use the Unix time converter.
Why a Date Can Show Up a Day Early
A date on its own has no time zone, but many programs quietly add one. In JavaScript, new Date('2026-08-17') means midnight UTC, so anyone west of Greenwich who formats it in local time sees 16 August. Adding a time without a zone, new Date('2026-08-17T00:00'), means local midnight instead. The same trap exists in the Unix-seconds and RFC 3339 outputs here, which are both midnight UTC.
- Store a pure date as text in ISO form or in a
DATEcolumn, not as a timestamp. - If you must use a timestamp, read it back in UTC (for example with
timeZone: 'UTC'). - Need a random time of day as well? Use the random time generator and combine the two.
This page works in whole days, so the dates it draws are never shifted by your own time zone.
Random Dates in Excel, Google Sheets and Python
Excel and Google Sheets: any day in 2026
=RANDBETWEEN(DATE(2026,1,1), DATE(2026,12,31))Weekdays only (Monday to Friday)
=WORKDAY(DATE(2025,12,31), RANDBETWEEN(1, NETWORKDAYS(DATE(2026,1,1), DATE(2026,12,31))))Python
import random
from datetime import date, timedelta
start, end = date(2026, 1, 1), date(2026, 12, 31)
random_day = start + timedelta(days=random.randint(0, (end - start).days))The cell shows a number until you format it as a date. RANDBETWEEN recalculates every time the sheet changes, so copy the cells and paste them as values once you're happy. The WORKDAY version counts the working days in the range (261 in 2026), picks one at random, and finds it; add a holiday range to both functions to skip holidays as well.
Frequently asked questions
Can I get random weekdays only?
Yes. Untick Saturday and Sunday under Allowed weekdays, or press Mon–Fri. You can also pick a single weekday, such as every Tuesday in a term.
Is every month equally likely?
No, every day is. A 31-day month has 31 chances against February’s 28, so it comes up about 11% more often. Pick a month first if you need them evenly spread.
How do I make random birthdays for test data?
Choose Birth dates by age, enter the youngest and oldest ages, and check the Ages on date. The results include each person’s age so you can confirm your form’s age check.
Can I generate dates before 1900 or far in the future?
Yes, any date from year 1 to 9999 in the proleptic Gregorian calendar. Only the Excel serial format is unavailable before March 1900.
Sources
- RFC 3339: Date and Time on the Internet: Timestamps: the ISO 8601 profile used for full-date and timestamp output.
- MDN: Date.parse(): date-only strings are read as UTC; date-time strings without a zone as local time.
- Microsoft Learn: Excel incorrectly assumes that the year 1900 is a leap year: why serial numbers before March 1900 are off by one.
- Microsoft Support: RANDBETWEEN function: recalculates whenever the worksheet does.
- Microsoft Support: WORKDAY function: counting working days forward from a start date.
- Python documentation: random module: random.randint, which includes both end points.
Related Tools
Create GUIDs for Microsoft and .NET fields.
Generate binary numbers with a chosen bit length.
Create a random pixel image and save it as a PNG.
Generate bytes in hex, Base64, or decimal format.
Generate decimals with a chosen range and precision.
Generate fractions and see their simplified forms.