QuickUnits

Digital

Number base

These number systems are bases, not units — the same number is written differently depending on whether the base is 2, 8, 10 or 16.

—

All units 15


About these units

The category covers binary, octal, decimal, hexadecimal and bases used in special contexts. A hexadecimal 0xFF is 255 in decimal, and 0b1010 is 10. The base determines which digits exist: only 0 and 1 in base 2, plus A–F in base 16.

The most common mistake is reading a number with a leading zero as decimal. In many programming languages 010 means octal, that is 8 — an error that is easy to introduce and hard to see. The second is confusing character encoding with number base: 0x41 is 65 and corresponds to A in ASCII, but the two are not the same conversion.