Number Base Converter

Use this number base converter to move any whole number between binary, octal, decimal and hexadecimal — exactly, even for numbers far too large for an ordinary calculator.

1Type your number
2Choose the base it is written in, and the base you want
3Read the result — all four bases are shown at once
BaseValue
Binary (2)—
Octal (8)—
Decimal (10)—
Hexadecimal (16)—

Private by design: 100% in your browser — nothing is uploaded, no sign-up. This tool runs entirely on your device.

A number base is simply a counting style. Decimal, the system everyone learns first, counts in tens — probably because of our fingers. Computers count in twos, and programmers spend their days translating between the machine's binary and two shorthand systems, octal and hexadecimal, that keep binary readable. This converter moves any whole number between all four bases instantly, and shows every base at once so you can compare them side by side.

What makes this converter different from a pocket calculator is its arithmetic. Ordinary calculators — and ordinary JavaScript — store numbers in a format that quietly rounds whole numbers longer than about sixteen digits. Convert a twenty-digit number that way and the last digits come back wrong. This tool parses and converts with BigInt, an exact whole-number system with no size limit, so a hundred-digit value converts digit-for-digit perfectly, in either direction.

How base conversion works

Every base uses the same positional idea: each digit's place is worth a power of the base. In decimal, 255 means 2×100 + 5×10 + 5. In binary, each place is a power of two, so 255 is 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 — eight ones in a row, 11111111. Hexadecimal groups binary neatly: since sixteen is two to the power of four, every hex digit is exactly four binary digits, so 1111 1111 becomes FF. Octal does the same trick in threes: 111 111 111 regroups as 377. Once you see that bases 8 and 16 are just binary in groups, conversions stop being arithmetic and become pattern-matching — which is precisely why programmers love them.

Example: 255 in every base

The most famous number in computing, in all four systems:

Base255 written in that baseWhy it matters
Binary (2)11111111The largest value in one byte — eight bits, all on
Octal (8)377The same byte, grouped in threes
Decimal (10)255Everyday counting
Hexadecimal (16)FFWhy colours like #FFFFFF contain F pairs

And a bigger step: 1000 in decimal is 3E8 in hexadecimal, 1111101000 in binary and 1750 in octal — type it into the tool and watch all four appear together. Values with special meaning are worth memorising: 255 (a full byte), 65,535 (two full bytes) and 16,777,216 (the number of colours in 24-bit colour, and the point where simple number formats start to struggle).

Reading the prefixes: 0b, 0x and a leading 0

Because the same digits can mean different values in different bases — is “10” two, eight, ten or sixteen? — programmers label numbers with prefixes. A leading 0b means binary (0b1111 = 15), 0x means hexadecimal (0xFF = 255), and in many programming languages a plain leading zero means octal (0755 = 493 in decimal, the permission example from the questions below). When you meet a number wearing one of these prefixes in code or documentation, strip the prefix off, set the “from” base to match, and this converter will tell you the everyday decimal value — and every other base besides.

Converting by hand follows one repeated move: divide by the target base, keep each remainder, and read the remainders backwards. Turning 1000 into hex means dividing by 16 again and again — 1000 ÷ 16 is 62 remainder 8, 62 ÷ 16 is 3 remainder 14 (written E), and 3 ÷ 16 is 0 remainder 3 — reading up gives 3E8. The converter simply does those divisions at BigInt scale, hundreds of digits deep, without tiring or slipping.

Where each base earns its keep

Binary is the machine's native tongue — memory, processors and network packets are all binary underneath. Hexadecimal is the programmer's reading glasses: memory addresses, colour codes in web design (#2563eb is a shade of blue), MAC addresses and file signatures are all written in hex because it is four times shorter than binary and maps onto it perfectly. Octal survives in Unix file permissions, where 755 neatly packs three groups of three permission bits. Decimal remains the language of humans, money and measurement. Being able to slide a value between all four — and trust the last digit — is a small skill that pays off every single week in technical work.

Frequently asked questions

What are the four number bases in this converter?

Binary (base 2, digits 0–1), octal (base 8, digits 0–7), decimal (base 10, digits 0–9) and hexadecimal (base 16, digits 0–9 plus the letters A–F). They are the four bases that come up constantly in computing.

How do I convert a decimal number to hexadecimal?

Type the number, set “from” to Decimal (10) and “to” to Hexadecimal (16). For example, 255 becomes FF. The results table under the tool always shows all four bases at once, so you can read the hex value straight from there too.

Why does hexadecimal use the letters A to F?

Base 16 needs sixteen distinct digit symbols, but ordinary digits only provide ten. The letters A–F stand in for the values ten to fifteen, which keeps every hex digit a single character — exactly four binary digits each.

How large a number can this converter handle?

Far larger than a normal calculator. The conversion is done with BigInt arithmetic, which is exact for whole numbers of any size — hundreds of digits included. Ordinary JavaScript numbers silently lose precision beyond about 16 digits; this converter never does.

Why does the converter reject my number?

Every digit must be legal in the base you chose: binary accepts only 0 and 1, octal 0–7, and hexadecimal 0–9 and A–F. A “2” in a binary number, or a “G” in a hex number, is rejected with a note naming the offending digit.

Can I convert negative numbers?

Yes. Put a minus sign in front and the converter keeps it through every base — −255 in decimal is −FF in hexadecimal and −11111111 in binary. This is sign-and-magnitude notation, the clear way to write negative values by hand.

What is the difference between this and two's complement?

Two's complement is how processors store negative numbers in a fixed number of bits — −1 becomes 11111111 in 8 bits, with no minus sign. This converter uses ordinary mathematical notation with a minus sign, which is what you want for maths, study and checking values by hand.

Where are octal numbers still used?

Most visibly in Unix and Linux file permissions: a permission like 755 is an octal number, three digits of three bits each. Octal also appears in older computing documentation and some embedded systems, which is why it earns its place in the converter.

Is this number base converter free and private?

Yes. It is free with no sign-up, and the conversion runs in JavaScript inside your own browser — the numbers you enter are never uploaded, stored or logged anywhere.

Related tools