Number Base Converter
Convert binary to decimal, hex to decimal and numbers between any bases from 2 to 36, with no size limit.
Runs in your browser. Nothing is uploaded.
How to use the Number Base Converter
- Type a number into Number and choose the base it's written in. Prefixes like
0x,0band0oand spaces or underscores between digits are fine. - The binary, octal, decimal and hexadecimal forms appear instantly. Copy any of them.
- Set Other base to any value from 2 to 36 to see the number in that base too.
- Below the results, see how many bits the number needs and the smallest integer types it fits in.
Number bases in a nutshell
A number base, or radix, is how many different digits a number system uses. We count in base 10
because we have ten fingers. Computers work in base 2, binary, because each bit is either off or on.
Programmers often use base 16, hexadecimal, because one hex digit stands for exactly four bits,
which makes long binary values short and readable. Octal, base 8, groups three bits per digit and
survives mainly in Unix file permissions such as chmod 755.
The value of a number doesn’t change between bases, only the way it’s written. 255 in decimal is
11111111 in binary, 377 in octal and FF in hex: the largest value one byte can hold.
How conversion works
Each digit is worth the base raised to the power of its position, counting from zero on the right.
Binary 1011 0110 is 128 + 32 + 16 + 4 + 2 = 182. Going the other way, you repeatedly divide by
the target base and read the remainders from bottom to top. The converter does this exactly with
big integers, so it never loses precision on large values the way a calculator or a spreadsheet
using floating-point numbers can once a value goes past 2^53.
Beyond the usual four
Any base from 2 to 36 works. Base 36, which uses all digits and letters, is popular for short IDs and URL slugs. Base 32 appears in some encodings, and unusual bases come up in maths homework and puzzles.
Bits and integer types
For each value the tool shows how many bits it needs and which standard integer types can store
it, for example “unsigned 8-bit, signed 16-bit”. That helps you choose a database column or a variable
type, or check whether a value will overflow. For negative numbers it also shows the two’s complement
pattern: -42 as a signed 8-bit integer is 1101 0110.
Input is forgiving
You can paste values the way they appear in code or documentation: 0xFF, 0b1010_1010 or
1111 0000. Separators are ignored, and if a character isn’t a valid digit in the chosen base, the
tool tells you which one and where.
Frequently asked questions
Is there a size limit?
No practical one. The converter uses arbitrary-precision integers, so 128-bit IDs, cryptographic values and numbers with hundreds of digits convert exactly, with no rounding.
Which digits are used above base 10?
Letters a to z, so base 16 uses 0–9 and A–F and base 36 uses 0–9 and A–Z. Input is case-insensitive.
How are negative numbers handled?
Type a minus sign. Each base shows the negative value with a minus sign, and the details show the two's complement bit pattern for the smallest signed integer type that holds it, which is how computers store it.
Can I convert fractions like 0.5?
Not here. This tool converts whole numbers. To see how a decimal fraction is stored in binary, use the IEEE 754 converter.
Does anything leave my browser?
No. All conversion happens locally.
Tutorials
How to convert binary to decimal and check your work
Learn the place-value method for converting binary to decimal by hand, then check the answer instantly with the converter.
How to convert decimal numbers to binary and hex
Convert a decimal number to binary, octal and hexadecimal in one step, check the bits it needs, and see negative numbers in two's complement.
How to convert hex colour codes to decimal RGB values
Turn a CSS hex colour like #FF5733 into red, green and blue values from 0 to 255 using a hex to decimal converter.