Binary to Gray code
Type a value in bin to get it in Gray instantly.
10000000Gray
That's about the same as a byte. That needs 8 bits to store.
Convert the other way: Gray to bin
What it means
How big is that?
Whole numbers only. Anything after the decimal point is rounded away.
The math
How to convert bin to Gray
Base b: each digit is worth b times the one to its right. Gray code = n XOR (n ÷ 2); BCD writes each decimal digit as four bits.
Example: 11111111 bin = 10000000 Gray.
Every unit
Your number in every base
Tables
bin to Gray conversion table
| bin | Gray |
|---|---|
| 1 bin | 1 Gray |
| 10 bin | 11 Gray |
| 100 bin | 110 Gray |
| 1000 bin | 1100 Gray |
| 1010 bin | 1111 Gray |
| 1111 bin | 1000 Gray |
| 10000 bin | 11000 Gray |
| 11111 bin | 10000 Gray |
| 100000 bin | 110000 Gray |
| 1000000 bin | 1100000 Gray |
| 1100100 bin | 1010110 Gray |
| 10000000 bin | 11000000 Gray |
| 11111111 bin | 10000000 Gray |
| 100000000 bin | 110000000 Gray |
| 1000000000 bin | 1100000000 Gray |
| 1111101000 bin | 1000011100 Gray |
| 10000000000 bin | 11000000000 Gray |
Gray to bin conversion table
| Gray | bin |
|---|---|
| 1 Gray | 1 bin |
| 10 Gray | 11 bin |
| 100 Gray | 111 bin |
| 1000 Gray | 1111 bin |
| 1010 Gray | 1100 bin |
| 1111 Gray | 1010 bin |
| 10000 Gray | 11111 bin |
| 11111 Gray | 10101 bin |
| 100000 Gray | 111111 bin |
| 1000000 Gray | 1111111 bin |
| 1100100 Gray | 1000111 bin |
| 10000000 Gray | 11111111 bin |
| 11111111 Gray | 10101010 bin |
| 100000000 Gray | 111111111 bin |
| 1000000000 Gray | 1111111111 bin |
| 1111101000 Gray | 1010110000 bin |
| 10000000000 Gray | 11111111111 bin |
Quick answers
Quick answers
- How many Gray is 1 bin?
- 1 bin is 1 Gray.
- How many Gray is 1010 bin?
- 1010 bin is 1111 Gray.
- How many Gray is 11111111 bin?
- 11111111 bin is 10000000 Gray.
The units
About these units
Binary (bin)
Base two: only 0 and 1. Every digit is one bit, the smallest unit of computer memory.
Gray code (Gray)
Reflected binary code: the next number changes only one bit. Used by rotary encoders.
Keep going