The hexagrams as binary numbers

This page sets out the I Ching binary sequence: the 64 hexagrams as the binary numbers 0 to 63, in the order associated with Shao Yong and with the diagram Joachim Bouvet sent to Gottfried Leibniz. What is sometimes called the I Ching binary code is this ordering of the figures, not a cipher, and not a claim that the book invented binary arithmetic.

Number or lines

Type a whole number from 0 to 63, or press the lines. A pressed line is solid, which is 1. The top line is the 1’s place and the bottom line is the 32’s place, so the binary digits are written with the top line at the right. The names are the ones each hexagram page already prints.

Read left to right, top row first: 0, then 1, through 63. Under each figure, the King Wen number used on the rest of this site. A solid line counts as 1 and a broken line as 0.

Which line is 1

On this page a solid line is 1 and a broken line is 0, and the top line is the 1’s place. Written as six digits, with the largest place on the left, binary 0 is six broken lines, binary 1 (000001) is a solid line at the top only, binary 32 (100000) is a solid line at the bottom only, and binary 63 is six solid lines. That is the left-to-right reading of the square. The English Wikipedia article ‘Binary number’ describes the same square as two equivalent readings: least significant bit on top, then either bottom-right to top-left with a solid line as 0 and a broken line as 1, or top-left to bottom-right with a solid line as 1 and a broken line as 0 [1]. This page uses the second of those, because it runs 0 to 63 in the order the cells are drawn and it matches the values Leibniz printed.

Leibniz’s own sentence, in the French text of the 1703 paper, is: “pourvu qu’on remarque premièrement qu’une ligne entière — signifie l’unité ou 1, et secondement qu’une ligne brisée - - signifie le zéro ou 0.” A whole line means 1, and a broken line means 0 [2]. The trigrams page uses a different convention, and only for the eight Unicode codepoints: there a solid line is 0 and a broken line is 1. That is a character-code order, not this diagram and not Leibniz.

Steve Marshall reads the Fuxi figures from the top line downwards, with a yang line as 1 and a yin line as 0. On that reading the second hexagram, binary 000001, is King Wen 23, whose only solid line is the top one, and not King Wen 24. He quotes Richard Rutt’s instruction to put the bottom line at the right, and answers that hexagram 23 rendered that way is binary 100000, which is 32, not 1 [3]. The second cell of the square above is King Wen 23.

The 64 cells are computed from the six lines each hexagram page already draws. The pinyin and the English name are copied from that page’s own title, not a new translation.

Where the order comes from

The arrangement is Song dynasty, and it is associated with Shao Yong (1011–1077), not with the older King Wen order that this site uses for its numbers. The Wikipedia article ‘King Wen sequence’ says the binary or Fu Xi sequence “originated in the Song dynasty” and is believed to be Shao Yong’s work, that “it was customary to attribute authorship to these legendary figures”, and that the King Wen sequence is of much greater antiquity [4]. The same ground is covered on the King Wen sequence.

Shao Yong rearranged the hexagrams into a form that resembles binary numbers, “although he did not intend his arrangement to be used mathematically”, and the arrangement later inspired Leibniz. Separately, “the assignment of numbers, binary or decimal, to specific hexagrams, is a modern invention” [5]. The 0-to-63 labels on this page are that later reading of his order of figures. They are not a claim that Shao Yong numbered the hexagrams.

Bouvet’s letter and the 1703 paper

Gottfried Leibniz published the comparison in Explication de l’Arithmétique Binaire. The full title, as the ‘Binary number’ article gives it, is Explication de l’Arithmétique Binaire, qui se sert des seuls caractères 0 et 1, avec des remarques sur son utilité, et sur ce qu’elle donne le sens des anciennes figures chinoises de Fohy [1]. It was printed in the Histoire de l’Académie Royale des Sciences for the year 1703, which appeared in 1705 [6]. French Wikisource transcribes Gerhardt’s text and cites the 1703 volume on Gallica [7].

It was scarcely more than two years ago that I sent to Reverend Father Bouvet, the celebrated French Jesuit who lives in Peking, my method of counting by 0 and 1, and nothing more was required to make him recognize that this was the key to the figures of Fuxi. Writing to me on 14 November 1701, he sent me this philosophical prince’s grand figure, which goes up to 64.

Leibniz, Explication de l’Arithmétique Binaire (1703), in Lloyd Strickland’s 2007 draft translation of Gerhardt, Mathematische Schriften VII, pp. 223–227 [8]

