Gray Code Converter
Local ProcessingConvert Gray code to and from binary, octal, decimal and hexadecimal.
How It Works & Processing Standards
Convert Gray code to and from binary, octal, decimal and hexadecimal.
Tool processing runs in your browser. If you create a calculator or conversion share link, its values are included in the URL. See the privacy policy for account, analytics and advertising data.
Current Limits
- Maximum input length: 100,000 characters
In Gray code, neighboring values differ by one bit. Used with rotary encoders and in digital circuit courses.
What You Can Do
- Binary ↔ Gray
- g = b XOR (b >> 1), and the reverse.
- Octal, decimal, hex ↔ Gray
- Converts values in other bases directly.
How to Use Gray Code Converter
- 1Choose a taskThe input base and direction.
- 2Enter a valueDigits of the chosen base only.
- 3CopyCopy the result.
Examples
Binary 1011 to Gray
Input: 1011
Result: 1110
Gray 1110 to decimal
Input: 1110
Result: 11
Common Use Cases
- Interpreting rotary encoder output
- Karnaugh maps and digital logic homework
- Designing counters that limit bit errors
Frequently Asked Questions (FAQ)
Why use Gray code?
Only one bit changes per step, which reduces misreads from mechanical sensors.
Are leading zeros kept?
Binary results keep the same width as the input.
