Number base converter

Type a number in any base and see it in all the others instantly.

This free binary, hex and decimal converter works in your browser. There is no fixed size limit, because everything runs on your device. It works in current browsers on phones, tablets and computers. All inputs and calculations run locally on your device without server uploads; details on browser processing and storage are set out in the privacy policy.

How bases work

A base says how many different digits a number system uses. Decimal uses ten (0–9). Binary uses two (0 and 1), which is how computers store everything. Hexadecimal uses sixteen (0–9 then A–F), so one hex digit stands for exactly four binary digits, which makes long binary numbers easier to read.

DecimalBinaryOctalHex
10101012A
15111117F
16100002010
25511111111377FF
1024100000000002000400

Good to know

  • Prefixes such as 0x, 0b and 0o are accepted and ignored.
  • There is no size limit: numbers are handled exactly with big integers.
  • Negative numbers are shown with a minus sign rather than as two’s complement.
  • Base 36 uses all digits and letters, and is used for short IDs.

Worked example: Converting 255 and 4096 between binary, octal, decimal, and hex

Every positional base expresses the same integer as powers of its radix (`2`, `8`, `10`, or `16`). Take the decimal integer `2,540`:

  • Decimal (base 10) to Hexadecimal (base 16): Divide repeatedly by 16: `2540 ÷ 16 = 158` remainder `12` (`C`); `158 ÷ 16 = 9` remainder `14` (`E`); `9 ÷ 16 = 0` remainder `9`. Reading remainders from last to first gives `9EC` (`(9 × 256) + (14 × 16) + 12 = 2,304 + 224 + 12 = 2,540`).
  • Hexadecimal `9EC` to Binary (base 2): Replace each hex digit with its exact 4-bit nibble (`9 = 1001`, `E = 1110`, `C = 1100`): `100111101100` (12 bits).
  • Binary to Octal (base 8): Group the 12 binary bits into threes from right to left (`100 111 101 100`) and convert each 3-bit group (`4`, `7`, `5`, `4`): `4754` in octal.

Limits and what this tool cannot do

  • Unsigned whole integers only (no fractional parts like `0.1011₂` or two's complement negatives): This tool converts non-negative whole numbers (`0` and above). It does not convert fractional binary floats (IEEE 754 `0x3F800000`) or interpret leading `1` bits as negative 8-bit/32-bit two's complement integers.
  • Do not include language prefixes (`0x`, `0b`, `0o`): Enter the raw digits for that base—for example type `FF00` in the Hexadecimal field rather than `0xFF00`.
  • Bases supported: The four standard computing bases—Binary (base 2), Octal (base 8), Decimal (base 10), and Hexadecimal (base 16)—are displayed side by side.

Questions

How do I convert hex to decimal?

Type the hex number in the Hexadecimal box; the decimal value appears instantly.

Can it convert fractions?

No. Only whole numbers are supported.

What is base 64?

Base64 is an encoding for data, not a number base. Use the Base64 tool for it.

Why do programmers use hexadecimal instead of binary?

Because `16 = 2^4`, every single hexadecimal digit (`0–F`) maps to exactly 4 binary bits (one nibble), and two hex digits (`00–FF`) map to 1 byte (8 bits). Writing `DEAD BEEF` is far less error-prone than reading a 32-character string of 1s and 0s.

How big of a number can this converter handle without losing precision?

Because it uses JavaScript BigInt arbitrary-precision integers under the hood rather than 53-bit Numbers, you can convert 64-bit, 128-bit, or 256-bit integers (such as SHA-256 hex hashes) with exact last-bit accuracy.

Where is octal (base 8) still used today?

Unix and Linux file permissions (`chmod 755`, where each octal digit `0–7` represents the 3-bit `rwx` flags) and C/TAR header fields use octal notation.

Last reviewed .

Related converters and guides