The Gray Code Converter converts between Gray code (reflected binary) and binary, octal, decimal, and hexadecimal. Gray code changes by only one bit between consecutive values, which is useful in encoders and error detection.
What is Gray Code?
Gray code is a binary encoding where successive values differ by exactly one bit. The tool converts between Gray and binary, and between Gray and octal, decimal, or hex (via binary).
Key Features
- Convert from binary, octal, decimal, or hex to Gray code.
- Convert from Gray code to binary, octal, decimal, or hex.
- Client-side only; no server upload.
How to Use
- Open the Gray Code Converter tool.
- Select "From" (e.g. Decimal) and "To" (e.g. Gray code or Decimal).
- Enter the value.
- Read and copy the result.
Use Cases
- Encoders — Interpret or generate Gray code from rotary encoders.
- K-maps — Move between Gray and decimal when simplifying logic.
- Education — Demonstrate reflected binary and single-bit changes.
Frequently Asked Questions
What is Gray code?
Gray code is a binary encoding where successive values differ by only one bit. It is used in encoders and error correction.
What input does it accept?
Enter a number in binary (0 and 1), octal, decimal, or hexadecimal. Gray input must be a binary string (0 and 1).
Are negative numbers supported?
Conversion from decimal/octal/hex supports non-negative integers only. Negative Gray is not standard.
Is data processed on a server?
No. All conversion runs in your browser.
When is Gray code used?
Common in rotary encoders, Karnaugh maps, and anywhere single-bit changes between consecutive values are desired.
Why is my Gray conversion wrong?
Ensure input uses only 0 and 1 for Gray. For other bases, use valid digits (e.g. 0-7 for octal).
Conclusion
Use the Gray Code Converter for Gray ↔ binary, decimal, octal, and hex. See also Number Base Converter and Binary Calculator.