Number Base Converter

Convert numbers between binary, octal, decimal, hexadecimal and any base from 2 to 36.

0b
0o
0x

Bits

As unsigned
255
As signed (two's complement)
-1
Bits needed
8
Bytes
1

Click any bit to flip it. Bit 0, on the right, is the least significant.

This number base converter translates numbers between binary, octal, decimal, hexadecimal and any base from 2 to 36 as you type. Type into any field and the others update. It handles negative numbers and numbers of any length exactly, and shows the bit pattern a computer uses to store the value. Everything runs in your browser.

How number bases work

A base says how many different digits a number system uses. Decimal (base 10) uses 0-9, and each position is worth ten times the one to its right. Binary (base 2) uses only 0 and 1, so each position is worth twice the previous one: 1101 in binary is 8 + 4 + 0 + 1 = 13. Hexadecimal (base 16) adds the letters A-F for the values 10 to 15, which makes it a compact way to write binary - every hex digit is exactly four bits, so 0xFF is 1111 1111.

Where you meet each base

  • Binary - bit flags, network masks and how hardware stores data.
  • Octal - Unix file permissions such as chmod 755.
  • Hexadecimal - colors like #5B3DF5, memory addresses, byte dumps, hashes and UUIDs.
  • Base 36 - short IDs and URL shorteners, since it uses every digit and letter.

Negative numbers and two's complement

Computers store negative whole numbers using two's complement: in 8 bits, -1 is 1111 1111 - the same bits as 255. Which one it means depends on whether the program treats the number as signed or unsigned. The bit view shows both readings for 8, 16, 32, 64 and 128-bit widths, which helps when a value from a database, a C program or a network packet looks unexpectedly negative or huge.

Frequently asked questions

Can I paste numbers with prefixes or separators?

Yes - 0x, 0o and 0b prefixes are understood in their matching fields, and spaces, underscores and (in decimal) commas are ignored, so 0xFF_FF and 1,000,000 both work.

Is there a size limit?

No practical one. The converter uses JavaScript's BigInt, so even 100-digit numbers convert exactly, unlike calculators that round anything above 253.

Does it convert fractions?

No - it works with whole numbers, which is what programming, permissions, colors and bit masks use.

Related tools

Convert colors between HEX and RGB with the Color Converter, compute checksums with the Hash Generator, or browse all Developer tools.

Runs entirely in your browser - nothing you enter or upload is sent to a server.