Binary, Hex, and Decimal Converter
Toolzy's binary / hex / decimal converter is built for strict integer conversion, not permissive parsing. Choose the input base explicitly, enter a whole number, and the tool synchronizes binary, decimal, and hexadecimal outputs in one pass.
This helps when you need quick answers for searches like binary to decimal, decimal to binary, hex to decimal, or hex to bin, but still want rules that behave predictably for code, docs, and debugging.
What This Converter Accepts
- Binary input accepts an optional
+or-, an optional matching0bprefix, and only0or1digits. - Decimal input accepts an optional sign and digits
0-9only. - Hexadecimal input accepts an optional sign, an optional matching
0xprefix, and digits0-9plus lettersA-F. - Leading and trailing whitespace is trimmed, but internal spaces, underscores, commas, apostrophes, exponent notation, and decimal points are rejected.
Canonical Output Rules
- Outputs are normalized bare values with no prefixes.
- Hexadecimal output is always uppercase.
- Binary output has no leading zero padding, except for
0itself. - Signed zero inputs like
-0,+0,-0b0, and-0x0normalize to0.
Exact Results For Large Integers
The converter uses BigInt-safe integer logic in the browser, so values larger than Number.MAX_SAFE_INTEGER stay exact. For example, decimal 18446744073709551615 converts cleanly to hexadecimal FFFFFFFFFFFFFFFF without rounding or scientific notation.
Negative Numbers Vs. Two's Complement
Negative results are shown with a leading minus sign in every base. That means decimal -15 becomes binary -1111 and hexadecimal -F.
This tool does not guess or display two's-complement bit patterns, because those require an explicit bit width. It keeps the numeric value separate from machine representation.
Quick Reference
11111111in binary =255in decimal =FFin hexadecimal255in decimal =11111111in binary =FFin hexadecimal0x2Ain hex =42in decimal =101010in binary1hex digit =4binary bits
Troubleshooting
Why does 0x1010 fail in binary mode? — Prefixes only work when they match the selected input base. Switch the base to Hexadecimal to parse 0x input.
Why does 123_456 fail? — v1 uses strict integer parsing and rejects separators such as underscores, spaces, commas, and apostrophes.
Why does -15 show -1111 instead of a fixed-width bit pattern? — The converter shows signed integer values only. Two's-complement output is intentionally out of scope unless a width is specified.