🔢

Number Base Converter

Convert between binary, octal, decimal, and hexadecimal.

Enter a value in any field — all other bases update automatically.

Decimal
Base 10
Binary
Base 2 (0s and 1s)
Octal
Base 8 (0–7)
Hexadecimal
Base 16 (0–9, A–F)
Advertisement

How to Use the Number Base Converter

The Number Base Converter converts integers between binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16) representations simultaneously. Type in any field and all others update instantly. Each input field has a copy button for easy use in code or documents.

The Four Number Systems

Bit Length Display

After entering a value, a summary shows the decimal value, the minimum bits required, and the value padded to the nearest standard bit width (8, 16, 32, or 64 bits). This is useful for understanding data type boundaries in programming.

Related Tools

Frequently Asked Questions

Why is hexadecimal useful in programming?

Hexadecimal is compact: each hex digit represents exactly 4 binary bits. A byte (8 bits) is just 2 hex digits. So 11111111 in binary becomes FF in hex. Hex is used in memory addresses, color codes (#FF6600), Unicode code points (U+0041), and assembly/machine code.

What does "0x" prefix mean before hex numbers?

The "0x" prefix indicates hexadecimal notation in programming. 0xFF = decimal 255. Similarly, "0b" indicates binary (0b11111111) and "0o" indicates octal in some languages like Python. This tool shows just the digits without the prefix — add the prefix yourself when using in code.

What is the maximum number this converter handles?

The converter uses JavaScript's parseInt() which is accurate up to 2^53 − 1 (9,007,199,254,740,991 in decimal). Numbers larger than this may lose precision. For cryptographic or 64-bit integer work, a BigInt-aware tool would be needed.

How do Unix file permissions use octal?

Unix permissions use 3-bit groups: read (4), write (2), execute (1) for owner, group, and others. chmod 755 = owner rwx (7=4+2+1), group r-x (5=4+1), others r-x (5). Each group of 3 bits is one octal digit, making octal a natural fit.