Skip to content
1001 Tools
sr
Math & education

Number Base Converter

Enter a whole number and pick its base — binary, octal, decimal or hexadecimal — and see it in all four at once. It uses arbitrary-precision integers, so even 64-bit and larger values convert exactly without rounding. Everything runs on your device.

Enter a number and choose its base.

Non-negative whole numbers only. Uses arbitrary precision, so very large values convert exactly.

How it works

Each base is a positional system: binary uses 2 digits, octal 8, decimal 10, and hexadecimal 16 (0–9 then A–F). The tool parses your input in its stated base into an exact integer, then renders that integer back out in every base. Choosing the wrong base — say a “2” in a binary field — is flagged as invalid rather than misread.

Because it uses BigInt, there’s no 2⁵³ safe-integer ceiling that trips up ordinary JavaScript: a 64-character binary string or a long hex hash converts precisely. Whitespace in the input is ignored, so you can paste grouped digits like 1111 0000.

Practical examples

Decimal to hex for a colour

The decimal 255 is FF in hex, 377 in octal and 11111111 in binary — the reason 255 is the maximum of one colour channel in #RRGGBB.

Reading a hex value

Enter 1F4 as hex and you get 500 in decimal — handy for decoding addresses, status codes or byte values shown in hexadecimal.

A full byte in binary

Type 11111111 as binary to confirm it’s 255 decimal and FF hex — one byte at its maximum, the building block of how computers store numbers.

Frequently asked questions

What do binary, octal, decimal and hexadecimal mean?

They’re number systems with 2, 8, 10 and 16 symbols respectively. Decimal is everyday counting; binary is how computers store data; hexadecimal is a compact way to write binary (one hex digit = four bits); octal groups bits in threes and appears in file permissions.

Why is hexadecimal used so much in computing?

One hex digit maps exactly to four binary bits, so a byte is just two hex digits. That makes hex a compact, readable stand-in for long binary strings — which is why colours, memory addresses and hashes are written in it.

Can it handle very large numbers?

Yes. It uses arbitrary-precision integers (BigInt), so values well beyond the usual 2⁵³ JavaScript limit — long hashes, 128-bit numbers — convert exactly with no rounding.

What counts as a valid digit for each base?

Binary allows 0–1, octal 0–7, decimal 0–9, and hex 0–9 plus A–F. If you enter a digit outside the chosen base — like 9 in binary — the tool reports invalid input instead of guessing.

Is hex input case-sensitive?

No. You can type hexadecimal in upper or lower case (ff or FF); both parse the same. Results are shown in uppercase, the common convention for hex.

Does it convert negative numbers or fractions?

No — it handles non-negative whole numbers, where base conversion is unambiguous. Negative numbers involve representation choices (like two’s complement) and fractions need a radix point, both beyond this tool’s scope.

Why can I paste numbers with spaces?

Long binary and hex values are often written in groups (1111 0000) for readability. The tool strips whitespace before parsing, so grouped input works without you having to remove the spaces.

Is the value I enter kept private?

Yes. The conversion runs entirely in your browser; nothing is uploaded and analytics never receives your input.

Related tools