Base Number Converter
Binary, octal, decimal, hex and any base up to 36.
About Base Number Converter
Convert a number between binary, octal, decimal, hexadecimal or any base from 2 to 36. Values of any length are handled exactly with BigInt; nothing is rounded.
How to use
- Type a number and pick the base it is written in (default base 10).
- The equivalents in binary, octal, decimal and hexadecimal update as you type, each with a Copy button; Copy on the panel copies all rows.
- Choose a fifth base under "Also show base" (default binary) to add any other base up to 36.
What it supports
- Bases 2 to 36, each labelled with its name (binary, ternary, octal, duodecimal, hexadecimal, vigesimal and so on up to hexatrigesimal).
- Digits are
0-9thena-z, case-insensitive on input and upper-case on output. A digit that is not valid in the chosen base is reported with the allowed digit set. - Any length: the value is parsed into a BigInt, so numbers above 2^53 (about 9 × 10^15) convert exactly where
parseIntwould lose precision. - Non-negative integers only. Signs, fractions, spaces and prefixes such as
0xor0bare not accepted; strip the prefix first.
Example
255 (base 10)
→ Binary 11111111
→ Octal 377
→ Decimal 255
→ Hexadecimal FF
→ Base 36 73
Privacy
Conversion runs in the page. No request is made and nothing is stored.
Frequently asked questions
- How do I convert decimal to binary by hand?
- Divide by 2 repeatedly and write down each remainder; the remainders read from last to first are the binary digits. For 13: 13→6 r1, 6→3 r0, 3→1 r1, 1→0 r1, giving 1101.
- Why is hexadecimal used so much in programming?
- One hex digit represents exactly four bits, so a byte is always two hex digits and a 32-bit value is eight. That makes hex a compact, lossless way to write binary data, memory addresses and colours such as #FF8800.
- Why does JavaScript give the wrong answer for very large numbers?
- JavaScript numbers are 64-bit floats with 53 bits of integer precision, so parseInt and toString round anything above 9,007,199,254,740,991. This converter uses BigInt instead, which has no upper limit.
- What is base 36 used for?
- Base 36 uses the digits 0-9 and letters a-z, the largest alphabet that is still case-insensitive. It is used for short identifiers and URL keys because it packs more information per character than decimal or hex.