Radix Converter
Convert between binary, octal and hexadecimal.
| 2 (binary) | 8 (octal) | 10 (decimal) | 16 (hex) |
|---|---|---|---|
What is the Radix Converter?
A radix (base) is a number system's counting base. Besides everyday decimal (base 10), this tool freely converts between binary, octal, and hexadecimal, which are common in computing.
How to use it
Enter a value, choose its from base, choose a to base, then press Convert. The ↔ button instantly swaps the from/to bases, and the result is shown simultaneously in base 2, 8, 10, and 16.
Formula & reference
The source string is parsed as an integer (parseInt(str, from)) and re-expressed in the target base (toString(to)). Hexadecimal results are shown in uppercase.
| Binary | Octal | Decimal | Hex |
|---|---|---|---|
| 1010 | 12 | 10 | A |
| 11111111 | 377 | 255 | FF |
Why computers use binary · a hex color code in practice
Computer circuits can reliably distinguish only two stable states: voltage present (on) and voltage absent (off). Trying to represent 10 decimal digits directly with 10 distinct voltage levels would make even small noise or voltage drift likely to flip a digit into the wrong reading. Binary needs to distinguish only 0 and 1, so its error rate is far lower — which is why it became the base representation for all digital circuits.
Hexadecimal is a human-friendly compression of binary, since exactly 4 binary digits (0000-1111) map to one hex digit (0-F). Web color codes are a familiar example: #FF0000 expresses the red, green, and blue (RGB) channels as two hex digits each. Converting 255 from decimal to hex in this calculator gives FF (255 = 15×16+15), which represents the maximum value the red channel can hold, while green and blue are 00 (=0) — producing pure red.
Octal notation in Linux file permissions: chmod 755
Linux/Unix file permissions are expressed as the sum of three bits — read (r=4), write (w=2), execute (x=1) — which always adds up to a value between 0 and 7, so they're written in octal. In chmod 755, the first digit, 7, is the owner's permission: 4+2+1 (rwx, read, write, and execute all allowed). The second and third digits, 5, are the group and other users' permissions: 4+1 (r-x, read and execute only, no write). Converting 755 from base 8 to base 10 in this calculator gives 493, treating it as one continuous octal number — which differs from reading each digit independently as its own 3-bit permission group, so file permissions must be interpreted digit by digit.