Base Converter | Binary Octal Hexadecimal Conversion Tool

Online number base conversion tool. Supports conversion between any bases from 2 to 36, including binary, octal, decimal, hexadecimal. Perfect for programmers and students.

Input Number

Valid Characters: 0-9
10-base

Common Base Conversion Results

Binary (2-base)
11111111
Octal (8-base)
377
Decimal (10-base)
255
Hexadecimal (16-base)
FF

Custom Base Conversion

2-base
255 (10-base) = 11111111 (2-base)

Usage Guide

  • Select source base and enter the number to convert
  • In the common base results section, check the base types you want to view
  • Common bases will automatically display conversion results with one-click copy
  • In the custom conversion section, select any base from 2-36 for conversion
  • Click quick examples to quickly input common test values
  • Supported characters: 0-9 digits, A-Z letters (case insensitive)

Number Base Knowledge

What is a Number Base?

A number base (also called radix) is a counting system that determines how many different symbols can be used in each position of a number representation. The base number equals the count of available symbols. For example, decimal has 10 symbols (0-9), binary has 2 symbols (0-1), and hexadecimal has 16 symbols (0-9, A-F). Positional notation is the foundation of modern number systems, where each position's value equals the base raised to a power.

Binary System

Binary is the fundamental language of computers, using only two digits: 0 and 1. This corresponds to circuit states: 0 represents off, 1 represents on. Binary invention can be traced back to 17th-century Leibniz, but it wasn't widely used in computer science until the 20th century. Each binary digit (bit) can represent 2 states, and n binary digits can represent 2^n different values.

Octal System

Octal uses 8 digits (0-7) and was widely used in early computing because 3 binary bits correspond exactly to 1 octal digit (2³=8). In Unix and Unix-like systems, octal is commonly used for file permissions, such as 755 meaning the owner has read-write-execute permissions, while group and other users have read-execute permissions. Although less used now, it can still be found in some embedded systems and legacy code.

Decimal System

Decimal is the most commonly used counting system by humans, using 10 digits (0-9). This likely originates from humans having 10 fingers. The positional notation of decimal first appeared in ancient India, then spread to the Arab world, and later to Europe. In decimal, each position's weight is a power of 10, such as 2023 = 2×10³ + 0×10² + 2×10¹ + 3×10⁰.

Hexadecimal System

Hexadecimal uses 16 symbols (0-9 and A-F) and is extremely important in computer science. Each hexadecimal digit corresponds to 4 binary digits (2⁴=16), making conversion between binary and hexadecimal very intuitive. Hexadecimal is widely used for memory addresses, color codes (like #FF0000 for red), machine code, Unicode character encoding, etc. Programmers often use hexadecimal to simplify long strings of binary data.

Base Conversion Principles

Base conversion is based on the mathematical principle of positional notation. Any number can be represented as: N = aₙ×Bⁿ + aₙ₋₁×Bⁿ⁻¹ + ... + a₁×B¹ + a₀×B⁰, where B is the base and aᵢ are the digits in each position. Conversion methods include: 1) Any base to decimal: weighted sum expansion; 2) Decimal to any base: successive division with remainder; 3) Binary to octal/hexadecimal conversion: using the relationships 2³=8 and 2⁴=16 for grouping conversion.

Higher Base Systems

Systems beyond base 16 typically use 0-9 and A-Z to represent larger values. The highest commonly seen is base 36, using the complete alphabet. These higher base systems are useful in certain special applications, such as generating short unique identifiers or compressed data representation. For example, YouTube's video IDs use a similar high-base encoding method to generate short identifiers.

Historical Development

Different civilizations developed different base systems: Babylonians used base 60 (still used in time and angle measurements today), Mayans used base 20, and ancient China sometimes used base 16. The development of modern computer science made bases 2, 8, and 16 particularly important. In the 1940s, computer pioneers like John von Neumann established binary as the standard for internal computer representation.

Practical Applications

Base conversion is ubiquitous in modern technology: IP address conversion in network programming, hash value representation in cryptography, pixel values in image processing, primary key generation in databases, register operations in embedded systems, color values in web development, bitwise operation optimization in game development, etc. Mastering base conversion is important for understanding computer underlying principles and optimizing program performance.