My friend and I were curious and we can now do the party trick of figuring out what day of the week a birthday falls on.
For the impatient, here’s the formula :
Where d is the day, y is the last 2 digits of your birth year (throw away any remainder of the division) and mlookup is a lookup table :
And the result is 0 = Sunday, 1 = Monday, etc
I was watching a show about Daniel Tammet, an autistic savant, and telling my friend Dave about it. One of the things that the media often focus on is how these savants can calculate the day you were born on.
I’ve always suspected that it can’t be that hard to do - there must be some formula for it - and I said so to Dave.
So we got curious and went to find the formula. Sure enough we found one.
At first it looked a bit long-winded. But after a bit of wrangling, we got it down to it’s bare essence with a couple of shortcuts (ie lookup tables in programmer-speak). Now we can do the calculations in our head. It’s still a bit of mental effort but nothing too onerous with a bit of practise.
We got the original formula from here :
http://www.tondering.dk/claus/cal/node3.html#SECTION00360000000000000000
And you can check your answers here :
http://homepages.rootsweb.com/~sdavnprt/bday.htm
Here is an example - 18th December 1977 gives
(18 + 2 + (10 * 76)/8 + 10 ) mod 7
A quick way of dividing by 8 is to divide in half 3 times, so 770/8 = 385/4 = 192/2 = 96.
18 + 2 + 96 + 10 = 126.
126 mod 7 = 0
So 18th December 1977 was a Sunday!
PS I’m in no way down-playing the abilities of savants - I think they’re amazing! Remembering this simple formula is one thing, doing calculations out to hundreds of decimal places or remembering what the weather was like on a specific date is quite another!
PPS The shortcuts we took only work for birthdays after 1900.


September 11th, 2007 at 9:52 am
what does mod 7 mean
September 11th, 2007 at 9:03 pm
Hi sara, mod 7 means divide the number by 7 and take the remainder. So for example, 36 mod 7 = 1. That’s because 7 goes in to 36 five times with 1 left over. ie 36 = 5×7 + 1. Another example is 14 mod 7 = 0, because 7 goes into 14 exactly twice with nothing left over.
April 29th, 2008 at 6:05 am
it doesnt work for today… 28, april 2008
May 30th, 2008 at 6:37 pm
It looks like this formula will work for dates after 1999, but you can’t just take the last 2 digits, you must subtract 1900 from the year. So for 2001, your y value would not be 1, it would be 101. Nice post
July 8th, 2008 at 9:42 pm
I can’t get this to work for 17/04/1977
October 4th, 2008 at 2:54 am
This is hit and miss, works for some dates, not for others.
December 18th, 2008 at 8:44 pm
doesnt work for my birthay, it was a friday and according to this, it was a thursday
December 18th, 2008 at 9:54 pm
Hi lorena, what date is your birthday?
December 18th, 2008 at 10:05 pm
Hi Carol - for 17/4/1977, we put into the formula
17 + 2 + (77 * 10)/8 - 10 (april lookup)
770/8 = 96.25 = 96 (throw away remainder)
17 + 2 + 96 - 10 = 105
105 mod 7 = 0
0 = sunday which is correct :
See http://en.wikipedia.org/wiki/1977
Wow - that was when the Apple II was introduced!
http://www.applematters.com/article/april-17-1977-apple-ii-introduced/
January 13th, 2009 at 6:05 am
It only appears to work for years that are odd (like 77). If you calculate using an even year, like 78, then it skips every-other day (ie: Sun, Tue, Thu, Sat).
Anyone else seen this? I set it up in the computer to perform the calculations so I could just keep typing in the day, month and year. Works fine for odd years.
January 28th, 2009 at 10:29 am
how can I use this formula for:2007..2oo6..2oo8..oo9
May 1st, 2009 at 11:37 pm
Single digit days do not work with this formula….for example:
Feb, 3 1988 Formula is as follows:
3 + 2 + (88 * 10)/8 + 16 (feb lookup)
880/8 = 110
3 + 2 + 110 + 16 = 131
131 mod 7 = 5
5 = friday which is wrong I was born on wednesday to confirm I looked it up on computer calender.
This formula only works for double digit dates.
July 2nd, 2009 at 2:03 pm
Doesn’t work for me either, Jan 12 1978.
12 + 2 + (10 * 78)/8 + 13
14 + 780/8 + 13
14 + 97 + 13 = 124
124 mod 7 = 5
5 = Friday
I was born on a Thursday.
I suspect your Day numbers are off, the calculator page you link to has 0=Saturday, 1=Sunday, etc. In that case it works.
July 28th, 2009 at 8:05 am
“Here is an example - 18th December 1977 gives
(18 + 2 + (10 * 76)/8 + 10 ) mod 7″
shouldn’t it be
77 instead of 76? or am I missing something
December 28th, 2009 at 12:00 pm
this doesn’t work
I was born on 19 Jan 1988 and it says I was born on a Sunday. I was born on a Tuesday.
January 27th, 2010 at 8:28 pm
Note that January and February in there are attached to the previous year.
My formula for months is simpler to remember and you subtract:
for the 3rd, 5th and 7th month of the year it is the number of the month (negative), so -3 for March, -5 for May and -7 for July.
For the even numbered months from June onwards it is the number of the month + 10.
April is the same as July, September is the same as December and November the same as March.
In a leap year January is the same as July (and April) and February is the same as August. Otherwise January equates with October and February with March (and November)
Easier year formula is to divide the number of the year by 4 and add that to the year itself (subtracted from 1900). You can round it down to the nearest 28 to make it easier (so 1977 is 21 years on from 1956 and the current year 2010 is 26 years on from 1984. 2012 will be the next “base” year.
Using all this Saturday is 0, Sunday is 1 etc.
17 April 1977 is:
17 for the date
-7 for the month
21 + 5 for the year.
adds to 36 = 1 mod 7, thus Sunday.