Free tool · Exact at any size
Number base converter
Binary, octal, decimal, hexadecimal and any base from 2 to 36 — with exact arithmetic, so a 64-bit identifier converts correctly instead of quietly losing its last digit the way parseInt does.
Hex is just binary in fours
This is the whole reason hexadecimal exists, and once it clicks the conversion needs no arithmetic at all. Sixteen is two to the fourth, so one hex digit is exactly four binary digits — always, with no carrying between them.
So A7 is 1010 0111: A is 1010 and 7 is 0111, read off separately and pushed together. It works in both directions, which is why a byte is always exactly two hex digits and why memory addresses and colour codes are written in hex rather than decimal.
Octal is the same trick with three bits per digit, which is why Unix file permissions are octal: rwx is three bits, so 755 is 111 101 101 and each digit is one group's permissions exactly.
Where other converters go wrong
JavaScript numbers are doubles, and a double stores integers exactly only up to 9,007,199,254,740,991 — two to the 53rd, minus one. Past that, the gaps between representable integers are larger than one.
So parseInt("9007199254740993") returns 9007199254740992. One out. No error, no warning, no indication that anything was lost — and every converter built the obvious way inherits it.
That is not an edge case for anyone working with real systems. A 64-bit database id, a Twitter-style snowflake id, a hash fragment, a permission mask — all of them live above that line. This page uses BigInt throughout, which is exact at any size, and warns you when you have crossed into the range where the shortcut would have failed.
A check you can run against any converter: enter 18446744073709551615, the largest unsigned 64-bit value. The correct hexadecimal is FFFFFFFFFFFFFFFF. If a tool gives you anything else, it is rounding.
What the odd bases are for
- Base 2 — what the hardware actually does. Everything else is a way of writing it that humans can hold in their head.
- Base 8 — three bits a digit. Survives mainly in Unix file permissions.
- Base 16 — four bits a digit, so two digits per byte. Colours, memory addresses, hashes, MAC addresses.
- Base 36 — digits plus the Latin alphabet. The densest you can get with plain alphanumerics and no case sensitivity, which is why it shows up in short ids and URL slugs.
- Base 12 — divides evenly by 2, 3, 4 and 6, which is why so many old measures come in twelves. Mostly of historical interest, and it is in the "another base" box if you want it.
Questions
How do I convert hex to binary by hand?
One hex digit at a time, four bits each: A = 1010, F = 1111, 7 = 0111. No arithmetic, no carrying. That is the entire reason hexadecimal is used — 16 is 2 to the fourth, so the two line up perfectly and a byte is always exactly two hex digits. The working is shown above the fold for whatever you enter.
Why did another converter give a different answer?
If the number was above 9,007,199,254,740,991, it was almost certainly rounding. Most converters use parseInt, which produces a double, and a double cannot hold every integer above that: parseInt of 9007199254740993 returns 9007199254740992, with no error and no warning. This page uses BigInt, which is exact at any size. Try 18446744073709551615: the right hex answer is FFFFFFFFFFFFFFFF.
Is there a size limit?
No practical one. The arithmetic is BigInt, so a 64-bit value, a 256-bit hash or a 300-digit decimal all convert exactly; a very long number only takes marginally longer.
Why does base 36 exist?
Because 36 is the number of digits and Latin letters together — 0 to 9 and a to z — so it is the densest base you can write with plain alphanumerics and no case sensitivity. It shows up in short identifiers and URL slugs for exactly that reason: it packs a large number into few characters that survive being typed out or read aloud.
More tools
- Base64 & URL encoderBoth directions, with correct UTF-8 — a plain btoa throws on Arabic and emoji and quietly returns a different string for an accent. Both fixed here.
- JSON formatterFormat, minify and validate — and when it breaks, the exact line, column and caret, because browsers do not give a position for the mistakes people actually make.
- Colour contrast checkerThe ratio, the AA and AAA verdicts, HEX/RGB/HSL conversion — and the nearest shade of your own colour that passes, so a failure arrives with a fix.
- Age calculatorExact age in years, months and days — worked out on the calendar rather than by dividing by 365 — with the Hijri date and the next birthday.
- BMI calculatorYour BMI on both the WHO international thresholds and the Asian cut-offs, where the risk starts lower — plus your healthy weight range in kg. Most calculators show only the first.
- Car & home financeConventional instalments, Ijarah and Diminishing Musharakah worked out as they actually are — not one EMI printed under three headings, which is what every other calculator does.
All free, all running entirely in your browser. Built by Maxverse Lab, a remote software studio. Every tool.