Number Base Converter
Type a number in any base and see it in all the others at once, with a 32-bit binary view showing exactly which bits are set.
Your number
2 for binary, 16 for hex
In every base
- Binary (base 2)0b11111111
- Octal (base 8)0o377
- Decimal (base 10)255
- Hexadecimal (base 16)0xFF
- Base 3673
32-bit view
00000000 00000000 00000000 11111111
Bits set: 7, 6, 5, 4, 3, 2, 1, 0
About the Number Base Converter
A number does not have a base; only its written form does. Fifteen is fifteen whether you write it as 1111, 17, 15 or F — the base is a choice about notation, and converting between them changes nothing but the spelling.
The bases that matter in practice are the ones that line up with hardware. Binary is how everything is actually stored. Hexadecimal is the shorthand, because one hex digit is exactly four bits, so a byte is always two hex digits and you can read the bits straight off the page. Octal groups three bits at a time and survives mainly in Unix file permissions, where 755 means three sets of three permission bits.
Parsing here is stricter than the language's own. JavaScript's parseInt reads as far as it can and stops silently, so parsing 12 as binary returns 1 rather than an error — a typo produces a plausible wrong answer instead of a complaint. This tool validates every digit against the base first and reports invalid input rather than guessing.
The bit view shows a 32-bit two's complement representation with the set bit positions listed, which is what you want when working with flags or masks. It refuses to display anything outside the 32-bit range rather than showing a wrapped value, because JavaScript's bitwise operators silently truncate to 32 bits and a wrapped answer is worse than no answer.
Everything runs in your browser.
Frequently asked questions
Why is hexadecimal used so much in programming?
Because one hex digit is exactly four bits. A byte is always two hex digits, so you can read the underlying bits directly off the page in a way decimal never allows.
Why does this reject input other converters accept?
Because parseInt stops at the first invalid digit and returns what it read so far — parsing 12 as binary gives 1 rather than an error. Every digit is validated against the base here, so a typo is reported instead of producing a wrong answer.
Why does the bit view stop at 32 bits?
Because JavaScript bitwise operators truncate to 32-bit signed integers. Beyond that range the result would be wrapped and wrong, so the view declines rather than misleading you.