cipher.ink Write a message

Primes ยท Prime numbers

Is my birthday prime?

Your date as a number in seven formats, which of them are prime, the next prime date, and a year of prime days.

The date you pick stays in this page. Nothing is sent or saved.

Pick a date and this tool writes it as a number in the common ways people write dates, then tells you which of them are prime. It also finds the next prime date and the previous one, and counts the prime days in the year. There are 24 prime days in 2026 if you write dates as year, month, day (YYYYMMDD), and October 23 is one of them: 20261023 is prime. Try your birthday.

What the numbers are

A date turns into a number once you decide how to write it. Writing October 23, 2026 as 20261023 gives a number that's prime or not for reasons that have nothing to do with the calendar, and that's the fun: nothing about October or the 23rd makes it so. The tool tries seven readings: YYYYMMDD, MMDDYYYY (the US order), DDMMYYYY (the order used in most of the world), two six-digit forms with a two-digit year, the day of the year (1 to 366), and the number of days since January 1, 1970, which is how Unix systems count time. The check is exact. It uses trial division, which is plenty for numbers under a billion. For bigger numbers, see the primality checker.

Why the format matters so much

The last digit of a number decides a lot. A prime above 5 can't end in 0, 2, 4, 5, 6 or 8, so only numbers ending in 1, 3, 7 or 9 have a chance. In YYYYMMDD form the last digit is the last digit of the day, so only days like the 1st, 3rd, 7th, 9th, 11th, 13th, 17th, 19th, 21st, 23rd, 27th, 29th and 31st can be prime dates, and a month has at most 13 of them. The result is a calendar with about 6% of days prime: 24 of 365 in 2026, 22 in 2025, 21 of 366 in 2024, 29 of 366 in 2028 (scripts/examples/birthday-name-examples.mjs counts every year you try).

In the American MMDDYYYY form or the European DDMMYYYY form, the number ends with the year, so the last digit is the same for every day of the year. For a year ending in 0, 2, 4, 5, 6 or 8, there isn't a single prime date: all 365 days of 2026 fail in both formats. For a year ending in 1, 3, 7 or 9 the odds are much better, and 2027 has 54 prime days in MMDDYYYY and 41 in DDMMYYYY. If you were born in a year ending in an even digit, your birthday is never prime in those two orders, whatever your birth month. That's arithmetic, not luck.

The day of the year

Counting from January 1 as day 1, there are 72 primes among the 365 days of an ordinary year (and still 72 in a leap year, since 366 isn't prime). They run from day 2 (January 2) to day 359 (December 25 is day 359 in an ordinary year, and 359 is prime). The sieve finds all 72 in a moment. The primes thin out as the year goes on, the way they do on the number line: the first ten weeks of the year contain 19 of them, the last ten weeks only 10. Why primes thin out is the subject of the Riemann hypothesis page.

Is it meaningful?

No, and it's worth saying plainly. A prime birthday isn't rare, lucky or special, and it won't tell you anything about a person. The pleasure is in noticing how many apparent coincidences come from one simple fact: whether a number is prime depends only on its digits, and the digits depend on how you chose to write the date. Choose a different notation and the answer changes, which is what you'd expect from something that was never about the date at all. The name-to-prime page does the same thing with words.

Common questions

Which format is the usual one for "prime date"?

There's no standard. YYYYMMDD is the form used in the ISO 8601 standard (as 2026-10-23, without the hyphens), so it's the one this page puts first, and it's the only one in which prime dates are common every year.

What is the next prime date after today?

The tool shows it for any date you pick: choose Today and read the line under the table. It also gives the number of days to wait and the previous prime date.

Do leap days matter?

Only as one more date. February 29 gives a number ending in 9 in YYYYMMDD form, so it has a chance of being prime, and in a leap year its day of the year, 60, isn't.

Is the prime-day count the same every year?

No. It varies between about 19 and 29 in the years checked here (2000 had 27, 2027 has 19) because the year's digits change what survives the small-prime tests. The average over many years is about 1 in 17, the density of primes near 20 million.

Further reading

  1. ISO 8601: date and time format (summary)
  2. OEIS A000040: the prime numbers
  3. Wikipedia: Prime number theorem