Number Base Converter

Convert between binary, octal, decimal, hex — or ASCII text — with every base shown at once, correct at any size.

Every base updates as you type; click bits to toggle them. Digit separators (_, spaces) are allowed. In two's complement mode the binary/octal/hex rows show the bit pattern and the decimal row shows the signed value. Choose Text to convert ASCII/UTF-8 text to bytes in any base — or bytes back to text.

How number bases work

A base-b number system uses b digits and place values that are powers of b. Binary (base 2) uses digits 0–1, octal (base 8) uses 0–7, decimal uses 0–9, and hexadecimal (base 16) extends to the letters A–F, where A = 10 and F = 15. The same quantity just wears different clothes: 255, FF, 377, and 1111 1111 are all one value.

Digits 0–15 in each base

DecimalBinaryOctalHex
0000000
1000111
2001022
3001133
4010044
5010155
6011066
7011177
81000108
91001119
10101012A
11101113B
12110014C
13110115D
14111016E
15111117F

Two's complement

Computers store signed integers as two's complement: to negate a number, invert every bit and add one. In an 8-bit register, 1111 1111 is −1 and 1000 0000 is −128. Switch the mode selector above to a width and the converter shows exactly what a CPU register of that size would hold — the bit pattern in binary/octal/hex, the signed value in decimal.

Popular conversions

Hex to binary · binary to hex · hex to decimal · decimal to hex · binary to decimal · decimal to binary · octal to decimal · decimal to octal · binary to octal · octal to binary · hex to octal · octal to hex

Frequently asked questions

Why does the bit grid sometimes disappear?
In unsigned mode it's shown for non-negative values up to 64 bits. Larger numbers still convert exactly — there's just no sensible fixed-width register view for them. Pick a two's complement width for a fixed grid.
What does the Text mode do?
Set From to Text and each character of what you type is shown as its UTF-8 byte value in every base — Hi becomes hex 48 69, binary 01001000 01101001. Set To to Text to go the other way: a number's bytes are decoded back into characters.
Does 0x or 0b work in the input?
Here, no — the From dropdown sets the base explicitly. Prefixed literals like 0xFF shine in the programmer's calculator, where you can mix bases inside one expression.