The same translation has Leibniz say that “this Father has deciphered the enigma of Fuxi, with the help of what I had communicated to him.” In the paper, the letter is dated 14 November 1701. A description quoted by the History of Information entry dates Bouvet’s letter from Peking to 4 November 1701 and says it reached Leibniz, after a detour through England, on 1 April 1703, enclosing a woodcut of the Fu-Hsi arrangement [6]. The two dates are what those two sources state. The woodcut Leibniz owned is the diagram whose file description says the Arabic numerals were added by him, and that the grid is the Fuxi or binary sequence [9]. This page does not reproduce that image.

What he took, and what he did not

He did not learn the binary system from the I Ching. The History of Information entry records a manuscript dated 15 March 1679, says the calculator he outlined then was never built, and says he published nothing on the subject until this paper. The same entry says that 1679 manuscript was first published in 1966 [6]. The description it quotes says the crucial exchange began on 15 February 1701, when Leibniz wrote to Bouvet describing binary arithmetic, including the creation of the world by God out of nothing, and that Bouvet then recognised the hexagrams in it. Within a week of the letter’s arrival Leibniz sent the Explication to Abbé Bignon for the Paris Academy.

So the diagram prompted the publication and the remarks on the Chinese figures. The arithmetic was already his. The ‘Binary number’ article, describing the 1700–1701 correspondence, says Bouvet demonstrated in his 1701 letters that the I Ching was an independent, parallel invention of binary notation [1]. That is the article’s wording for what Bouvet claimed to have found. It is not a statement that the book invented binary arithmetic, and the 1679 manuscript is earlier either way. The same article notes earlier European work, including Thomas Harriot’s.

The ‘I Ching’ article says Leibniz wrote the first European commentary on the I Ching in 1703, and, summarizing Nelson (2011) and Smith (2008), that he argued the figures proved the universality of binary numbers and of theism: the broken lines, the “0” or “nothingness”, cannot become the solid lines, the “1” or “oneness”, without God [5]. Those sentences are the article’s summary of that argument. In the paper itself he writes: “The Chinese lost the meaning of the Cova or Lineations of Fuxi, perhaps more than a thousand years ago, … so that their true explanation now has to come from Europeans” [8]. That is his claim about the transmission, printed in 1703, not a finding about Song or earlier mathematics.

All 64 hexagrams in King Wen order, which is the other sequence.

Sources

[1] ‘Binary number’, English Wikipedia, read 2 October 2026. The China section states the two readings of Shao Yong’s square (solid as 0 or as 1) and cites Steve Marshall for the least-significant bit sitting on top.

[2] Gottfried Leibniz, Explication de l’arithmétique binaire, transcription of Gerhardt’s text: French Wikisource, read 2 October 2026. The sentence on the whole line and the broken line is quoted from that transcription.

[3] Steve Marshall, biroco.com/yijing/sequence.htm, read 2 October 2026. He reads the Fuxi sequence from the top line downwards, yang as 1, and takes binary 000001 as King Wen 23. The sentence he quotes from Richard Rutt is on that page.

[4] ‘King Wen sequence’, English Wikipedia, read 2 October 2026. Quoted for the Song-dynasty origin of the Fu Xi sequence and for Shao Yong (1011–1077).

[5] ‘I Ching’, English Wikipedia, read 2 October 2026. The sentences on Shao Yong’s arrangement cite Redmond and Hon (2014); the sentences on Leibniz’s 1703 argument cite Nelson (2011) and Smith (2008). The diagram caption there says the Arabic numerals were added by Leibniz.

[6] ‘Leibniz Expounds on Binary Arithmetic for Computing’, History of Information, entry last revised 26 July 2014, read 2 October 2026. The 15 March 1679 manuscript, the 1705 printing, and the 1966 publication of the manuscript are the entry’s own statements. The 15 February 1701 letter, the 4 November 1701 date, the arrival on 1 April 1703, and the woodcut are inside a description by the bookseller W. P. Watson that the entry quotes.

[7] The 1703 printing French Wikisource cites: Gallica, Histoire de l’Académie Royale des Sciences, année 1703. Wikisource also cites Gerhardt’s volume on Gallica; the transcription in source [2] is the text quoted here.

[8] Lloyd Strickland, draft English translation (2007) of the same Gerhardt text: archived copy of leibniz-translations.com/binary.htm, 25 June 2024, read 2 October 2026. The English sentences quoted above are his.

[9] File description, not an inspection of the sheet: Diagram of I Ching hexagrams owned by Gottfried Wilhelm Leibniz, 1701, Wikimedia Commons, read 2 October 2026. The description says the Arabic numerals were added by Leibniz and that the central grid is the Fuxi or binary sequence.

Related on this site: the eight trigrams, the King Wen sequence, and all 64 hexagrams.