Skip to content

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

Allowed weekdays

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:

Number of possible dates in 2026 by weekday setting
Allowed daysDates in 2026Chance of any one date
All seven3651 in 365
Monday to Friday2611 in 261
Saturday and Sunday1041 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

Latest birth date = 13 Oct 2026 − 18 years = 2008-10-13

Step 2: The oldest is 65 until the day before their 66th birthday

Earliest birth date = 13 Oct 2026 − 66 years + 1 day = 1960-10-14

Step 3: Draw from that range

1960-10-14 to 2008-10-13 = 17,532 possible birth dates

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.

Chance that a set of random dates contains at least one repeat
Dates drawnFromChance of a repeat
531 days (one month)28.8%
1031 days (one month)80.4%
23365 days (one year)50.7%
50365 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:

Monday 17 August 2026 in each output format
FormatOutputBest for
ISO 86012026-08-17Files, APIs, sorting as text; never ambiguous
US08/17/2026US-locale spreadsheets and forms
Day first17/08/2026UK, Europe, Australia, India
Excel serial46251Pasting into Excel without locale mix-ups
Unix seconds1786924800Code and databases that store epoch time
RFC 33392026-08-17T00:00:00ZJSON timestamps, midnight UTC
SQLDATE '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 DATE column, 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