Leibniz and the I Ching: How Binary Met the Hexagrams

In April 1703 a letter that had taken seventeen months to travel from Beijing reached Gottfried Wilhelm Leibniz. Inside was a woodcut of the sixty-four hexagrams of the I Ching arranged in a square and a circle, and a note from a Jesuit mathematician pointing out that the arrangement ran in exactly the same order as the numbers Leibniz had been writing with nothing but 0 and 1. It is one of the most retold episodes in the history of mathematics, and one of the most garbled. This page sets out what happened, in the order it happened, with the dates and sources, so the Leibniz and I Ching connection can be read for what it really was: a remarkable match between two systems invented for different reasons, five centuries and half a world apart.

Two symbols, long before the diagram

Leibniz did not need China to think of binary. He had the idea by December 1676 at the latest, and on 15 March 1679 he dated a Latin manuscript, De progressione dyadica, in which every number is written with two symbols: 0 and 1. Two is 10, three is 11, four is 100, and so on, each place worth twice the place to its right. He worked out how to add and multiply in this notation and noticed how simple the rules became, since a multiplication table with only two digits has almost nothing in it. He even imagined a calculating machine that would work with two states instead of ten.

He was not quite the first. The English mathematician Thomas Harriot had written numbers in base two in private papers in the early 1600s, and the Spanish bishop Juan Caramuel printed a two-symbol counting table in 1670. What sets Leibniz apart is that he treated binary as a complete arithmetic and, in the end, published it as one. But for more than twenty years he kept it in his papers, waiting for a reason to bring it out.

One and nothing: why binary mattered to Leibniz

For Leibniz binary was never only a calculating trick. He read it theologically. If every number can be built from 1 and 0, then every number is an image of creation: God, the one, drawing all things out of nothing. In a letter of January 1697 to Duke Rudolph August of Brunswick he proposed a medal showing the binary numbers under a Latin motto saying that one is enough to draw everything out of nothing. The medal was apparently never struck, but the idea stayed with him.

In the same year he published Novissima Sinica, a collection of reports from the Jesuit missionaries in China with his own preface. Leibniz admired what he knew of Chinese civilisation and believed that Europe and China, as the two great centres of learning at either end of the world, should exchange knowledge as freely as goods. He hoped, too, that a demonstration as elegant as binary creation might interest the Kangxi Emperor, who studied mathematics with the Jesuits, and so help their mission. The China correspondence and the binary manuscript were about to meet.

Joachim Bouvet and the diagram from Beijing

Joachim Bouvet was a French Jesuit who had gone to China in the 1680s as one of the mathematicians sent by Louis XIV, and who taught at the Kangxi Emperor’s court. He belonged to a small group later called the Figurists, who believed that the oldest Chinese texts, and above all the figures of the Yijing, preserved fragments of an ancient revelation shared with the Bible. From 1698 he wrote to Leibniz about the hexagrams as a system waiting to be decoded.

In February 1701 Leibniz sent him a full account of binary arithmetic, with the theology attached. Bouvet’s reply, dated 4 November 1701, enclosed a woodcut of the Earlier Heaven arrangement of the hexagrams and pointed out what he had seen: read each solid line as 1 and each broken line as 0, and the sixty-four figures run in the same order as Leibniz’s numbers from 0 to 63. The letter went by way of England and did not reach Leibniz until 1 April 1703. By then his own account of binary was more than twenty years old.

What the Earlier Heaven order is

The diagram Bouvet sent was not the order in which the hexagrams appear in the book. The received text follows the King Wen sequence, which pairs figures by inversion and follows no simple arithmetic pattern. The Earlier Heaven order is a later arrangement, traditionally credited to the legendary sage Fu Xi but known to us through the Song dynasty philosopher Shao Yong, who lived from 1011 to 1077. Shao Yong built it by repeated doubling: one line can be solid or broken, two lines give four combinations, three give the eight trigrams, and six give sixty-four. Each step doubles the last, and because the figures are listed the same way at every step, the result is an ordering that matches counting in base two.

The table below shows how it works. Write each hexagram’s lines as digits, a solid line as 1 and a broken line as 0, with the bottom line in the highest place. The first eight places of the order and the last one read as ordinary binary numbers; the same rule continues through all sixty-four. Each hexagram links to its own page, and the digits are taken from the hexagram’s actual lines, not typed in.

The eight three-line figures behave the same way on a smaller scale: they are the eight three-digit binary numbers from 000 to 111, which is why the eight trigrams and their lines are a good place to see the pattern before it is doubled. For the full set of figures in the book’s own order, see the complete table of sixty-four hexagrams.

The 1703 paper to the Paris Academy

