Gray code to decimal
Type a value in Gray to get it in dec instantly.
170dec
That's 11× as big as a nibble (4 bits), while a byte is 1.5× bigger. That needs 8 bits to store.
Convert the other way: dec to Gray
What it means
How big is that?
Whole numbers only. Anything after the decimal point is rounded away.
The math
How to convert Gray to dec
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 Gray = 170 dec.
Every unit
Your number in every base
Tables
Gray to dec conversion table
| Gray | dec |
|---|---|
| 1 Gray | 1 dec |
| 10 Gray | 3 dec |
| 100 Gray | 7 dec |
| 1000 Gray | 15 dec |
| 1010 Gray | 12 dec |
| 1111 Gray | 10 dec |
| 10000 Gray | 31 dec |
| 11111 Gray | 21 dec |
| 100000 Gray | 63 dec |
| 1000000 Gray | 127 dec |
| 1100100 Gray | 71 dec |
| 10000000 Gray | 255 dec |
| 11111111 Gray | 170 dec |
| 100000000 Gray | 511 dec |
| 1000000000 Gray | 1,023 dec |
| 1111101000 Gray | 688 dec |
| 10000000000 Gray | 2,047 dec |
dec to Gray conversion table
| dec | Gray |
|---|---|
| 1 dec | 1 Gray |
| 2 dec | 11 Gray |
| 4 dec | 110 Gray |
| 8 dec | 1100 Gray |
| 10 dec | 1111 Gray |
| 15 dec | 1000 Gray |
| 16 dec | 11000 Gray |
| 31 dec | 10000 Gray |
| 32 dec | 110000 Gray |
| 64 dec | 1100000 Gray |
| 100 dec | 1010110 Gray |
| 128 dec | 11000000 Gray |
| 255 dec | 10000000 Gray |
| 256 dec | 110000000 Gray |
| 512 dec | 1100000000 Gray |
| 1,000 dec | 1000011100 Gray |
| 1,024 dec | 11000000000 Gray |
Quick answers
Quick answers
- How many dec is 1 Gray?
- 1 Gray is 1 dec.
- How many dec is 1010 Gray?
- 1010 Gray is 12 dec.
- How many dec is 11111111 Gray?
- 11111111 Gray is 170 dec.
The units
About these units
Gray code (Gray)
Reflected binary code: the next number changes only one bit. Used by rotary encoders.
Decimal (dec)
Base ten, the everyday counting system, using digits 0 to 9.
Keep going