Number Base Converter

Convert between Binary, Octal, Decimal, and Hexadecimal.

BIN
Base 2
0b
OCT
Base 8
0o
DEC
Base 10
HEX
Base 16
0x

About This Tool

Number base conversion is a fundamental operation in computer science. While humans use base-10 (decimal), computers operate in base-2 (binary). Hexadecimal (base-16) provides a compact representation of binary, and octal (base-8) is used in Unix file permissions.

When to Use

  • Reading memory addresses or color codes in hexadecimal (e.g., CSS #FF5733).
  • Understanding Unix file permissions (e.g., chmod 755 → binary 111 101 101).
  • Decoding hardware registers or network protocol bit fields.
  • Converting ASCII character codes to/from binary.

Practical Examples

255 in all basesDEC: 255 | HEX: FF | BIN: 11111111 | OCT: 377
Color #1A2B3CR=0x1A=26, G=0x2B=43, B=0x3C=60 → RGB(26, 43, 60)

Common Mistakes to Avoid

  • Confusing lowercase 'l' and uppercase 'I' with '1' in hex strings.
  • Forgetting that hex is case-insensitive (FF == ff).

Frequently Asked Questions

Q. What's the largest number supported?A. This tool uses JavaScript's BigInt, so it handles arbitrarily large integers without precision loss.
Q. Why does hex use letters A-F?A. Hexadecimal needs 16 symbols for digits 0-15. Since we only have 10 numeric digits, letters A=10, B=11, C=12, D=13, E=14, F=15 fill the gap.

Related Tools