Converter

Base Converter | Convert Binary, Decimal, Octal, Hex Number Systems

Free base converter. Convert between Binary, Decimal, Octal, Hexadecimal, and custom bases instantly with formulas, examples, and complete guide.
Base Converter

Base Converter - Convert Binary, Decimal, Octal & Hex

Welcome to the comprehensive Base Converter designed to help programmers, students, engineers, and computer science enthusiasts convert between Binary (Base-2), Decimal (Base-10), Octal (Base-8), Hexadecimal (Base-16), and any custom base from 2 to 36 instantly with detailed formulas and educational content.

Multi-Base Number System Converter

Custom Base Converter (Base 2-36)

Enter a number in any base to see conversions to all other bases

Understanding Number Base Systems

What is a Number Base?

A number base (or radix) is the number of unique digits, including zero, used to represent numbers in a positional numeral system. The most common base is decimal (base-10) which uses ten digits (0-9). Computer systems primarily use binary (base-2), but also work with octal (base-8) and hexadecimal (base-16) for different purposes. Understanding base systems is fundamental to computer science, digital electronics, and low-level programming.

Binary (Base-2)

Binary is the fundamental numbering system in computing, using only two digits: 0 and 1. Each digit is called a bit. Binary directly represents the on/off states of transistors in digital circuits. All digital data—text, images, programs—is ultimately stored as binary sequences. Understanding binary is essential for bitwise operations, understanding memory allocation, digital logic design, and comprehending how computers process information at the hardware level.

Decimal (Base-10)

Decimal is the standard numbering system humans use daily, with ten digits (0-9). Each position represents a power of 10. Decimal is intuitive for human understanding but requires conversion for computer processing. Programmers use decimal for most calculations and user-facing numbers, which are then converted to binary internally by the computer. Understanding decimal-to-other-base conversions bridges human-readable numbers and computer-internal representations.

Hexadecimal (Base-16)

