Is there a message in pi? Sagan's circle in Contact
Is there a message hidden in pi? At the end of Carl Sagan's novel Contact, a circle turns up deep in its digits. Here is what such a message would take, and what the first 10 billion digits of pi really hold.

The circle at the end of Contact
In Contact, published in 1985, the scientist Ellie Arroway ends her journey by meeting alien beings. They tell her that pi holds a hidden message, very deep in its digits. One of them guesses, as an example, that it may start somewhere around the 1020th digit. Back home, Ellie sets a computer to work through the digits of pi in different bases. In base 11 it finds a long stretch made only of 0s and 1s. Laid out as a square, line after line, the 1s draw a perfect circle.
The ending is retold in detail by MathFiction and in the paper Sagan Numbers by J. Ricardo G. Mendonça.
Why a circle in pi would mean something
In 2015 a reader on Mathematics Stack Exchange asked whether Sagan was playing a trick: if pi never ends and never repeats, every pattern must be in it somewhere, so finding one proves nothing. The answers made two points.
First, never ending and never repeating is not enough. Pi contains every pattern only if it is a normal number, and nobody has proved that it is (more in does pi contain every number). Second, and this is the real point of the story, what would matter is not that the circle is there, but how early it is.
How early is too early
The retellings give no exact size for the circle, so take a small one: 10 rows of 10. That needs 100 digits in a row that are all 0 or 1. In base 10 a digit is a 0 or a 1 one time in five, and 100 such digits in a row turn up by chance about once in every 1070 digits. In base 11, where a digit is a 0 or a 1 two times in eleven, it takes about 1074.
So a picture near the 1020th digit would be no accident: chance would put even a small one about 1054 times further out. That is why the circle in Contact reads as a signature.
The longest stretch of 0s and 1s in 10 billion digits
We cannot search pi in base 11 here, but we can test the base 10 version of the idea on real digits. We looked through the first 10,000,000,000 digits of pi for the longest stretch made only of 0s and 1s. It is 14 digits long, and there are three of them:
| Digits | Position |
|---|---|
| 00011100000110 | 4,709,126,226 |
| 00010001000011 | 7,273,009,551 |
| 00011001000101 | 9,236,066,476 |
That is about what chance predicts: in 10 billion random digits, the longest such stretch is usually around 14 digits. Fourteen digits would not fill four rows of four, let alone draw a circle.

Words that turn up by chance
Read two digits to a letter, the digits of pi spell all kinds of words. Each letter has three or four spellings among the 100 pairs of digits (see how to search pi), so a word of n letters turns up roughly once in every 25n places. In the first 10 billion digits:
| Word | First position | Times | Chance predicts |
|---|---|---|---|
| sagan | 17,593,774 | 979 | 1,024 |
| circle | 254,513,499 | 40 | 41 |
| contact | 2,250,024,766 | 1 | 1.6 |
| message | 3,013,753,811 | 3 | 1.6 |
So the word message is in pi, three times. That is not a message. It is what 10 billion random digits hold. A real one would have to be much longer, or come much earlier, than chance allows.
So is there a message in pi?
Nothing in the first 10 billion digits looks like one. They behave like random digits, and every pattern found in them can be put down to chance, even the six 9s in a row at position 762, the Feynman point, which comes early but not impossibly early. Sagan's circle is a story, and a clever one: the sign would not be the circle itself, but where it is. Try your own message:
Frequently asked questions
Is there a hidden message in pi?
None has been found. The first 10 billion digits behave like random digits: the longest stretch of only 0s and 1s is 14 digits, about what chance predicts and far too short to draw a picture.
What is the circle in pi in Contact?
At the end of Carl Sagan's novel Contact, Ellie Arroway finds a long stretch of 0s and 1s in the digits of pi written in base 11. Laid out as a square, the 1s draw a circle.
Is the circle in pi from Contact real?
No, it is fiction. By chance, even a small picture made of 0s and 1s would need about 10 to the power of 70 digits, far more than anyone has computed.
Is the word message in pi?
Yes. Reading each pair of digits as a letter, message appears 3 times in the first 10 billion digits of pi, first at position 3,013,753,811. Chance predicts about 1.6 times.