Skip to main content

Convert Decimal to Gray Code

Convert non-negative decimal integers to binary-reflected Gray code in your browser.

Tool workspace

Converts whole non-negative decimals to binary-reflected Gray code (max 256 bits). Nothing you paste is uploaded.

How it works

Enter a whole non-negative decimal number (0 or greater).

The tool converts it to unsigned binary, then applies binary-reflected Gray encoding (G = B XOR (B >> 1)). Results are capped at 256 bits—the same limit as sibling binary tools. Negatives, fractions, and oversize values are rejected with a clear message.

Everything runs in your browser. Nothing you paste is uploaded.

Examples

  • 0 → 0
  • 7 → 100
  • 13 → 1011
  • 255 → 10000000

Privacy

Privacy: this tool converts numbers locally in your browser. We do not log or store what you paste. Login is not required.

FAQ

Is my number uploaded?

No. Conversion runs entirely in your browser. We do not log or store what you paste.

What is Gray code?

Binary-reflected Gray code encodes integers so successive values differ by only one bit. It is computed as G = B XOR (B >> 1) from the binary representation.

Why is there a 256-bit limit?

The limit matches sibling binary math tools and keeps results practical for browsers. Values that need more than 256 bits are rejected.

Do I need an account?

No. All published tools work for guests without login.