Number Base Converter

Convert between binary, decimal, hexadecimal, and octal number systems.

Privacy First

This tool runs entirely in your browser. No data is sent to any server. Your input remains completely private.

Binary(base 2)
-
Octal(base 8)
-
Decimal(base 10)Input
-
Hexadecimal(base 16)
-

Quick Examples

About Number Bases

Binary: Base 2: Uses only 0 and 1. Each position represents a power of 2.

Octal: Base 8: Uses digits 0-7. Each position represents a power of 8.

Decimal: Base 10: The standard number system using digits 0-9.

Hexadecimal: Base 16: Uses 0-9 and A-F. Common in computing for compact binary representation.

All conversions happen locally in your browser. No data is sent to any server.

Number systems form the foundation of digital computing. While we use decimal (base 10) in everyday life, computers fundamentally operate in binary (base 2), and programmers frequently work with hexadecimal (base 16) and occasionally octal (base 8). Our Number Base Converter makes it easy to translate between these systems, helping you understand how the same value is represented in different bases.

This tool converts between binary, octal, decimal, and hexadecimal instantly as you type. It validates your input to ensure you're entering valid characters for each base and shows all representations simultaneously so you can see the relationships between different number systems.

Understanding Number Bases

A number base (or radix) determines how many unique digits are used and what each position represents. In any base N, you have N different digits (0 through N-1), and each position represents a power of N.

Decimal (Base 10): Our everyday system uses digits 0-9. The number 234 means 2×100 + 3×10 + 4×1, or 2×10² + 3×10¹ + 4×10⁰.

Binary (Base 2): Uses only 0 and 1. The binary number 1010 means 1×8 + 0×4 + 1×2 + 0×1 = 10 in decimal. Computers use binary because electronic circuits can easily represent two states (on/off, high/low).

Hexadecimal (Base 16): Uses 0-9 plus A-F (where A=10, B=11, ... F=15). Hexadecimal is popular in computing because each hex digit represents exactly 4 binary digits, making it a compact way to write binary values. The hex number FF equals 255 in decimal or 11111111 in binary.

Octal (Base 8): Uses digits 0-7. Less common today but still used in some contexts like Unix file permissions. Each octal digit represents exactly 3 binary digits.

Why Different Bases Matter

Understanding number bases is essential for anyone working with computers at a technical level:

Memory and Addresses: Memory addresses, color codes, and hardware registers are typically expressed in hexadecimal because it's more compact than binary while still mapping cleanly to binary.

Debugging: When examining raw data or debugging low-level issues, you often need to interpret values in different bases.

Permissions: Unix file permissions (chmod 755, for example) use octal notation where each digit represents three binary bits for read, write, and execute.

Colors: Web colors like #FF5733 are hexadecimal values where each pair of digits represents the red, green, and blue components (0-255 each).

Conversion Method

To convert between bases manually, you typically go through decimal as an intermediate step:

To Decimal: Multiply each digit by its positional value and sum. For binary 1011: 1×8 + 0×4 + 1×2 + 1×1 = 11.

From Decimal: Repeatedly divide by the target base and collect remainders (read in reverse). To convert 11 to binary: 11÷2=5r1, 5÷2=2r1, 2÷2=1r0, 1÷2=0r1. Reading remainders backward: 1011.

Our calculator handles this instantly, but understanding the method helps you verify results and work without tools when needed.

Common Patterns

Some patterns are worth memorizing:

  • Binary 1111 = Decimal 15 = Hex F
  • Binary 11111111 = Decimal 255 = Hex FF
  • Decimal powers of 2: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024...

Privacy

All conversions happen locally in your browser. Your numbers are never transmitted to any server. This makes the tool suitable for any purpose, including working with sensitive values.

Common Use Cases

Programming and Development

Convert between number formats when working with memory addresses, bitwise operations, or hardware registers.

Web Color Codes

Understand and manipulate hexadecimal color codes by converting to decimal RGB values.

Unix Permissions

Convert octal permission values (like 755) to understand the binary read/write/execute flags.

Debugging

Interpret raw data in hex dumps or debug output by converting to more readable formats.

Learning Computer Science

Understand how computers represent numbers internally by seeing the same value in multiple bases.

Embedded Systems

Work with register values and memory-mapped I/O addresses typically expressed in hexadecimal.

Worked Examples

Decimal to Binary

Input

Decimal: 42

Output

Binary: 101010, Hex: 2A, Octal: 52

42 in binary is 101010 (32+8+2). In hexadecimal, it's 2A (2×16 + 10). In octal, it's 52 (5×8 + 2).

Hexadecimal Color Value

Input

Hex: FF

Output

Decimal: 255, Binary: 11111111

FF is the maximum value for one byte (8 bits). In a color code like #FF0000, this represents full red intensity.

Frequently Asked Questions

Why do computers use binary?

Electronic circuits can easily represent two states (on/off, high/low voltage). Binary (base 2) maps directly to these two states, making it the natural choice for digital electronics. All data in computers is ultimately stored and processed as binary.

Why is hexadecimal popular in programming?

Hexadecimal is compact (one hex digit = 4 binary digits) and converts easily to/from binary. It makes long binary strings manageable: the 32-bit binary number 11111111111111111111111111111111 becomes just FFFFFFFF in hex.

What do the letters A-F mean in hexadecimal?

In base 16, we need 16 digits. Since we only have numerals 0-9, hexadecimal uses letters A-F to represent values 10-15. So A=10, B=11, C=12, D=13, E=14, F=15.

How do I know which base a number is in?

Context usually makes it clear. By convention, hexadecimal is often prefixed with 0x (0xFF), binary with 0b (0b1010), and octal with 0o (0o755). Without a prefix, assume decimal unless context suggests otherwise.

Is my data sent to a server?

No. All conversions happen locally in your browser using JavaScript. Nothing is transmitted anywhere. The tool works even without an internet connection.

What is the largest number this can convert?

The converter handles JavaScript's safe integer range (up to about 9 quadrillion in decimal). For most practical purposes, this is more than sufficient.