Decimal to Gray Code Converter

Our Decimal to Gray Code Converter helps you instantly compute any non-negative decimal number into its corresponding Gray code value.

Decimal to Gray Code Converter

Gray Code:

How to Convert Decimal to Gray Code

Many users search for how to convert decimal to gray code manually. The process is straightforward once you understand the formula.

Step 1: Convert Decimal to Binary

First, convert the decimal number into its binary equivalent.

Step 2: Apply the Gray Code Formula

Gray Code Formula:

Gray = Decimal XOR (Decimal >> 1)

Example

Let’s convert Decimal 10 to Gray code.

Step 1: Convert to Binary

10 in binary = 1010

Step 2: Apply XOR Rule

Binary: 1 0 1 0
Shifted: 0 1 0 1
XOR Result: 1 1 1 1

Gray Code = 1111

Decimal to Gray Code Table

Below is a quick reference decimal to gray code table for the first 16 numbers:

DecimalGray Code
00000
10001
20011
30010
40110
50111
60101
70100
81100
91101
101111
111110
121010
131011
141001
151000

This pattern continues following the one-bit change rule.

Why Use an Online Decimal to Gray Code Converter?

Manual conversion can be time-consuming and error-prone, especially with larger numbers.

Using an online tool:

  • Eliminates calculation errors
  • Provides instant results
  • Saves time
  • Works for any non-negative integer
  • Requires no binary knowledge

Simply enter a decimal number and get the Gray code immediately.

Related conversions:

Gray Code to Binary

Binary to Gray Code