Number Base Converter

Type a number in any box and the others update instantly. It handles numbers of any size, accepts prefixes like 0x and 0b, and shows how the value looks as a signed or unsigned 8, 16, 32 or 64-bit integer.

More views

How number bases work

A base (or radix) is how many digits a number system uses. Decimal uses ten (0–9), binary two (0 and 1), octal eight (0–7) and hexadecimal sixteen (0–9 then A–F). Each position is worth the base times the position to its right, so hex 2F is 2 × 16 + 15 = 47.

Where you meet each base

Negative numbers and two's complement

Computers store negative integers in two's complement: the value −1 in 8 bits is 11111111 (0xFF), the same bits as unsigned 255. The table above shows both readings for 8, 16, 32 and 64-bit widths whenever the number fits. This explains why a byte read from a file might show as −56 in Java (whose byte is signed) but 200 elsewhere.

Converting in code

Frequently asked questions

How do I convert binary to decimal?

Type or paste the binary number into the Binary box; the decimal value appears immediately. By hand, add the powers of two where there is a 1: 1011 = 8 + 0 + 2 + 1 = 11.

Is there a size limit?

No. The converter uses arbitrary-precision integers, so numbers with hundreds of digits convert exactly, without the rounding you get beyond 2^53 in ordinary JavaScript numbers.

Can I paste values with 0x or 0b prefixes?

Yes. 0x, 0b and 0o prefixes are accepted, as are spaces, underscores and commas used as digit separators.

Does it convert fractions?

No, only whole numbers (positive or negative). Fractions often have no exact representation in another base; for example 0.1 in decimal repeats forever in binary.

Is anything sent to a server?

No. Conversion happens in your browser.