Number Base Converter

Convert whole numbers between binary, octal, decimal, hexadecimal or any base from 2 to 36. Very long numbers are handled exactly.

How number bases work

A base (or radix) tells you how many different digits a number system uses. Decimal uses ten digits (0–9). Binary uses two (0 and 1), octal uses eight (0–7) and hexadecimal uses sixteen (0–9 and A–F, where A = 10 and F = 15). Each position is worth the base times the position to its right: in decimal 345 means 3×100 + 4×10 + 5×1.

Quick reference

Decimal Binary Octal Hex
0 0 0 0
1 1 1 1
2 10 2 2
3 11 3 3
4 100 4 4
5 101 5 5
7 111 7 7
8 1000 10 8
10 1010 12 A
15 1111 17 F
16 10000 20 10
32 100000 40 20
64 1000000 100 40
100 1100100 144 64
127 1111111 177 7F
128 10000000 200 80
255 11111111 377 FF
256 100000000 400 100
1000 1111101000 1750 3E8
1024 10000000000 2000 400
4096 1000000000000 10000 1000
65535 1111111111111111 177777 FFFF

Frequently asked questions

Can I use letters in a number?

Yes, in bases above 10. Hexadecimal uses A–F, and base 36 uses all letters A–Z. Letters are not case-sensitive.

Does it work with negative numbers?

Yes. Put a minus sign in front, for example -1010 in binary is -10 in decimal.

Can I paste prefixes like 0x or 0b?

Yes. Prefixes 0x, 0b and 0o are ignored automatically, and spaces or underscores between digits are removed.

See all converters