Number Base Converter
Convert a number between binary, octal, decimal, hexadecimal and any base from 2 to 36.
Processed on your device — no upload
Any base from 2 to 36
Conversion uses arbitrary-precision integers, so values beyond 9,007,199,254,740,991 stay exact rather than rounding — which is where most online converters quietly go wrong.
How to use it
- Type the number.
- Say which base it is written in.
- Read the other bases, or set a custom one from 2 to 36.
How it works
A base is how many distinct digits a number system uses before it needs a new column. Decimal has ten, so after 9 comes 10. Binary has two, so after 1 comes 10. Hexadecimal has sixteen, which is why it borrows the letters a to f to fill the gap after 9.
Parsing multiplies a running total by the base and adds each digit; printing repeatedly divides by the base and collects the remainders. Neither operation loses information — the value is identical in every base, only its written form changes.
The arithmetic here uses arbitrary-precision integers, and that is the difference that matters. JavaScript's ordinary numbers are floating point and stop being exact above 9,007,199,254,740,991. Convert a 64-bit hash or a large identifier with a converter built on ordinary numbers and you get an answer that is plausible, close, and wrong.
Binary results are grouped in fours and octal in threes, because each hex digit is exactly four binary digits and each octal digit exactly three. Once you see the grouping, reading hex as binary becomes mechanical rather than arithmetic.
A worked example
You are setting file permissions and the documentation says 755 in octal.
Type 755, choose octal. Decimal 493, binary 111 101 101. The grouping does the explaining: each octal digit is three bits, and those three groups are the read-write-execute bits for owner, group and everyone. 7 is 111 — all three permissions. 5 is 101 — read and execute, no write.
A colour example. A hex colour #ff8800 is three bytes. Type ff, choose hexadecimal: 255 decimal. Then 88: 136. So that colour is red 255, green 136, blue 0 — the numbers a design tool shows in its RGB fields.
Now the precision test that separates this from most converters. Type 9007199254740993 in decimal — one above JavaScript's exact integer limit. The hex result here is 20000000000001.
A converter using ordinary floating-point numbers returns 20000000000000, silently losing the final 1, because the value cannot be represented exactly. If you have ever converted a large identifier and found it did not match, this is why.
Base 36 is the highest offered because it uses all ten digits and all twenty-six letters. It is the most compact form that stays typeable, which is why short-link services use it. Type a large number and switch the custom base to 36 to see how much shorter it gets.
For text encoding rather than number bases, the text tools cover a different set of problems.
Questions
What is a radix?
Another word for the base: how many digits a system uses before it carries. Decimal has a radix of 10, binary 2, hexadecimal 16.
What is hexadecimal used for?
Colours, memory addresses, hashes and byte values. Each hex digit is exactly four bits, so two hex digits describe one byte — which makes it the most convenient shorthand for binary data.
Why is this converter exact for large numbers?
It uses arbitrary-precision integers rather than floating point. Ordinary JavaScript numbers stop being exact above 9,007,199,254,740,991, and converters built on them lose digits silently.
What do the spaces in the binary result mean?
Grouping only, in fours. Each hex digit is exactly four binary digits, so the grouping lets you read hex and binary against each other directly.
How do I read octal file permissions?
Each octal digit is three bits — read, write, execute — for owner, group and others. 755 is 111 101 101: full permissions for the owner, read and execute for everyone else.
Why is base 36 the maximum?
Because it uses all ten digits plus all twenty-six letters. Beyond that there are no more standard characters to use.
Can it convert negative numbers?
Yes. The minus sign is preserved and the digits converted, which is the ordinary mathematical convention rather than a two's-complement representation.
Is anything uploaded?
No. The conversion runs in your browser.
Does it handle decimal fractions?
No, whole numbers only. Fractions in other bases are a different problem — a third is finite in base 3 and repeating in base 10.
Related Convert tools
Length Converter
Metres, feet, miles and more
open$termiva convert 1 kg --to allWeight Converter
Kilograms, pounds, stones, ounces
open$termiva convert 25 C --to allTemperature Converter
Celsius, Fahrenheit, Kelvin
open$termiva convert 1 m2 --to allArea Converter
Square metres, acres, dunams
open