Math & Number Utilities100% Client-Side

Encode Binary as Reflected Gray Code

Paste a binary value to find its binary-reflected Gray code. The tool combines each binary bit with the adjacent bit toward the left, and the first bit stays the same. It keeps the width of the original binary field, including any leading zeroes. This is useful for checking transitions in a small table or preparing a fixed-width example for a decoder fixture.

Input
6 chars•1 lines
Output

Reverse tool

Gray Code to Binary Converter

Decode reflected Gray code as binary. Read back the corresponding bits while preserving the width of the Gray input, including leading zeroes.

Open Gray Code to Binary Converter
Example input
111111
Example output
101010

How to Use the Binary to Gray Code Converter Online

  1. 1Paste one non-negative integer written in binary.
  2. 2Check the ordinary binary magnitude if you are comparing against a hand-worked example.
  3. 3Read the resulting reflected Gray bits. Confirm the expected width before copying them.
  4. 4Use the matching reverse converter to compare the restored value with the original input.

Input & Output Examples

The magnitude is 42 in decimal, so the displayed result is its gray code representation.

Input Sample
101010
Expected Output
111111

The leading zero is preserved as part of the four-bit field while the adjacent-bit comparisons give the remaining bits.

Input Sample
0b0_110
Expected Output
0101

Practical Developer Workflows

  • Generate a small Gray sequence at a fixed bit width.
  • Compare the Gray code of neighboring binary integers to inspect which position changes.
  • Check a binary-to-Gray example by decoding its output to the original width.

Zero Server Uploads & Complete Privacy

Runs 100% in your browser; no data is uploaded to any server.

Notice a bug, calculation error, or outdated info?

Let us know directly so our engineering team can fix it.

Frequently Asked Questions

Copy the most significant input bit. For each later position, compare that input bit with the one immediately to its left. Write one if those bits differ or zero if they match.

Explore Other Tools

12 suggested tools

View all tools