Security & devFree

Binary Hex Decimal Converter

Free binary, octal, decimal, and hexadecimal converter. Convert between number bases instantly in your browser.

Last updated 14 October 2026

Common uses

The arithmetic is exact at any size, which is unusual in a browser tool

This converter parses your number digit by digit into a BigInt, so there is no floating-point step and no rounding. That matters more than it sounds, because the ordinary number type in JavaScript cannot hold a whole number above 9,007,199,254,740,991 without losing precision, and most quick converters are built on it.

Measured here:

So you can paste a long identifier, a hash fragment or a large key value in here and trust the result. If you need to check it, convert the answer back the other way.

Negative numbers and decimal points are refused, not rounded

The parser accepts only digits valid for the base you chose, and a minus sign and a full stop are not digits. Measured, both in decimal:

Refusing is the right behaviour, because there is no single correct answer to either question. A negative number in binary could be a sign bit, one’s complement or two’s complement, and those give three different answers for the same input, depending on a word size nobody has told the tool. A fraction in another base is usually non-terminating, so it would need a precision the tool would have to guess. Both would mean inventing an assumption and presenting it as a result.

If you need two’s complement, decide your word width first, add the number to that power of two, and convert the result: for an 8-bit representation of -5, convert 251. If you need a fraction, convert the whole part here and work out the fractional digits separately.

It is tolerant about how you type the number and strict about the digits

Before parsing, the input is trimmed, all internal whitespace is removed, and a leading 0x or 0b is dropped. Measured:

What it will not forgive is a digit that does not belong to the base. Measured: 12 in binary gives “Invalid digit for base 2”, because there is no digit 2 in binary. That message does not say which character was wrong or where, so on a long string you have to find it yourself. The usual culprits are a letter O typed for a zero, a letter l for a one, and a hex string pasted while the base is still set to decimal.

You always get all four bases out, whichever one you came from

The input base is a choice between binary, octal, decimal and hexadecimal, and the output is always all four at once. There is no arbitrary base: you cannot convert to base 7 or base 36 here, and there is no option to.

Hex output is upper case and binary output has no grouping, so a 32-bit value arrives as 32 unbroken digits. If you want it in bytes of eight, Text to Binary groups its output that way, though it works on text rather than on a number.

What this tool deliberately does not do

Nothing is uploaded. The conversion is a few lines of JavaScript running in your browser, and the number never leaves your device.

Sources

Every behaviour and every converted value on this page was measured against this tool as it is published, in a browser, on 14 October 2026. Where the page says what the tool does not do, that is a statement about this tool, not about base conversion in general.

Frequently asked questions

Can it handle very large numbers without rounding?

Yes, and that is the main reason to use it. The parsing is done with an exact integer type rather than an ordinary number, so there is no floating-point step. Measured: 9007199254740993, two above the point where ordinary JavaScript numbers lose precision, converts exactly, and so does a 40-digit decimal.

Why will it not convert -5?

Because a minus sign is not a digit, and because there is no single right answer. Negative binary could be sign-and-magnitude, one’s complement or two’s complement, and each gives a different result for a word size the tool has not been told. It refuses rather than guessing. For 8-bit two’s complement, add 256 and convert 251 instead.

Why will it not convert 10.5?

Same reason: a full stop is not a digit. A fraction in another base is usually non-terminating, so the tool would have to pick a precision and present a rounded answer as exact. Convert the whole part here and handle the fractional digits separately.

What does “Invalid digit for base 2” mean?

Your input contains a character that does not exist in that base, such as a 2 in binary or a G in hex. The message does not say which character or where, so on a long string look for a letter O typed instead of a zero, a letter l instead of a one, or a hex value pasted while the base is still set to decimal.

Can I paste binary with spaces in it?

Yes. All whitespace inside the value is removed before parsing, so 1010 1010 converts fine and gives 170. A leading 0x or 0b is also stripped, and leading zeros are harmless.

Can I convert to base 36, or base 7?

No. The input is binary, octal, decimal or hexadecimal, and you always get all four of those back. There is no arbitrary-base option.

Can it tell me which letter a number is?

No, this tool converts numbers between bases and knows nothing about characters. For the relationship between text and its bytes, use Text to Binary, which encodes text as UTF-8 and shows the bits.

Is my number sent anywhere?

No. The conversion happens in your browser and nothing leaves the page. Nothing is saved either, so refreshing loses what you typed.

Related tools