Number base converter

Related calculators

What is a number base converter?

A number base converter is an online tool that translates numbers between different positional numeral systems. It supports binary (base 2), octal (base 8), decimal (base 10), hexadecimal (base 16), Base32 and Base64 encoding. These systems are essential in computing, networking and data encoding.

How to convert numbers between bases?

Select the source base, enter a value and the converter displays the equivalent in all supported systems. Internally, the conversion happens in two steps:

  1. The input value is converted to decimal by multiplying each digit by its positional power of the base.
  2. The decimal value is converted to the target base by repeatedly dividing by the new base and collecting the remainders.

For Base32 and Base64, the process works on byte-level data using standardized encoding alphabets defined in RFC 4648.

What is the number base conversion formula?

The decimal value of any number in base b is calculated as:

N = dₙ × bⁿ + dₙ₋₁ × bⁿ⁻¹ + ... + d₁ × b¹ + d₀ × b⁰

Where d represents each digit and b is the base. For example:

  • Binary 1101 = 1×2³ + 1×2² + 0×2¹ + 1×2⁰ = 8 + 4 + 0 + 1 = 13
  • Octal 27 = 2×8¹ + 7×8⁰ = 16 + 7 = 23
  • Hex 1A3 = 1×16² + 10×16¹ + 3×16⁰ = 256 + 160 + 3 = 419

Number base conversion examples

Decimal 255: binary 11111111, octal 377, hexadecimal FF. This is the maximum value that fits in a single byte (8 bits) and is commonly seen in color codes and network masks.

Decimal 42: binary 101010, octal 52, hexadecimal 2A. A frequently used example value in programming documentation and tutorials.

Decimal 3232235776: hexadecimal C0A80100. This represents the IP address 192.168.1.0 when each octet is written in hex as C0, A8, 01, 00.

When to use a number base converter?

A number base converter is useful in many technical scenarios across software development, networking and data processing:

  • Programming: binary and hexadecimal are used for bitwise operations, memory addresses, debugging and low-level data manipulation.
  • Networking: IP addresses, subnet masks and MAC addresses are often expressed in hexadecimal or binary notation.
  • Data encoding: Base64 encoding is widely used for email attachments (MIME), JSON Web Tokens (JWT), API authentication and embedding binary data in text formats.
  • Web design: color codes like #FF5733 are hexadecimal values representing the red, green and blue components of a color.
  • Education: understanding number bases is fundamental to computer science, digital electronics and information theory.