Skip to main content

Gray Code

Convert between decimal, binary, and reflected binary (Gray code).

Reflected binary code, also called Gray code, is an ordering of the binary numeral system such that two successive values differ in only one bit. Convert a decimal or binary value to its Gray code, or recover the original number from a Gray code value. Process one value per line. See more information at Wikipedia.

Input is: