Security & devFree
Free binary, octal, decimal, and hexadecimal converter. Convert between number bases instantly in your browser.
Last updated 14 October 2026
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:
9007199254740993, which is that limit plus two and the classic case an ordinary number gets wrong, converts to hex 20000000000001 and comes back exactly.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.
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:
-5 gives “Invalid digit for base 10”.10.5 gives the same message.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.
Before parsing, the input is trimmed, all internal whitespace is removed, and a leading 0x or 0b is dropped. Measured:
0xFF in hex gives 255. 0b1010 in binary gives 10.1010 1010 in binary gives 170, so you can paste bytes with spaces in them.ff in hex gives 255, so case does not matter on input.0000042 in decimal gives 42; leading zeros are harmless.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.
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.
Nothing is uploaded. The conversion is a few lines of JavaScript running in your browser, and the number never leaves your device.
Number.MAX_SAFE_INTEGER. developer.mozilla.orgBigInt. developer.mozilla.orgBigInt.prototype.toString. developer.mozilla.orgEvery 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.
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.
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.
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.
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.
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.
No. The input is binary, octal, decimal or hexadecimal, and you always get all four of those back. There is no arbitrary-base option.
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.
No. The conversion happens in your browser and nothing leaves the page. Nothing is saved either, so refreshing loses what you typed.