Hexadecimal uses sixteen symbols: 0-9 and A-F (representing 10-15). Each hex digit represents exactly four binary bits, making hex a compact representation of binary data. Hex is ubiquitous in computing: memory addresses (0x7FFF), color codes (#FF5733), machine code debugging, and data dumps. Two hex digits represent one byte (00-FF), making hex perfect for byte-oriented data representation in a human-readable format.

Octal (Base-8)

Octal uses eight digits (0-7), with each octal digit representing exactly three binary bits. Historically important in early computing systems, octal remains relevant in Unix/Linux file permissions (chmod 755) and some embedded systems. Each octal digit maps cleanly to three bits (000-111), making octal-to-binary conversion straightforward. While less common today than hexadecimal, understanding octal is valuable for system administration and legacy system maintenance.

General Base Conversion Formula

Any Base to Decimal

\[ \text{Decimal} = \sum_{i=0}^{n-1} d_i \times b^i \]

Where \( d_i \) is the digit at position \( i \) and \( b \) is the base

Example: Binary 1010 (base-2) to decimal:

\( 0×2^0 + 1×2^1 + 0×2^2 + 1×2^3 = 0+2+0+8 = 10 \)

Decimal to Any Base

Divide by target base repeatedly, recording remainders bottom-up

Example: Decimal 10 to binary (base-2):

10 ÷ 2 = 5 remainder 0

5 ÷ 2 = 2 remainder 1

2 ÷ 2 = 1 remainder 0

1 ÷ 2 = 0 remainder 1

Reading bottom-up: 1010

Converting Between Non-Decimal Bases

Convert to decimal as intermediate step:

Source Base → Decimal → Target Base

Example: Hex A to Octal:

Hex A → Decimal 10 → Octal 12

Comprehensive Conversion Table

DecimalBinaryOctalHexadecimal
0000
510155
10101012A
15111117F
16100002010
321000004020
64100000010040
25511111111377FF

Custom Base Systems

Bases 2-36 Explained

Number systems can use any base from 2 upwards. Bases 2-10 use standard digits 0-9. Bases above 10 add letters: base-11 uses 0-9 and A (representing 10), base-12 adds B, continuing to base-36 which uses 0-9 and A-Z. This 36-base limit exists because we have 10 digits plus 26 letters in the English alphabet. Custom bases are useful in specific applications: base-60 for time (60 seconds/minutes), base-12 (duodecimal) for some measurement systems, and base-32 for encoding schemes.

Practical Uses of Custom Bases

  • Base-32: Used in Base32 encoding for data transmission (Crockford's Base32)
  • Base-36: Used in some short URL services and compact identifiers
  • Base-64: Common encoding for binary data in text formats (uses + and /)
  • Base-12: Historically used for measurements (dozen, gross)
  • Base-60: Ancient Sumerian system, still used for time and angles

Practical Applications

Computer Programming

Programmers use different bases for different purposes. Binary for bitwise operations, understanding bit flags, and working with hardware registers. Hexadecimal for memory addresses, debugging assembly code, and representing byte values compactly. Octal for Unix file permissions (chmod 644). Understanding base conversions is essential for systems programming, embedded development, network programming, and debugging low-level code. Many languages support multiple base literals: 0b1010 (binary), 10 (decimal), 0xA (hex), 0o12 (octal).

Digital Circuit Design

Electronics engineers work with binary when designing digital circuits and FPGAs. Logic gates operate on binary values. Hexadecimal is used to represent memory contents and configuration registers compactly. Understanding base conversions helps analyze circuit behavior, read datasheets, program microcontrollers, and debug hardware. State machines, truth tables, and Boolean algebra all rely on understanding binary and its relationship to other bases. Hardware description languages like VHDL and Verilog use multiple base representations.

Data Encoding and Cryptography

Cryptographic algorithms and data encoding schemes use various base systems. Base64 encoding converts binary data to ASCII text for email transmission. Base32 is used in TOTP (Time-based One-Time Password) authentication. Hash values are displayed in hexadecimal. Understanding base conversions helps implement encoding schemes, verify cryptographic operations, and analyze security protocols. Blockchain addresses and cryptocurrency wallets use base conversions for human-readable representations.

Networking and Protocols

Network engineers use multiple bases. IPv4 addresses are 32-bit binary numbers displayed in dotted decimal (192.168.1.1). Subnet masks require binary understanding. MAC addresses use hexadecimal notation. Network protocols specify field sizes in bits, requiring binary-to-hex conversions for analysis. Packet analysis tools like Wireshark display data in hexadecimal, and understanding base conversions helps interpret protocol fields, troubleshoot connectivity, and analyze network traffic patterns.

Common Questions

Why do we need different number bases?

Different bases serve different purposes. Binary is natural for digital circuits (on/off states). Hexadecimal provides compact, human-readable representation of binary data. Decimal is intuitive for humans. Octal was historically useful for grouping bits. Each base offers advantages: binary for hardware understanding, hex for compactness, decimal for human calculations, octal for Unix permissions. Using the appropriate base for each context improves efficiency, reduces errors, and enhances communication among professionals.

How do you convert between bases without using decimal?

Direct conversions between bases with power relationships are possible. Binary-to-octal: group 3 bits (101|010 = 52 octal). Binary-to-hex: group 4 bits (1010|1010 = AA hex). Octal-to-binary: expand each digit to 3 bits. Hex-to-binary: expand each digit to 4 bits. For bases without power relationships (like hex-to-octal), you must use decimal as an intermediate step or perform the calculation using the mathematical formula directly in the source base.

What is the maximum base we can use?

Theoretically, any positive integer can be a base. Practically, base-36 is the standard maximum using 0-9 and A-Z. Some systems extend to base-62 by distinguishing uppercase and lowercase letters (0-9, a-z, A-Z). Base-64 encoding uses additional symbols (+, /) but isn't strictly a base-64 number system. For mathematical convenience, bases are typically limited to what can be represented with common alphanumeric characters. Higher bases become impractical for human use but are mathematically valid.

Why is hexadecimal so popular in computing?

Hexadecimal perfectly aligns with binary structure. One hex digit represents exactly 4 bits, and two hex digits represent one byte (8 bits). This clean mapping makes hex ideal for representing binary data compactly. Memory addresses, machine code, color codes, and data dumps use hex because it's far more readable than binary (FF vs 11111111) while maintaining clear correspondence with the underlying binary. Hex strikes the perfect balance between compactness and clarity for computer-related numbers.

How are negative numbers represented in different bases?

The base conversion formulas shown work for unsigned (positive) integers. Negative numbers require additional representation schemes. In binary, computers use two's complement for signed integers. In other bases, negative numbers are typically indicated with a minus sign (-), but the underlying computer representation is always binary two's complement. When converting negative numbers between bases, handle the sign separately and convert the absolute value, or understand the bit pattern of two's complement representation in binary first.

Quick Reference Guide

Base Notation Prefixes

  • Binary: 0b prefix (0b1010) in many programming languages
  • Octal: 0o or 0 prefix (0o12 or 012)
  • Decimal: No prefix (10)
  • Hexadecimal: 0x prefix (0xA)

Conversion Shortcuts

  • Binary ↔ Octal: Group 3 bits per octal digit
  • Binary ↔ Hex: Group 4 bits per hex digit
  • Powers of 2: 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024
  • Powers of 8: 8, 64, 512, 4096
  • Powers of 16: 16, 256, 4096, 65536

Why Choose RevisionTown Resources?

RevisionTown is committed to providing accurate, user-friendly tools and educational resources across diverse topics. While we specialize in mathematics education for curricula like IB, AP, GCSE, and IGCSE, we also create practical tools for technical applications like this Base Converter.

Our converter combines precision with instant calculations, custom base support, and comprehensive explanations to help students, programmers, engineers, and computer science enthusiasts understand and apply number system conversions effectively in programming, digital electronics, networking, cryptography, and computer science education.

About the Author

Adam

Co-Founder at RevisionTown

Math Expert specializing in various curricula including IB, AP, GCSE, IGCSE, and more

Connect on LinkedIn

info@revisiontown.com

Adam brings extensive experience in mathematics education and creating practical educational tools. As co-founder of RevisionTown, he combines analytical precision with user-focused design to develop calculators and resources that serve students, professionals, and individuals across various domains. His commitment to accuracy and clarity extends to all RevisionTown projects, ensuring users receive reliable, easy-to-understand information for their needs.

Note: This Base Converter handles conversions between Binary (Base-2), Decimal (Base-10), Octal (Base-8), Hexadecimal (Base-16), and any custom base from 2 to 36. Enter a value in any standard base for automatic conversion to all others, or use the custom base converter for specialized bases. Binary uses 0-1, Octal uses 0-7, Decimal uses 0-9, and Hexadecimal uses 0-9 and A-F. Custom bases up to 36 use 0-9 and A-Z. This tool is essential for computer science education, programming, digital electronics, cryptography, and understanding positional numeral systems.

Shares: