Number Base Converter
Type in any box and every other base updates. Binary, decimal, hex, octal and any base to 36, with exact big numbers, a clickable bit view, and text to binary.
Type in any box
Bit view (click a bit to flip it)
Exact, even for huge numbers
Uses exact big-integer arithmetic, so 64-bit values and far larger numbers convert without the rounding that ordinary calculators introduce.
See the bits
The clickable bit view shows any number in 8, 16, 32 or 64 bits, with both its unsigned and two's complement signed meaning.
Private
All conversions happen in your browser. Nothing you type is uploaded or stored.
Quick reference
Binary uses 0 and 1, octal uses 0 to 7, decimal uses 0 to 9, and hexadecimal uses 0 to 9 then A to F (A is 10, F is 15). Each hex digit stands for exactly four binary digits, which is why programmers use hex as shorthand for binary.
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0000 | 0 | 0 |
| 5 | 0101 | 5 | 5 |
| 10 | 1010 | 12 | A |
| 15 | 1111 | 17 | F |
| 16 | 1 0000 | 20 | 10 |
| 255 | 1111 1111 | 377 | FF |
Working with colours or IDs? See the Base64 and URL encoderor the UUID generator. For times stored as numbers, use the epoch converter.
Frequently Asked Questions
How do I convert binary to decimal?▼
Type the binary number into the Binary box and the decimal answer appears in the Decimal box straight away. By hand, each binary digit is a power of two counted from the right: 1011 is 1×8 + 0×4 + 1×2 + 1×1 = 11. Typing in any box updates all the others, so the same tool converts decimal to binary, hex to decimal, and every other pairing.
How do I convert decimal to hexadecimal?▼
Type the decimal number into the Decimal box and read the Hexadecimal box. By hand, divide by 16 repeatedly and write the remainders backwards, using the letters A to F for 10 to 15. For example, 255 ÷ 16 is 15 remainder 15, so 255 is FF.
How large a number can I convert?▼
Very large. The converter uses exact whole-number arithmetic rather than ordinary floating-point numbers, so a 40-digit hexadecimal value converts without any rounding. Ordinary calculators lose accuracy above about 9 quadrillion (2 to the power of 53). You can enter up to 4,000 digits.
What is two's complement, and how are negative binary numbers written?▼
Computers store negative whole numbers in two's complement: to negate a number, flip every bit and add one. In 8 bits, 11111111 means -1 and 10000000 means -128. The bit view under the converter shows a number in 8, 16, 32 or 64 bits and reads the same pattern both ways, unsigned (0 to 255 in 8 bits) and signed (-128 to 127), so you can see exactly what a given bit pattern means.
Can I convert text to binary, and binary back to text?▼
Yes. Open the Text and bytes tab, type or paste text, and choose binary, hex, decimal or octal. Text is converted as UTF-8, so a capital H is 01001000 in binary and 48 in hex, and a euro sign becomes the three bytes E2 82 AC. Paste bytes into the other box to turn them back into text.
What do the prefixes 0x, 0b and 0o mean?▼
They are programming shorthand that says which base a number is written in: 0x for hexadecimal (0xFF), 0b for binary (0b1010) and 0o for octal (0o17). You can paste a number with its prefix and it is read correctly. Spaces, commas and underscores inside a number are ignored too, so 1111 0000 and 1_000_000 work.
Does it support other bases, like base 36 or base 3?▼
Yes. The Custom base box converts to and from any base from 2 to 36. Bases above 10 use the letters A to Z for the digits above 9, so base 36 uses all ten digits plus the whole alphabet.
Is anything uploaded?▼
No. All conversions run on your device and nothing you type is sent anywhere or stored.