Number Base Converter
Convert between binary, octal, decimal and hexadecimal.
Number
All bases
About the Number Base Converter converter
Reading a hex constant, checking a bitmask or working out what a permission value means all come down to the same conversion, and doing it in your head is a good way to introduce a bug.
Paste a number in any common base and get every other representation, along with how many bits and bytes it occupies.
Precision that does not quietly break
Conversion uses arbitrary-precision integers throughout, so 64-bit values and larger are exact. This matters more than it sounds: most JavaScript-based converters lose precision silently above about 9 quadrillion while still printing a confident-looking answer.
That is exactly the range where a 64-bit ID or a full-width bitmask lives.
Prefixes and negatives
`0x`, `0b` and `0o` are recognised automatically, so you can paste a constant straight out of source code. Underscores, spaces and commas used as digit separators are ignored.
A negative number also shows its two’s-complement form at the narrowest standard width that holds it, which is how it is actually stored in memory.
Frequently asked questions
Are fractional numbers supported?
No — integers only. Fractional binary and hex involve floating-point representation, which is a different problem with different pitfalls.
What is the largest number I can convert?
There is no practical limit. Hundreds of digits convert exactly.