Gray Code Converter
Convert between binary, Gray code, and decimal. Gray code changes only one bit between consecutive values.
1111
Reference table (0–15)
| Decimal | Binary | Gray Code |
|---|---|---|
| 0 | 0000 | 0 |
| 1 | 0001 | 1 |
| 2 | 0010 | 11 |
| 3 | 0011 | 10 |
| 4 | 0100 | 110 |
| 5 | 0101 | 111 |
| 6 | 0110 | 101 |
| 7 | 0111 | 100 |
| 8 | 1000 | 1100 |
| 9 | 1001 | 1101 |
| 10 | 1010 | 1111 |
| 11 | 1011 | 1110 |
| 12 | 1100 | 1010 |
| 13 | 1101 | 1011 |
| 14 | 1110 | 1001 |
| 15 | 1111 | 1000 |
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
JSON to YAML
Convert JSON into clean, readable YAML instantly.
YAML to JSON
Convert YAML configuration into valid JSON.
JSON to CSV
Flatten a JSON array of objects into CSV rows.
CSV to JSON
Parse CSV with headers into a JSON array of objects.
JSON to XML
Convert JSON structures into nested XML markup.
JSON to SQL
Turn a JSON array of objects into SQL INSERT statements.
CSV to XML
Convert CSV rows into structured XML records.
XML to CSV
Flatten repeated XML records into CSV rows.