Gray Code Converter
Convert binary to Gray code or Gray code to binary, with a step-by-step bit transformation table.
Input
Quick examples
Binary input
—
Decimal: —
Gray code output
—
Decimal: —
Step-by-step transformation
| Bit position | Input bit | XOR with | Output bit |
|---|
Enter a binary or Gray code value to see the conversion.
Copied!
Summary
Convert binary to Gray code or Gray code to binary, with a step-by-step bit transformation table.
How it works
- Enter a binary number (e.g. 1011) or a Gray code sequence in the input box.
- Choose the conversion direction: Binary → Gray or Gray → Binary.
- The tool applies the XOR rule bit by bit to produce the output.
- A step-by-step table shows each bit position, the input bit, the XOR operation, and the output bit.
- The decimal value of both the input and output is shown for reference.
Use cases
- Verify Gray code assignments for rotary encoders in embedded systems.
- Debug digital circuits that use Gray code to eliminate glitches.
- Study the relationship between binary and reflected binary (Gray) code.
- Convert Karnaugh map cell addresses when laying out logic expressions.
- Generate Gray code sequences for teaching digital logic courses.
Frequently Asked Questions
Last updated: 2026-07-01 ·
Reviewed by Nham Vu