🍋 Math Tools

Number Base Converter

Convert between binary, octal, decimal, hex, and any base

Free Browser-only No sign-up
chars words sentences lines

Type or paste something into the Input box to enable this button.

Results

Result

About Number Base Converter

Convert numbers between any base from 2 to 36. Auto-detects 0b, 0o, 0x prefixes. Shows simultaneous binary, octal, decimal, and hexadecimal representations.

How It Works

Uses JavaScript's parseInt() to read the input in the specified base, then toString() to convert to all four bases simultaneously.

Step by Step

  1. 1 Enter a number (use 0b, 0o, 0x prefix for auto-detection)
  2. 2 Select source and target bases
  3. 3 View the number in all common bases simultaneously
  4. 4 Copy any representation

Tips

  • 0b prefix = binary, 0o = octal, 0x = hexadecimal
  • Hex is widely used in CSS colors, memory addresses, and encoding
  • Each hex digit maps to exactly 4 binary digits (nibble)

Frequently Asked Questions

What bases are commonly used?
Binary (2) for hardware/logic, octal (8) for Unix permissions, decimal (10) for humans, hexadecimal (16) for programming and colors.
Can I use bases above 16?
Yes, up to base 36 (0-9 plus A-Z). Base 36 is sometimes used for compact URL-safe identifiers.