Math & Basic

Radix Converter

Convert between binary, octal and hexadecimal.

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.

Examples
BinaryOctalDecimalHex
10101210A
11111111377255FF
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.

What do A-F mean in hexadecimal?
Hexadecimal uses the letters A-F to represent 10-15 after 0-9. A=10, B=11, C=12, D=13, E=14, F=15. Case doesn't matter for input, but this tool always displays results in uppercase.
What happens if I enter an invalid digit for a base?
For example, binary only allows 0 and 1, and octal only allows 0-7. Entering a character not valid for the selected source base will show an error, so make sure your input matches the chosen base.
Can negative numbers be converted?
Yes, this tool supports negative integers prefixed with a minus (−) sign. The remaining characters must be valid for the selected source base, and the sign is preserved in the converted result.
Why do computers use binary?
Computer circuits reliably distinguish only two states: voltage present (on) and absent (off). This gives a far lower error rate than trying to distinguish 10 distinct states for decimal, which is why binary became the base representation for electronic circuits.
What does the hex color code #FF0000 mean?
Web color codes express the red, green, and blue (RGB) channels as two hex digits each (00-FF, i.e. 0-255 in decimal). #FF0000 means the red channel is FF (=255, maximum) while green and blue are 00 (=0), producing pure red.