Number & Math
Number Base Converter
Convert numbers between binary, octal, decimal and hexadecimal.
Binary (base 2)
Octal (base 8)
Decimal (base 10)
Hex (base 16)
Accepts 0b, 0o, 0x prefixes; spaces and underscores are ignored.
About this tool
Type a number in any base (binary, octal, decimal, hex) and see it instantly in the other three. Accepts 0b, 0o, 0x prefixes and ignores spaces / underscores for readability. Handles arbitrary precision via BigInt, so 256-bit hex hashes round-trip cleanly.
FAQs
How are negative numbers handled?
Decimal accepts a leading minus. For binary / octal / hex the converter shows the unsigned representation by default. Switch on the 'fixed-width two's complement' option to see signed encodings.
Can I convert floating-point numbers?
Whole numbers only. IEEE-754 floats need a dedicated bit-pattern visualiser - hex-encode the bits separately if needed.
Are 0x / 0b / 0o prefixes required?
No - the tool auto-detects based on which input you're typing into. Prefixes are accepted but optional and stripped before parsing.
Why is hex (base 16) so common in programming?
Each hex digit maps to exactly 4 bits, so one byte (8 bits) is two hex digits. Reading a 256-bit hash as 64 hex characters is far easier than 256 binary digits or 78 decimal digits.
Can I paste spaces or underscores?
Yes - both are stripped before parsing. So 1010_1100 or 0xDE AD BE EF works fine.