0x

Number Base Converter

Convert between decimal, hexadecimal, binary, octal, and any custom base (2–36) instantly.

DEC Base 10
HEX Base 16
BIN Base 2
OCT Base 8
B64 Base 64
Custom
ℹ️ Base Cheat Sheet

Decimal (10) — normal numbers: 0–9

Binary (2) — computers: 0 and 1 only

Octal (8) — Unix permissions: 0–7 (chmod 755)

Hex (16) — 0–9 and A–F. Colors (#FF5733), memory addresses

Prefix conventions: 0bbinary · 0ooctal · 0xhex

🔗 Related Tools

❓ Frequently Asked Questions

What is hexadecimal and why is it used in programming?

Hexadecimal (base 16) uses digits 0–9 and A–F. Programmers use it because each hex digit represents exactly 4 bits, making it compact: one byte (8 bits) is always two hex digits. It is used for memory addresses, color codes (#FF5733), file formats, and debugging binary data.

How do I convert binary to decimal?

Multiply each binary digit by its positional value (powers of 2) and add them up. For example, binary 1011 = 1×8 + 0×4 + 1×2 + 1×1 = 8+0+2+1 = 11 in decimal. This tool converts automatically — just type the binary value.

What is octal and when is it used?

Octal (base 8) uses digits 0–7. It was historically used in early computing because one octal digit represents 3 bits. Today it is used in Unix/Linux file permissions (e.g., chmod 755) where 7=rwx, 5=r-x, 4=r--.

What is two's complement for negative numbers in binary?

Two's complement is the standard way computers represent negative integers in binary. To get the two's complement of a number: invert all bits and add 1. For example, -5 in 8-bit two's complement is 11111011. This tool converts unsigned (positive) integers.

What is the maximum number this converter supports?

This converter uses JavaScript's 64-bit floating-point numbers (IEEE 754), which can represent integers exactly up to 2^53 - 1 (9,007,199,254,740,991). For most programming use cases, this range is sufficient.