Binary, Hex & Decimal Converter
Binary, octal, decimal and hexadecimal, with the bits explained. Free, and runs entirely in your browser — nothing you enter is uploaded or stored.
About Number Base Converter
Converting between bases is arithmetic anyone can do. What makes it worth a tool is that a number on its own has no width and no sign, and the moment it is stored in a register, a struct field or a file it has both — and the same bits mean different things depending on which.
0xFF is 255 as an unsigned byte and −1 as a signed one. Neither reading is more correct; only the thing holding it knows. A converter that quietly picks one is how people end up debugging a value that was never wrong, so the width and the signedness are inputs here and the answer says which reading it gave.
Overflow is the same question asked backwards, and it is reported rather than refused. Typing 300 into an eight-bit box is not a mistake to be rejected — it is exactly what the hardware will do with it, and seeing it wrap to 44 is usually why somebody opened the page.
Everything is computed with arbitrary-precision integers, so a 64-bit value keeps all of its bits. A tool that quietly rounds away the bottom of a hash or an identifier is worse than no tool at all.
Where it helps
- Shows binary, octal, decimal and hexadecimal at once, so the conversion is never the thing you are waiting for.
- Asks for the width and the signedness rather than assuming them, which is the difference between 255 and −1.
- Reports overflow by wrapping the way two's complement wraps, so you see what the machine would actually store.
- Analyses the bits: how many are set, where the highest one is, whether it is a power of two, and whether the sign bit is on.
- Uses arbitrary-precision integers throughout, so 64-bit and 128-bit values keep every bit.
- Groups the binary into fours and the bytes separately, because an unbroken run of sixty-four bits cannot be read.
Limits
- Integers only. Floating-point numbers have a different bit layout entirely — sign, exponent and mantissa — and are not what this decodes.
- It does not evaluate expressions: one value at a time, not 0xFF & 0x0F.
- Auto-detection reads a prefix first and then the digits, so a bare 101 is read as binary. Choose the base explicitly where that is not what you meant.
- Bit numbering is from zero at the least significant end, which is the common convention but not the only one in use.
Frequently asked questions
Why does 0xFF show as −1?
Because you asked for a signed eight-bit reading, and in two's complement the top bit is the sign. The same eight bits are 255 unsigned, and the result shows both. Which one is right depends entirely on how the value is declared where it lives.
What does the tool do when a number is too big for the width?
It wraps it, the way the hardware would, and says so. That is more useful than an error: seeing 300 become 44 in eight bits is usually exactly the behaviour being investigated.
Why is a plain 101 read as binary?
Because with no prefix, a value made only of ones and zeros is far more often binary than decimal in this context. If you meant one hundred and one, set the base to decimal explicitly rather than relying on the guess.
Can it handle 64-bit values?
Yes, and 128-bit. The arithmetic uses arbitrary-precision integers rather than JavaScript numbers, which stop being exact above about 9 quadrillion — so a 64-bit hash or snowflake id keeps all of its digits.
Related tools
- Hex and Text Converter — Text to hexadecimal bytes and back, with a dump
- Unix Permissions Calculator — Convert between 755 and rwxr-xr-x, and say what each bit allows
- Subnet Calculator — IPv4 and IPv6 networks, masks, splits, VLSM plans and summarisation
- File Checksum — Verify a download, and work out which algorithm made the checksum
- Base64 — Encode or decode UTF-8 text and URL-safe Base64
- Base32 — Encode or decode Base32 in the RFC 4648, extended hex and Crockford alphabets
More Encoders & Decoders tools
- Base64 — Encode or decode UTF-8 text and URL-safe Base64
- Base32 — Encode or decode Base32 in the RFC 4648, extended hex and Crockford alphabets
- Base58 — Encode or decode Base58, and verify the Base58Check checksum an address carries
- URL Encoder — Percent-encode components or whole URLs
- HTML Entities — Escape and unescape HTML entities
- JWT — Read, verify and sign JSON Web Tokens
- Punycode — Convert internationalised domain names to and from their ASCII form
- Unicode Converter — Escape, unescape and inspect code points
- Unicode Inspector — Analyse every character: category, script, block and encoding
- Hex and Text Converter — Text to hexadecimal bytes and back, with a dump
- Gzip Compressor and Decompressor — Compress and expand gzip, zlib and raw deflate