Number Base Converter – Binary, Octal, Decimal, Hex Converter
Convert numbers between binary, octal, decimal, and hexadecimal bases instantly with our free online number base converter. Perfect for computer science students and programmers.
Understanding Number Bases
A number base (or radix) determines how many unique digits are used to represent numbers. Our everyday decimal system uses base 10 (digits 0-9). Computers use binary (base 2) because electronic circuits have two states: on and off. Programmers often use hexadecimal (base 16) as a compact way to represent binary data.
The position of each digit matters – it's a positional system. In decimal, the number 345 means 3x100 + 4x10 + 5x1. In binary, 101 means 1x4 + 0x2 + 1x1 = 5 in decimal.
Common Number Bases
Binary (Base 2)
Digits: 0, 1
The language of computers. Every piece of digital data is stored as binary. Eight binary digits form a byte.
1010 = 8+2 = 10 (decimal)Octal (Base 8)
Digits: 0-7
Historically used in computing because each octal digit represents exactly 3 binary digits. Still used in Unix file permissions.
777 = rwxrwxrwx permissionsDecimal (Base 10)
Digits: 0-9
Our everyday number system, likely originating from counting on ten fingers. The standard for human communication of quantities.
345 = 3x100 + 4x10 + 5x1Hexadecimal (Base 16)
Digits: 0-9, A-F
Compact representation of binary – each hex digit equals 4 binary digits. Used for memory addresses, colors (RGB), and MAC addresses.
FF = 255 = 11111111 (binary)Conversion Examples
Example 1: Decimal to Binary
Example 2: Binary to Hex
Example 3: Hex to Decimal
Example 4: RGB Color Values
Quick Fact
The hexadecimal system was introduced by IBM in the 1960s. Before that, some computers used octal. The letters A-F were chosen because they're the first six letters after the digits 0-9, making them easy to distinguish. Some early systems used other symbols for values 10-15!
Frequently Asked Questions
Why do programmers use hexadecimal?
Hex is compact and converts easily to binary. One hex digit = 4 bits (a nibble), two hex digits = 8 bits (a byte). It's much easier to read and write "0xFF" than "11111111" or even "255".
What does 0x mean before a number?
The prefix "0x" indicates a hexadecimal number in programming. So 0xFF means FF in hex = 255 in decimal. Similarly, "0b" prefix indicates binary (0b1010 = 10).
How do I convert without a calculator?
To convert to decimal: multiply each digit by its place value and add. To convert from decimal: repeatedly divide by the target base and collect remainders. For binary/hex, group bits by 4.
What is two's complement?
Two's complement is how computers represent negative numbers in binary. Invert all bits and add 1. For example, -1 in 8-bit is 11111111 (invert 00000000, add 1).
Why is octal still used?
Unix and Linux file permissions use octal notation. The permission "755" means rwxr-xr-x. Each digit represents read(4) + write(2) + execute(1) permissions for owner, group, and others.
Can bases be larger than 16?
Yes! Base 32 and base 64 are used for encoding binary data as text (like in URLs and email). Base 64 uses A-Z, a-z, 0-9, +, and / to represent 6 bits per character.
Other Free Tools
Binary Addition & Subtraction Calculator – Compute in Base 2
Add and subtract binary numbers step by step with our free online binary calculator. See each bit-by-bit operation clearly – perfect for computer science and digital electronics.
Two's Complement Calculator – Convert to Twos Complement
Convert any integer to its two's complement binary form or decode two's complement back to decimal with our free online calculator. Supports various bit widths.
Bitwise Operations Calculator – Compute AND OR XOR NOT Shifts
Perform bitwise AND, OR, XOR, NOT, left shift, and right shift operations on integers with our free online bitwise calculator. See binary representations alongside results.
Truth Table Generator – Create Logic Truth Tables Online
Generate truth tables for any logical expression with our free online truth table generator. Supports AND, OR, NOT, XOR, NAND, NOR, and implication operators for any number of variables.
Boolean Expression Evaluator – Evaluate Logic Expressions Online
Evaluate any Boolean expression for given variable values with our free online Boolean expression evaluator. Supports all logical operators including AND, OR, NOT, XOR, and more.
Roman Numeral Converter – Convert Numbers to Roman Numerals
Convert any integer to Roman numerals or translate Roman numerals back to numbers with our free online Roman numeral converter. Instant, accurate conversions for any value.
Data Storage Converter – Convert KB, MB, GB, TB Online
Convert between any digital storage unit with our free online data storage converter. Supports bytes, kilobytes, megabytes, gigabytes, terabytes, and petabytes instantly.
Scientific Notation Converter – Standard to Scientific Form
Convert any number to scientific notation or from scientific notation to standard form with our free online converter. Perfect for chemistry, physics, and large number calculations.