Number Base Converter

Type a whole number, say which base it is in, and see it in binary, octal, decimal, hex and any other base up to 36. Big numbers stay exact.

How it works

A base is how many different digits a number system uses. Decimal has ten (0 to 9), binary has two (0 and 1), octal has eight, and hexadecimal has sixteen, borrowing a to f for the values 10 to 15. Bases above 10 keep borrowing letters, up to base 36, where z stands for 35.

The tool reads your number in the base you pick, then writes the same value out in every other base. It uses JavaScript’s BigInt, which has no size limit, so a 64-bit database ID or a 128-bit hash converts exactly. Ordinary JavaScript numbers start rounding after 9,007,199,254,740,991, and many converters quietly give wrong answers past that point.

Everything runs on this page. Nothing you type is sent anywhere.

How to use it

  1. 1 Type or paste the number. Spaces and underscores between digits are fine, and so is a 0x, 0b or 0o prefix that matches the base.
  2. 2 Pick the base it is written in: Binary, Octal, Decimal, Hex, or Other for any base from 2 to 36.
  3. 3 Read the results. Pick another base under "Also show it in base" for a fifth answer.
  4. 4 Use the Copy button next to any result, or copy them all at once.

Good to know

  • Hex digits are shown in lower case. Upper and lower case are both accepted when you type.
  • If a digit does not exist in the base you picked, such as a 2 in binary, the tool names it and its position.
  • A minus sign works. The tool shows negative numbers with a minus, not in two’s complement, because two’s complement depends on a fixed width that a plain number does not have.
  • Only whole numbers are converted. Fractions such as 0.1 have no exact form in many bases, so they are left out rather than rounded.

Browser support

  • Chrome 94 and later
  • Firefox 93 and later
  • Safari 16.4 and later
  • Edge 94 and later

These are the oldest versions with everything the tool uses. They are worked out from the tool itself, so they change when it does.

Version numbers checked on 2026-09-04.

Converting 2024 to binary, octal and hex by hand

Every base works the same way. Each digit is worth the base times as much as the digit to its right. In decimal, the 2 at the front of 2024 is worth 2 thousands, because a thousand is 10 times 10 times 10. In binary each place is worth twice the place to its right: 1, 2, 4, 8, 16 and so on. In hex each place is worth 16 times more: 1, 16, 256, 4096. Once that idea clicks, converting is just arithmetic, and it is worth doing once by hand to trust the tool.

To write 2024 in binary, take away the largest power of two that fits, again and again. 1024 fits, leaving 1000. Then 512 leaves 488, 256 leaves 232, 128 leaves 104, 64 leaves 40, 32 leaves 8, 16 does not fit, 8 leaves 0, and 4, 2 and 1 do not fit. Writing a 1 for each power used and a 0 for each skipped, from 1024 down to 1, gives 11111101000. That is eleven bits, which is why the tool says 2024 needs 11 bits.

Octal and hex fall straight out of the binary. Each octal digit is exactly three bits, so split the binary into threes from the right: 11 111 101 000. Those groups are 3, 7, 5 and 0, so 2024 is 3750 in octal. Check it: 3 times 512 is 1536, 7 times 64 is 448, 5 times 8 is 40, and 1536 plus 448 plus 40 is 2024. Each hex digit is exactly four bits, so split into fours instead: 111 1110 1000. Those are 7, 14 and 8, and 14 is written e, so 2024 is 7e8 in hex. That shortcut is the whole reason programmers use hex: it is binary, four bits at a time, in a form people can read.

For bases that are not powers of two, divide instead. Divide 2024 by 36 and you get 56 with 8 left over. Divide 56 by 36 and you get 1 with 20 left over. The remainders, read from last to first, are the digits: 1, then 20, then 8. In base 36, 20 is written k, so 2024 is 1k8. The tool does exactly this, with BigInt so the division is exact at any size.

Size is where most converters go wrong. A normal JavaScript number holds integers exactly only up to 9,007,199,254,740,991, which is 2 to the 53rd power minus one. Type 9007199254740993 into a converter built on ordinary numbers and it comes back as ...992, because the true value cannot be stored. Twitter and Discord IDs, 64-bit hashes and IPv6 addresses are all past that limit. This page never turns your digits into an ordinary number, so it gives the exact answer every time.

There are limits worth stating. The tool converts whole numbers only; fractions are not supported. Negative numbers are shown with a minus sign rather than in two’s complement, because two’s complement only means something once you fix a width such as 8 or 32 bits. And the digits above 9 are the usual 0 to 9 then a to z alphabet, not the Base64 alphabet or any custom one.

Frequently asked questions

How big a number can I convert?

In practice, as big as you can paste. The tool uses BigInt arithmetic, so a 40-digit number converts as exactly as a 4-digit one. A number with hundreds of thousands of digits will slow the page down, but it will not lose digits.

Why does 0b101 work in binary but not in hex?

A prefix is only removed when it matches the base you picked: 0x for hex, 0b for binary, 0o for octal. In hex, "b" is a real digit, so 0b101 is read as the hex number b101, which is 45,313 in decimal.

Can it convert text to binary?

Not on this page. This converts numbers. To see the bytes behind text, such as "Hi" as 01001000 01101001, use the Text to Hex tool, which shows each UTF-8 byte.

What do bases above 16 look like?

They carry on through the alphabet: g is 16, h is 17, and z is 35. Base 36 is handy for short IDs, since it packs a large number into few characters. 2024 in base 36 is 1k8.

Related tools

Your files are processed on your device and are not uploaded. You can verify this in your browser’s developer tools under the Network tab.