Number Base Converter

Decimal (10)
Hexadecimal (16)
Binary (2)
Octal (8)

Bit visualization
ASCII character
Common values

What are Number Bases?

A number base (or radix) defines how many unique digits are used to represent values. We count in decimal (base 10) using digits 0-9, but computers operate in binary (base 2) using only 0 and 1. Programmers regularly work with hexadecimal (base 16, digits 0-9 and A-F) and occasionally octal (base 8, digits 0-7).

Each digit position in a number represents a power of the base. In decimal, the number 255 means (2 x 100) + (5 x 10) + (5 x 1). In binary, 11111111 means (128 + 64 + 32 + 16 + 8 + 4 + 2 + 1) = 255. In hex, FF means (15 x 16) + (15 x 1) = 255. All three represent the same value in different bases.

Common Bases in Programming

Binary (base 2) is the native language of digital electronics. Every value in a computer is ultimately stored as binary bits. Developers use binary when working with bitwise operations, flags, network masks, and low-level hardware interfaces.

Hexadecimal (base 16) is a compact representation of binary data. Each hex digit maps to exactly 4 bits, so a byte (8 bits) is always 2 hex digits. Hex is used for color codes (#FF0000), memory addresses, MAC addresses, and inspecting raw data. Octal (base 8) maps each digit to 3 bits and is primarily used for Unix file permissions (e.g., chmod 755).

How to Use This Converter

  1. Type a number in any of the four input fields (decimal, hex, binary, or octal).
  2. All other fields update instantly as you type.
  3. The bit visualization below shows the binary representation with highlighted bits.
  4. For values 32-126, the ASCII character is displayed. Use the common value presets for quick reference.

Frequently Asked Questions

What is a number base?

A number base (or radix) defines how many unique digits are used to represent numbers. Decimal (base 10) uses 0-9, binary (base 2) uses 0 and 1, hexadecimal (base 16) uses 0-9 and A-F, and octal (base 8) uses 0-7. The base determines the place value of each digit position.

Why do programmers use hexadecimal?

Hexadecimal is a compact way to represent binary data. Each hex digit maps exactly to 4 binary bits, so a byte is always exactly 2 hex digits. This makes hex ideal for memory addresses, color codes (#FF0000), MAC addresses, and viewing raw binary data.

How do I convert binary to decimal?

Multiply each binary digit by its place value (powers of 2 from right to left) and sum the results. For example, binary 1101 = (1x8) + (1x4) + (0x2) + (1x1) = 13 in decimal. The rightmost digit has a place value of 1 (2^0), then 2, 4, 8, and so on.

What is octal?

Octal (base 8) uses digits 0-7. It was historically popular because early computer word sizes divided evenly into 3-bit groups. Today, octal is primarily used in Unix/Linux file permissions, where each permission set (read, write, execute) maps to a 3-bit value represented as a single octal digit (e.g., chmod 755).

Why does hex use letters A-F?

Hexadecimal needs 16 unique digits, but our decimal system only provides 10 (0-9). The letters A through F represent the values 10 through 15: A=10, B=11, C=12, D=13, E=14, F=15. This allows each hex digit to represent a 4-bit value using a single character.

What is base64 vs base16?

Base16 (hexadecimal) is a number system for representing 4-bit values. Base64 is an encoding scheme that represents binary data using 64 ASCII characters (A-Z, a-z, 0-9, +, /). Base64 is used to encode binary data (images, files) as text for transmission in email, URLs, and JSON. They serve different purposes: base16 for numbers, base64 for data encoding.