Number Base Converter
Convert numbers between binary, octal, decimal, hexadecimal and any base from 2 to 36, with bit-width information.
Everything you type here is processed on your own device. No input is sent to a server, logged, or stored.
What the Number Base Converter does
Use this number base converter to convert numbers between binary, octal, decimal, hexadecimal and any base from 2 to 36, with bit-width information. Paste your text in, pick the options you need, and copy the result straight back out. It is most often used for converting a hex colour or memory address to decimal. Companion tools to this one live on FreeToolStation.org.
How to use it
- Enter your number.
- Select which base it is written in.
- Every common base is shown at once.
- Prefixes like 0x and 0b are stripped automatically.
How it works
Each base is just a different way of writing the same quantity. Binary suits hardware because a bit is on or off; hexadecimal is compact and maps cleanly to binary, with one hex digit per four bits, which is why colours, memory addresses and byte dumps use it.
The bit count tells you the minimum width needed to store the value, and the "fits in" row names the smallest standard unsigned integer type that can hold it. Both are useful when choosing a column type or a protocol field width.
Conversion uses JavaScript integer parsing, which is exact up to 2^53. Above that, precision is lost and the result may be wrong in its final digits.
When to use it
- Converting a hex colour or memory address to decimal.
- Checking the binary representation of a bitmask.
- Working out how many bits a value requires.
Common mistakes to avoid
- Forgetting to change the input base, so a hex value is read as decimal.
- Converting values above 2^53, where precision is lost.
Frequently asked questions
Why is hexadecimal used so much in computing?
Because one hex digit maps exactly to four bits, so a byte is always two hex digits. It is far more compact than binary while still lining up with the underlying bit pattern, unlike decimal.
Can I enter 0xFF or 0b1010?
Yes. Common prefixes are stripped automatically, but still select the matching base from the dropdown so the digits are interpreted correctly.