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)
Digits: 0–1. The native language of computers.
Invalid binary digit
Octal (Base-8)
Digits: 0–7. Common in Unix file permissions.
Invalid octal digit
Decimal (Base-10)
Digits: 0–9. Standard human-readable format.
Invalid decimal number
Hexadecimal (Base-16)
Digits: 0–F. Used for memory addresses, color codes, and binary dumps.
Invalid hex digit
Decimal 255 = Binary 11111111₂ = Hex FF₁₆ = Octal 377₈
Show calculation steps
No conversion in progress.
Usage Examples
Click any card to load the value into the converter
8-bit Max
↗
Maximum unsigned 8-bit value
Dec255
Bin11111111
HexFF
Oct377
Power of 2
↗
1 Kilobyte (210 bytes)
Dec1024
Bin10000000000
Hex400
Oct2000
Fun
↗
The Answer to Life, the Universe, and Everything
Dec42
Bin101010
Hex2A
Oct52
Signed
↗
Negative one — two's complement
Dec-1
8-bit11111111
HexFF
16-bitFFFF
Hex Magic
↗
0xDEADBEEF — the classic hex spell
Dec3735928559
HexDEADBEEF
Bin11011110...
Oct33653337357
16-bit Max
↗
Maximum unsigned 16-bit value
Dec65535
Bin1111111111111111
HexFFFF
Oct177777
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
General
What is the Number Base Converter?
The Number Base Converter instantly translates numbers between the four numeric systems engineers use every day: binary (base-2), octal (base-8), decimal (base-10), and hexadecimal (base-16). Type a number in any of the four input fields and all other bases update in real time. The tool also supports negative numbers via two's complement representation at selectable bit widths (8, 16, 32, or 64 bits).
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
Details
What happens when I enter a decimal number larger than the selected bit width allows?
The tool truncates to fit within the selected bit width using modular arithmetic (wrapping). For example, entering 300 in 8-bit mode wraps around: 300 mod 256 = 44, so the 8-bit representation shows 44. This simulates real integer overflow behavior. To avoid wrapping, select a wider bit width.
How does two's complement handle the most negative number?
In two's complement, the most negative number has no positive counterpart within the same bit width. For 8-bit: -128 (10000000) cannot be represented as +128 in 8 bits because the maximum signed 8-bit value is +127. The tool handles this edge case correctly for each bit width.
How do hex and octal relate to binary more efficiently than decimal?
Both hexadecimal and octal map directly to groups of bits, which decimal does not. One hex digit represents exactly 4 bits (a nibble): 0xF = 1111. One octal digit represents exactly 3 bits: 7 = 111. This is why Unix file permissions use octal and memory addresses use hex.
Why are hex values like 0xDEADBEEF and 0xCAFEBABE commonly seen in debugging?
These are "hexspeak" — deliberately chosen 32-bit magic numbers that spell English words when read as hexadecimal. Engineers embed them in memory as sentinel values to detect buffer overflows, uninitialized memory access, or corrupted data structures.
Why does the binary output add leading zeros when I select a bit width?
The leading zeros (zero-padding) show the full width of the binary representation, which is essential when working with bitwise operations. This is critical for writing bitmasks, analyzing hardware registers, or implementing communication protocols where each bit position has a specific meaning.