Math & Number Utilities100% Client-Side

Decode Gray Code to Decimal

Paste a reflected Gray code field to recover the whole number it represents in decimal. The tool decodes the bit sequence first, then prints the magnitude with ordinary base-ten digits. This is useful when a source describes values in Gray order but a reference lists them as decimal numbers. Keep the raw Gray field alongside the result if the original width is meaningful to the fixture.

Input
6 chars•1 lines
Output

Reverse tool

Decimal to Gray Code Converter

Convert a non-negative decimal integer to reflected Gray code. Copy the exact bit sequence and compare neighboring values for a reference or fixture.

Open Decimal to Gray Code Converter
Example input
42
Example output
111111

How to Use the Gray Code to Decimal Converter Online

  1. 1Paste the unsigned Gray bit field as one value, keeping any leading zeroes that belong to it.
  2. 2Check that the field uses binary-reflected Gray code before comparing the result.
  3. 3Read the decoded value shown in decimal. Save that base with the expected result.
  4. 4Copy the output alongside the original Gray field when the test needs to show which encoding supplied the value.

Input & Output Examples

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

Input Sample
111111
Expected Output
42

Gray 1001 decodes to binary 1110, which has decimal value 14.

Input Sample
0b1_001
Expected Output
14

Practical Developer Workflows

  • Read decimal labels from a set of known Gray-code examples.
  • Check the value of a Gray field without doing place-value arithmetic by hand.
  • Compare the decimal result with the Binary to Decimal result after explicitly decoding the field.

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

Decode the Gray sequence to ordinary binary with the Gray to Binary page. Then interpret that output as a base-two integer. For example, Gray 111111 decodes to binary 101010, whose decimal value is 42.

Explore Other Tools

12 suggested tools

View all tools