## Number Coding Systems

### Codes

The terms code and cipher are typically used interchangeably in non-technical discussion. However, strictly speaking they are distinct concepts. In a military sense, codes were used to convert entire words or phrases into codegroups, e.g. "Attack at dawn" could be represented by AFGY, and you would need to work from a shared codebook to do the encoding and decoding.

In practical terms, a code is often used to represent characters (letters, numbers, etc) in a form that can be stored or transmitted by a particular system, such as Morse Code for the telegraph, ASCII for the computer, and Braille for blind readers. In a sense, these can be treated as substitution ciphers.

### Number Bases

Numbers are often expressed in the familar base 10 numbering system, but puzzles wil often use other base systems such as binary (base 2), octal (base 8), hexadecimal (base 16), and base 36. To write numbers in higher base systems, letters are added to represent digits larger than 10, so hexadeciimal uses A to Z to represent 11 through 15. Base 36 allows each position in a number to be a value from 0 to Z (35), so allows english words to be treated as numbers.

To convert between different number systems, up to base 36, try the online converter at gootar.com.

### ASCII

ASCII is a particularly important code, as it is one of the more common ways of converting between letters and numbers. In simple terms, it is just assigning different characters to the numbers 0 to 127 - including numerals, upper and lower case letters, punctuation, and "control codes". For example, see the Wikipedia ASCII Table. The numbers 0 to 127 can be represented using 7 binary bits, so this is often referred to as 7 bit ASCII. This is often extended into 8 bits to create extended, or 8 bit ASCII, and the numbers 128 to 255 are assigned additional symbols. For example, see the list at ascii-code.com.

8 binary bits can be represented as 2 hexadecimal digits, or 3 octal digits, and so ASCII values are often written as hexadecimal or octal (the Hex and Oct values at ascii-code.com).

There are plenty of online tools to convert between binary, octal, decimal and hexadecimal representations of ASCII text, such as Paulschou's Binary Translator. (This site currently seems to be offline. There is a mostly functional clone of it here).

### Base64, Base32, uuencode, etc

In order to communicate binary files over communication channels designed for ASCII text, various encoding schemes have been developed, such as Base32, Base64, Base58, Base85, uuencode, xxencode, yEnc, Quoted-printable, and BinHex,

Because these scramble the source data, they are often used as a means of encoding data in puzzles. Some of these are called "Base X", but they're not actually number base systems as described above.

Paulschou's Binary Translator will convert to and from Base32, Base64, and Base85 (also called ASCII 85).

Previous page: Ciphers

Next page: Alphabets & Number Systems