Free Number Base Converter Online
Type in any field — Binary, Octal, Decimal, or Hex — and all other bases update instantly. Adjust bit width for two's complement representation of negative numbers.
Binary (Base-2)
Octal (Base-8)
Decimal (Base-10)
Hexadecimal (Base-16)
Show calculation steps
No conversion in progress.
Usage Examples
Click any card to load the value into the converter
Maximum unsigned 8-bit value
1 Kilobyte (210 bytes)
The Answer to Life, the Universe, and Everything
Negative one — two's complement
0xDEADBEEF — the classic hex spell
Maximum unsigned 16-bit value
Key Features
Real-time Conversion
Type in any base field and all others update instantly.
Two's Complement
Full support for negative numbers with adjustable bit width (8, 16, 32, 64).
Clear Display
Optional prefixes (0b, 0o, 0x) and 4-bit binary grouping for readability.
Step-by-Step
Toggle calculation steps to see exactly how each conversion is performed.
Frequently Asked Questions
What is the Number Base Converter?
How to Use This Tool
- Enter a number in any of the four base fields — Binary, Octal, Decimal, or Hexadecimal. All other fields update instantly.
- Adjust the bit width (8, 16, 32, or 64) for two's complement negative number representation and zero-padding of binary output.
- Toggle prefix display (0b, 0o, 0x) and binary grouping (4-bit) for readability. Click any example to load a preset value.
Example
Input:
Decimal: 255
Output:
Binary: 11111111 Octal: 377 Hexadecimal: FF
What happens when I enter a decimal number larger than the selected bit width allows?
How does two's complement handle the most negative number?
How do hex and octal relate to binary more efficiently than decimal?
Why are hex values like 0xDEADBEEF and 0xCAFEBABE commonly seen in debugging?
Why does the binary output add leading zeros when I select a bit width?
How do I convert numbers between bases programmatically in JavaScript?
Number(42).toString(16) to convert decimal 42 to hex ("2a"). Use parseInt("2a", 16) to convert hex back to decimal (42). The toString() method supports bases 2 through 36. For bases outside this range or very large numbers, use BigInt: BigInt("0xff"). Python offers similar functions: bin(), oct(), hex(), and int("ff", 16). In Go, use strconv.FormatInt(42, 16) and strconv.ParseInt("2a", 16, 64).What is the difference between signed and unsigned integer representations?
Why do IPv4 addresses and MAC addresses use different bases?
How does base conversion differ for floating-point numbers?
Learn more about number systems from MDN's parseInt() documentation, the Wikipedia article on two's complement, and IEEE 754 floating-point standard.
Last updated: July 14, 2026