Number System Converter
Convert numbers between Decimal (base 10), Binary (base 2), Hexadecimal (base 16), and Octal (base 8).
Result
-
Base Unit
Relative Value
*Diagram shows values relative to the selected base unit (Decimal).
Unit Information
What is Decimal (Base 10)?
Decimal is the standard base-10 number system we use in everyday life. It uses ten digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. Each digit's position represents a power of 10 (e.g., 123 = 1*10² + 2*10¹ + 3*10⁰).
What is Binary (Base 2)?
Binary is a base-2 number system using only two digits: 0 and 1. It is the fundamental language of computers and digital circuits. Each digit (bit) represents a power of 2 (e.g., binary 101 = 1*2² + 0*2¹ + 1*2⁰ = 4 + 0 + 1 = 5 in decimal).
What is Hexadecimal (Base 16)?
Hexadecimal is a base-16 number system that uses sixteen distinct symbols: 0–9 to represent values zero to nine, and A, B, C, D, E, F to represent values ten to fifteen. It's often used as a more compact and human-readable way to represent binary data.
What is Octal (Base 8)?
Octal is a base-8 number system that uses the digits 0 through 7. Each position in an octal number represents a power of 8. It was more common in older computing systems as an alternative to hexadecimal.
Formulas
Decimal = Σ(d * base^p)
The value of any number is the sum (Σ) of its digits (d) multiplied by its base raised to its position power (p).
Decimal to Binary/Octal/Hex
To convert from decimal, repeatedly divide the number by the new base (2, 8, or 16) and record the remainders. The sequence of remainders, read in reverse, forms the new number.
Binary to Hexadecimal
Group binary digits into sets of four (starting from the right) and convert each group to its single hexadecimal equivalent (e.g., binary 1010 = hex A).
Hexadecimal to Binary
Convert each hexadecimal digit to its four-digit binary equivalent (e.g., hex A = binary 1010).
Binary to Octal
Group binary digits into sets of three (starting from the right) and convert each group to its single octal equivalent (e.g., binary 001 = octal 1).
Octal to Binary
Convert each octal digit to its three-digit binary equivalent (e.g., octal 1 = binary 001).
Key Reference Points
- Decimal 10 = Binary 1010 = Hex A = Octal 12
- Decimal 16 = Binary 10000 = Hex 10 = Octal 20
- Decimal 255 = Binary 11111111 = Hex FF = Octal 377
- Decimal 100 = Binary 1100100 = Hex 64 = Octal 144
- Decimal 42 = Binary 101010 = Hex 2A = Octal 52
- 2^0 = 1 (Binary 1, Hex 1)
- 2^4 = 16 (Binary 10000, Hex 10)
- 2^8 = 256 (Binary 100000000, Hex 100)
- 2^10 = 1024 (Binary 10000000000, Hex 400)
- 2^16 = 65536 (Binary...long, Hex 10000)
Did You Know?
Hexadecimal (base 16) uses digits 0-9 and letters A-F (representing 10-15). It's popular in computing because it provides a human-friendly way to represent binary-coded values. Each hexadecimal digit corresponds exactly to a four-bit binary sequence (a nibble), making conversions very direct.
Octal numbers are famously used in Unix-like systems to represent file permissions (e.g., 755). Each octal digit corresponds to 3 bits, representing read, write, and execute permissions for user, group, and others.
A 'bit' (binary digit) is the smallest unit of data. A 'byte' is typically 8 bits. A hexadecimal digit can represent 4 bits (a nibble), so two hex digits can represent one byte.
Ada Lovelace, a 19th-century mathematician, is often regarded as the first computer programmer for her work on Charles Babbage's analytical engine. She recognized that the machine could be used for more than just calculation.
Ancient Babylonians used a sexagesimal (base 60) numeral system. This is why we still have 60 seconds in a minute and 60 minutes in an hour, and 360 (60 x 6) degrees in a circle.
Computers use a system called 'two's complement' to represent negative numbers in binary. This allows addition and subtraction to be performed with the same simple hardware circuits.
Characters are represented in computers by numbers. ASCII (American Standard Code for Information Interchange) uses a 7-bit binary code to represent 128 characters. Unicode is a modern standard that uses up to 32 bits to represent almost every character and symbol from all writing systems in the world.
Moore's Law is an observation that the number of transistors on an integrated circuit (and thus computing power) doubles approximately every two years. This exponential growth is underpinned by the binary logic of these transistors.
The term 'computer bug' was famously recorded by Grace Hopper in 1947 when she and her team found a moth trapped in a relay of the Harvard Mark II computer, causing a malfunction. They taped the moth to the log book, and the term has been used for errors ever since.
The ancient Mayan civilization used a vigesimal (base-20) numeral system, likely based on counting both fingers and toes. They also independently developed the concept of zero.
Non-integers are represented in computers using a format called 'floating-point,' which is analogous to scientific notation. The IEEE 754 standard defines how these numbers are stored in binary, allocating bits for a sign, an exponent, and a mantissa.
When a number is too large to fit in a single byte, the order of the bytes in memory matters. 'Big-endian' systems store the most significant byte first, while 'little-endian' systems store the least significant byte first. This can cause issues when transferring data between different systems.
The abacus is one of the earliest known calculating tools. While it doesn't use written numerals, it is a physical representation of a base system (often base 10), allowing for rapid arithmetic.
While binary computing dominates, ternary computing, which uses three states (e.g., -1, 0, 1), has been explored. Theoretically, it could be more efficient than binary, but practical implementation has proven difficult.
A Gray code is a binary numeral system where two successive values differ in only one bit. This property is useful in preventing errors in electromechanical switches and digital communication.
An IPv4 address (e.g., 192.168.1.1) is a 32-bit binary number, but it's represented as four decimal numbers for human readability. Each decimal number represents one byte (8 bits).
Programmers can directly manipulate data at the binary level using bitwise operations like AND, OR, XOR, and NOT. These are extremely fast and are used in low-level programming, graphics, and cryptography.
The ancient Incan empire used a complex system of knotted strings called 'quipu' to record data. It's believed to be a three-dimensional binary code system that could store both numerical and narrative information.