Skip to content
ZeroServer.tools

Gray Code Converter

Convert between binary, Gray code, and decimal. Gray code changes only one bit between consecutive values.

1111
Reference table (0–15)
DecimalBinaryGray Code
000000
100011
2001011
3001110
40100110
50101111
60110101
70111100
810001100
910011101
1010101111
1110111110
1211001010
1311011011
1411101001
1511111000

What is Gray code?

Gray code (reflected binary code) is a binary numeral system where consecutive values differ by exactly one bit. This property makes it valuable in digital circuits, rotary encoders, and error correction, because single-bit transitions prevent transient errors during state changes. The conversion from binary to Gray code is: G[0] = B[0] and G[i] = B[i−1] XOR B[i].

Private & free — this tool runs entirely in your browser.

Recommended: IndieKit Ship your Next.js startup in days.affiliate

Related Converters tools