Leibniz moved fast. Within days of receiving the diagram he sent the Paris Academy of Sciences a short paper, Explication de l’arithmétique binaire, which was printed in the Academy’s volume for 1703. It explains how to write numbers in binary, shows addition, subtraction, multiplication and division, and then turns to China. The ancient figures attributed to Fu Xi, Leibniz argued, were binary numbers, and their meaning had been lost to the Chinese themselves until a European arithmetic made it readable again.

That last claim tells us more about Leibniz and Bouvet than about the I Ching. For a Figurist and a philosopher looking for proof that reason was universal, the match was too good not to be a rediscovery. It made Leibniz’s binary system famous, because a curiosity about counting now came attached to the oldest book in China. He returned to it near the end of his life, in a long letter of 1716 to Nicolas Remond on the natural theology of the Chinese, still treating the hexagrams as evidence that ancient China and modern Europe reasoned alike.

Did the hexagrams inspire binary?

The chronology answers the most common question. Leibniz had written out binary arithmetic in 1679 and explained it to Bouvet in 1701; the diagram arrived in 1703. Historians of mathematics, from Leibniz’s biographer E. J. Aiton to the authors of the most recent study of his binary work, Lloyd Strickland and Harry Lewis, agree that the I Ching gave Leibniz a confirmation and an occasion to publish, not the idea. Accounts that say he learned binary from China have the dates backwards.

The opposite claim, that binary was really a Chinese invention which Leibniz only rediscovered, fails in a different way. The Earlier Heaven order matches binary counting, but nothing in the Yijing tradition uses it to calculate. There is no addition, no carrying from one place to the next, no multiplication. Shao Yong was intensely interested in number, but as cosmic proportion and the cycles of time, not as place-value arithmetic. Marie-Julie Maitre’s 2025 study in Science in Context makes the distinction sharply: an arrangement that can be mapped onto binary is not the same thing as a binary number system. It is fair to call the hexagrams a two-valued code in a loose sense, since every line is one of two states. It is not fair to say the I Ching was doing binary code arithmetic.

What remains is genuinely striking. Two people, separated by six centuries, each asked how far you can get by doubling two choices, and each arrived at the same sixty-four-place order. That is a fact about the structure of six two-way choices more than about either culture, and it is why the story still feels uncanny.

What the binary view adds to a reading

Seeing a hexagram as six binary digits is a useful way to understand how the book is built, even if the book itself never counts with them. Six lines, each one of two states, give exactly sixty-four possibilities, so the sixty-four hexagrams are not an arbitrary list but every possible combination. And a changing line is simply one digit flipping. Change the bottom line of hexagram 2 and you get hexagram 24; change all six lines of any figure and every digit inverts. If you want to see how that movement is read in practice, the guide to how changing lines work walks through it line by line.

The limit of the binary view is just as important. The I Ching reads each figure as an image of a situation, built from two trigrams with their own pictures, and its texts were written centuries before anyone arranged the hexagrams as a counting sequence; the story of how those layers came together is told in our history of how the book was written. For the other famous Western encounter with the book, a psychological rather than mathematical one, there is the story of Carl Jung and the oracle, and a plain introduction to the Book of Changes for anyone meeting it for the first time. Or cast six lines of your own and see which of the sixty-four binary patterns this moment produces.

Timeline

The dates that settle the question of priority, with the kind of record each one rests on.

DateWhat happenedKind of record
1670The Spanish bishop and mathematician Juan Caramuel prints a table of numbers written with two symbols in his Mathesis biceps, one of several early experiments with counting in bases other than ten.Dated publication
15 March 1679Leibniz dates a Latin manuscript, De progressione dyadica, that writes numbers with only 0 and 1 and works out addition and multiplication in that notation. He publishes none of it for more than twenty years.Unpublished manuscript
2 January 1697Writing to Duke Rudolph August of Brunswick, Leibniz proposes a medal showing the binary numbers under the motto that one is enough to draw everything out of nothing: binary as an image of creation.Dated letter
1697Leibniz publishes Novissima Sinica, a collection of Jesuit reports from China with his own preface arguing that Europe and China each have much to learn from the other.Dated publication
1698The French Jesuit Joachim Bouvet, a mathematician at the Kangxi Emperor's court, begins writing to Leibniz about the figures of the Yijing, which he believes hide an ancient philosophy waiting to be decoded.Dated letter
15 February 1701Leibniz sends Bouvet a full account of his binary arithmetic, together with his reading of 1 and 0 as God and nothing.Dated letter
4 November 1701Bouvet replies from Beijing with a woodcut of the Earlier Heaven arrangement of the sixty-four hexagrams, the square and circle diagram transmitted by the Song philosopher Shao Yong, and points out that it runs in the same order as Leibniz's numbers.Dated letter
1 April 1703After a detour through England, Bouvet's letter and its diagram finally reach Leibniz, seventeen months after they were sent.Dated letter
1703Within days Leibniz sends the Paris Academy of Sciences his Explication de l'arithmétique binaire, printed in the Academy's volume for 1703, which presents binary arithmetic and claims it unlocks the ancient figures attributed to Fu Xi.Dated publication
1716In a long letter to Nicolas Remond on the natural theology of the Chinese, unfinished at his death that November, Leibniz returns to the hexagrams and to binary as evidence that the ancient Chinese and modern Europe reasoned alike.Dated letter

Frequently asked questions

Did Leibniz get binary from the I Ching?

No. He had the idea of counting in twos by December 1676 at the latest, worked out binary arithmetic in a manuscript dated 15 March 1679, and explained the system in full to Joachim Bouvet in a letter of February 1701. The hexagram diagram Bouvet sent in reply only reached him on 1 April 1703. Historians of mathematics agree that the I Ching gave Leibniz a striking confirmation, and a reason to publish, rather than the idea itself.

What did Joachim Bouvet send Leibniz?

A woodcut of the Earlier Heaven arrangement of the sixty-four hexagrams, a square set inside a circle, enclosed with a letter dated 4 November 1701 from Beijing. The arrangement is traditionally credited to the sage Fu Xi, but it reached later readers through the eleventh-century philosopher Shao Yong. Bouvet pointed out that, read with solid lines as 1 and broken lines as 0, it runs in the same order as Leibniz's binary numbers.

Is the I Ching a binary code?

In a loose sense, yes: every line is one of two states, so every hexagram can be written as six binary digits, and there are exactly sixty-four of them, two to the sixth power. In the strict sense, no: the book never adds, carries or multiplies those digits, and its texts treat each hexagram as an image of a situation, not as a quantity. The Earlier Heaven order is a systematic arrangement that happens to match binary counting.

Who invented binary numbers before Leibniz?

The Englishman Thomas Harriot wrote numbers in base two in manuscripts from the early 1600s, and the Spanish bishop Juan Caramuel printed a two-symbol counting table in 1670. Neither published binary arithmetic in the worked form Leibniz did. His 1703 paper to the Paris Academy is the first widely read account of calculating in binary, which is why his name is attached to it.

Why did Leibniz think binary was so important?

Partly for calculation: he saw that a machine working with only two states would be simpler than one working with ten. Partly for theology: he read 1 and 0 as God and nothing, so that every number arising from them was an image of creation from nothing. He hoped that image might interest the Kangxi Emperor, who studied mathematics with the Jesuits, and so help their mission in China.

Which hexagram is zero and which is sixty-three in Leibniz's reading?

Hexagram 2, made of six broken lines, reads as zero. Hexagram 1, made of six solid lines, reads as sixty-three, the largest six-digit binary number. The bottom line counts as the highest place: hexagram 23, broken everywhere except the top line, reads as one, and hexagram 12, with three solid lines at the top, reads as seven.

How does this connect to changing lines in a reading?

A changing line is exactly one binary digit flipping from 1 to 0 or from 0 to 1. Change one line and the hexagram becomes a different six-digit number, and so a different figure; change all six and every digit inverts. Thinking of a cast as six two-way switches is a fair way to picture how a reading moves from one hexagram to another, as long as you remember the book reads the result as an image, not as arithmetic.

Sources

  • G. W. Leibniz, Explication de l'arithmétique binaire, in the Paris Academy of Sciences volume for 1703 (1703) — the published account of binary arithmetic and its link to the hexagrams
  • Rita Widmaier (ed.), Leibniz korrespondiert mit China: Der Briefwechsel mit den Jesuitenmissionaren 1689–1714 (1990) — the dated Leibniz–Bouvet letters of 1701 and the diagram
  • Daniel J. Cook and Henry Rosemont Jr. (trans.), Gottfried Wilhelm Leibniz: Writings on China (1994) — an English translation of the 1716 letter on the natural theology of the Chinese
  • Lloyd Strickland and Harry Lewis, Leibniz on Binary: The Invention of Computer Arithmetic, MIT Press (2022) — the 1679 manuscript, the medal design and the chronology of the invention
  • Frank J. Swetz, Leibniz, the Yijing, and the Religious Conversion of the Chinese, Mathematics Magazine 76 (2003) — Leibniz's theological reading of binary and his hopes for the China mission
  • Franklin Perkins, Leibniz and China: A Commerce of Light, Cambridge University Press (2004) — Leibniz's wider engagement with China and the Jesuit correspondents
  • E. J. Aiton, Leibniz: A Biography (1985) — the conclusion that Leibniz's binary predates the diagram
  • Marie-Julie Maitre, Is the Fuxi liushisi gua fangwei diagram attributed to Shao Yong binary?, Science in Context (2025) — the difference between an arrangement that matches binary and binary arithmetic

I am Gavin, and I built this site on my own. This page reports Leibniz’s published work, his correspondence and the scholarship around them, not research of mine — more on the person behind this site.