Bytelify

Gray Code to Decimal Converter

Convert Gray code (binary) to decimal, live as you type.

Runs in your browser, nothing sent
grey-code-to-decimal
50

Gray code is a binary numbering system where consecutive values differ by exactly one bit — used in rotary encoders and error correction to avoid glitches from multiple bits flipping at once. Converts live as you type, entirely in your browser.

Need the opposite? Decimal to Gray Code Converter

What is Gray Code to Decimal Converter?

Gray code is a binary numbering system where consecutive values differ by exactly one bit, used in rotary encoders, Karnaugh maps, and error correction, since it avoids the ambiguous in-between readings that regular binary can produce when a sensor catches multiple bits changing mid-transition. Paste a Gray code binary string (e.g. 1011, 0101) and get its decimal value instantly. Multiple entries are supported, so you can validate or decode a whole batch of Gray code readings at once rather than one at a time. Input is validated as you go: invalid bit strings are flagged rather than silently misconverted, and everything runs entirely in your browser, with nothing sent to a server.

Gray Code to Decimal Chart (0-15)

Gray CodeDecimal
00000
00011
00112
00103
01104
01115
01016
01007
11008
11019
111110
111011
101012
101113
100114
100015

How to Use the Gray Code to Decimal Converter

  1. 1

    Paste a Gray Code Bit String: Enter one or more Gray code values made of 0s and 1s, such as 1011.

  2. 2

    Read the Decimal Result Instantly: The decoded decimal value appears automatically as you type, with invalid bit strings flagged.

  3. 3

    Copy the Result: Use the copy button to copy the decimal value for use in hardware debugging or documentation.

How Gray Code Converts to Decimal

First convert the Gray code back to regular binary, then read that binary number as decimal. The Gray-to-binary step works left to right: the first (leftmost) binary bit equals the first Gray bit, and every binary bit after that equals the previous binary bit XORed with the corresponding Gray bit.

How to Convert Gray Code to Decimal

Converting 1011: the first binary bit is 1 (copied from Gray). The second binary bit is 1 XOR 0 = 1. The third is 1 XOR 1 = 0. The fourth is 0 XOR 1 = 1. That gives binary 1101, which is 13 in decimal. So Gray code 1011 = decimal 13.

Examples

OUTPUT
0111 → binary 0101 → decimal 5
10101 → binary 11001 → decimal 25
1100 → binary 1000 → decimal 8
FAQs

Frequently Asked Questions

Common questions about Gray Code to Decimal Converter.

Gray code and regular binary represent the same range of numbers, but adjacent Gray code values always differ by exactly one bit, which regular binary doesn't guarantee.

Yes, enter several Gray code strings and each is converted to its decimal value independently.

Yes, see the paired Decimal to Gray Code Converter for the reverse direction.

Gray code bit patterns don't carry the same place-value meaning as regular binary, so reading a Gray code string as if it were plain binary gives the wrong number; it has to be converted back to binary first using the XOR chain described above.

Yes, Bytelify's Gray Code to Decimal Converter is free with no account or sign-up required.

No. The conversion runs entirely client-side in your browser, so nothing you paste is sent anywhere.