Zeckendorf and Fibonacci Code Converter

Write any whole number as a sum of non-consecutive Fibonacci numbers, its Zeckendorf representation, and turn it into a self-delimiting Fibonacci codeword, or decode either back.

Converter Number Systems Updated Oct 3, 2026
How to Use
  1. Choose number to Zeckendorf, Zeckendorf to number, or decode a Fibonacci code.
  2. Type a whole number, a Zeckendorf string such as 1000010100, or a codeword ending in 11.
  3. Read the Zeckendorf digits, the decimal value, the Fibonacci code and how many terms are used.
  4. The drawing labels each place with its Fibonacci number.
  5. Show Work takes the largest Fibonacci number that fits, again and again.
Input
Presets
Fibonacci place values
Zeckendorf
—
Decimal
—
Fibonacci code
—
Fibonacci numbers used
—

Worked Example

100 as a sum of Fibonacci numbers. The Fibonacci numbers up to 100 are 1, 2, 3, 5, 8, 13, 21, 34, 55 and 89. Take the largest that fits: 100 − 89 = 11. Then 11 − 8 = 3, and 3 − 3 = 0. So 100 = 89 + 8 + 3. Marking 89, 55, 34, 21, 13, 8, 5, 3, 2, 1 with 1 or 0 gives 1000010100.

As a Fibonacci code. Write the digits smallest first, 0010100001, and add a final 1: 00101000011. The 11 at the end tells the decoder this number is complete, so codewords can be sent one after another with no gaps.

The common mistake: using neighbouring Fibonacci numbers. 100 = 55 + 34 + 8 + 3 is also a correct sum, but 55 and 34 are neighbours, and 55 + 34 = 89, so it is not the Zeckendorf form. Only the greedy choice gives the unique representation with no 11.

Show Work

Enter a number to see the step-by-step working.

Formulas

Fibonacci numbers
Fn = Fn−1 + Fn−2
places 1, 2, 3, 5, 8, 13…
Zeckendorf
n = Σ Fki, ki+1 ≥ ki + 2
Greedy step
subtract the largest F ≤ n
Fibonacci code
reverse the digits, append 1
ends in 11
Length
about logφ n ≈ 1.44 log₂ n
φ = 1.618…

Counting with Rabbits

Fibonacci’s sequence, from a rabbit-breeding puzzle in his Liber Abaci of 1202, grows by roughly the golden ratio φ ≈ 1.618 at each step. That makes it a natural set of place values: like powers of two, they grow geometrically, and every number fits between two neighbours. Lekkerkerker proved in 1952 that the non-consecutive sum is unique; Zeckendorf, who published it in 1972, gave his name to it.

Fibonacci coding, described by Alberto Apostolico and Aviezri Fraenkel in 1985, turns that uniqueness into a practical code. Because the pattern 11 can only appear at the end of a codeword, a stream of numbers needs no length fields or separators, and a damaged bit affects only nearby numbers.

About This Calculator

This converter writes any positive whole number as its unique sum of non-consecutive Fibonacci numbers, gives the Zeckendorf digits and the Fibonacci codeword, and decodes either back, rejecting strings that contain 11 or more than one codeword. It shows the greedy subtraction and labels each place with its Fibonacci number.

Everything runs in your browser; nothing is sent anywhere. Numbers with hundreds of digits are fine.

Related calculators: Factoradic Converter, Unary and Tally Converter, and Mixed Radix Converter.

Frequently Asked Questions

What is the Zeckendorf representation?

Every positive whole number can be written in exactly one way as a sum of Fibonacci numbers (1, 2, 3, 5, 8, 13, …) with no two consecutive ones. 100 = 89 + 8 + 3. Writing a 1 for each Fibonacci number used and 0 otherwise gives a binary-looking string, 1000010100, in which two 1s are never adjacent.

How do I find it?

Greedily: subtract the largest Fibonacci number that fits, then repeat with what is left. 100 − 89 = 11, 11 − 8 = 3, 3 − 3 = 0. The greedy choice never picks two neighbouring Fibonacci numbers, which is why the result is unique.

What is Fibonacci coding?

A way to send numbers as a stream of bits without separators. Write the Zeckendorf digits with the smallest Fibonacci number first, then add one more 1. Since a Zeckendorf string never contains 11, the only 11 is at the end, marking where each number stops: 100 becomes 00101000011.

Why use Fibonacci coding?

It is a universal code: small numbers get short codewords, and an error in one bit usually damages only one or two numbers instead of everything after it, because the decoder can resynchronise at the next 11. It has been used in data compression and in some error-tolerant protocols.

Who was Zeckendorf?

Édouard Zeckendorf, a Belgian army doctor and amateur mathematician, who published the theorem in 1972, though Cornelis Lekkerkerker had proved it in 1952. It is a classic example of a mixed number system whose place values are not powers of anything.

How do I use the Zeckendorf and Fibonacci Code Converter?

Simply type or paste your value and read the result, which refreshes the instant you change something. There is nothing to submit and nothing to wait for.

Do I need to install or sign up for anything?

Not at all — it runs in the browser with nothing to install and no account. After it loads once, it even works without an internet connection.

Is my information private?

Yes. Everything happens in your browser. Nothing you type is sent to a server or saved anywhere.

Common Use Cases

Number theory

100 = 89 + 8 + 3, written 1000010100.

Compression

1 encodes as 11, 2 as 011, 3 as 0011 and 4 as 1011.

Decoding

The codeword 00101000011 decodes to 100.

Puzzles

64 = 55 + 8 + 1 = 100010001: the sum never uses neighbouring Fibonacci numbers.

Last updated: