Binary to Gray Code

Convert standard binary to Gray code (reflected binary code) with visual bit-by-bit breakdown.

🔀 Binary to Gray Code

Invalid input

Gray Code

⚙️ Step-by-Step Breakdown

Enter a value to see the conversion steps

🕑 Recent Conversions

Your conversions will appear here

What Is Binary to Gray Code

Gray code is a binary numeral system where two successive values differ in only one bit. It is also known as reflected binary code (RBC).

Gray code is widely used in rotary encoders, Karnaugh maps, error correction, and digital communications to minimize errors during transitions.

🔄 Interactive Gray Code Explorer

How to Convert Binary to Gray Code

To convert binary to Gray code: the MSB stays the same, then each subsequent Gray bit is the XOR of the current and previous binary bit.

For example, binary 1011: G₀=1, G₁=1⊕0=1, G₂=0⊕1=1, G₃=1⊕1=0 → Gray code 1110.

⚡ Try It — Step-by-Step Demo

Frequently Asked Questions

Gray code is a binary encoding where adjacent values differ by exactly one bit, reducing errors in digital transitions.
It prevents glitches in digital systems where multiple bits might change simultaneously, causing incorrect intermediate values.
Keep the MSB, then XOR each pair of adjacent binary digits to get the corresponding Gray code digit.
Rotary encoders, Karnaugh maps, genetic algorithms, analog-to-digital converters, and error correction systems.
Yes, Gray code can represent any non-negative integer, just like standard binary.

All Conversion Tools

Dec → Hex

Decimal to Hexadecimal

Base 10 → Base 16

Try Now →
Hex → Dec

Hexadecimal to Decimal

Base 16 → Base 10

Try Now →
Dec → Bin

Decimal to Binary

Base 10 → Base 2

Try Now →
Bin → Dec

Binary to Decimal

Base 2 → Base 10

Try Now →
Dec → Oct

Decimal to Octal

Base 10 → Base 8

Try Now →
Oct → Dec

Octal to Decimal

Base 8 → Base 10

Try Now →
Oct → Hex

Octal to Hexadecimal

Base 8 → Base 16

Try Now →
Hex → Oct

Hexadecimal to Octal

Base 16 → Base 8

Try Now →
Oct → Bin

Octal to Binary

Base 8 → Base 2

Try Now →
Bin → Oct

Binary to Octal

Base 2 → Base 8

Try Now →
Hex → Bin

Hexadecimal to Binary

Base 16 → Base 2

Try Now →
Bin → Hex

Binary to Hexadecimal

Base 2 → Base 16

Try Now →
Dec → BCD

Decimal to BCD

Convert decimal numbers to Binary Coded Decimal (B...

Try Now →
Dec → 2's

Decimal to 2's Complement

Convert decimal integers (including negatives) to ...

Try Now →
Bin → ASCII

Binary to ASCII

Convert binary numbers to ASCII text characters. D...

Try Now →
Hex → ASCII

Hex to ASCII

Convert hexadecimal values to ASCII text. Decode h...

Try Now →
Hex → RGB

Hex to RGB

Convert hex color codes to RGB values instantly. S...

Try Now →
RGB → Hex

RGB to Hex

Convert RGB color values to hexadecimal color code...

Try Now →
ASCII → Hex

ASCII to Hex

Convert ASCII text to hexadecimal representation. ...

Try Now →
Hex → Text

Hex to Text

Convert hexadecimal strings to readable text. Deco...

Try Now →
Dec → Frac

Decimal to Fraction

Convert decimal numbers to simplified fractions. S...

Try Now →
Dec → %

Decimal to Percent

Convert decimal values to percentages instantly wi...

Try Now →
Any → Any

Number Base Converter

Convert numbers between any bases (2-36). Universa...

Try Now →
Hex → Info

Hexadecimal Reference

Complete hexadecimal reference with conversion tab...

Try Now →
Hex → Unicode

Hex to Unicode

Convert hexadecimal code points to Unicode charact...

Try Now →
ASCII → Bin

ASCII to Binary

Convert ASCII text to binary representation. See e...

Try Now →