Number Base Converter
Convert between binary, octal, decimal and hexadecimal.
Overview
The Number Base Converter rewrites a value between binary, octal, decimal and hexadecimal in a single pass. Drop in any representation and the other three appear instantly, with optional grouping so 64-bit numbers stay readable.
It is built for programmers reading hex dumps, network engineers inspecting subnet masks, microcontroller hobbyists configuring registers and students learning positional numeral systems. Constantly toggling a calculator into "PROG" mode loses you minutes a day; the converter keeps you in flow.
How it works
Every positional numeral system represents a value as Σ d_i * b^i, where d_i is the i-th digit and b is the base. To convert from base b to decimal, expand the polynomial. To go from decimal to base b, repeatedly divide by b and collect the remainders.
The tool parses your input by detecting 0x (hex), 0o or leading 0 (octal) or 0b (binary) prefixes; otherwise it treats it as decimal. Hex output uses lowercase letters but accepts uppercase input.
Examples
255 → binary 11111111, octal 377, hex ff
0xDEAD → decimal 57005, binary 1101111010101101, octal 157255
0b101010 → decimal 42, octal 52, hex 2a
0o777 → decimal 511, binary 111111111, hex 1ff
FAQ
Why is hex preferred over binary?
Hex packs four binary digits per character, so a 32-bit value takes 8 hex digits instead of 32 bits — much easier to read while still mapping cleanly to bits.
Can I convert fractional numbers?
This tool focuses on integers. Fractional base conversion is possible but rarely needed outside computer-arithmetic coursework.
What about negative numbers?
The converter shows negative decimals with a minus sign and the binary/hex representation as if the magnitude were positive. Two's-complement representation depends on a chosen bit width.
Why is the octal prefix 0o not 0?
Modern languages use 0o (Python 3, JavaScript) to avoid the C-style ambiguity where 077 was octal but 0 could mean either. The converter accepts both forms.
Are there bases other than these four?
Yes — any base from 2 to 36 is mathematically valid using digits 0-9 and letters a-z. The converter focuses on the four programmers use daily.