Binary Converter
Enter a number and select its base to convert between all number systems.
Enter a number and select its base to see conversions.
How Does the Formula Work?
The binary converter instantly transforms numbers between four fundamental number systems used in computing and mathematics: binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16). Enter any number, select its base, and see all four representations update in real-time. This tool is essential for programmers, computer science students, network engineers, and anyone working with digital systems. Understanding number systems is a core competency in computing — from reading memory addresses to setting file permissions to defining colors in web design.
Binary → Decimal: each bit × 2^position, summed
Decimal → Binary: divide by 2, collect remainders
Binary → Hex: group 4 bits = 1 hex digit (1111 = F)
Binary → Octal: group 3 bits = 1 octal digit (111 = 7)
Example: 42₁₀ = 101010₂ = 52₈ = 2A₁₆
Binary: The Language of Computers
Binary is the most fundamental number system in computing. Every digital device — from smartphones to supercomputers — processes data as sequences of zeros and ones. Each binary digit (bit) represents a single on/off state in an electronic circuit. Eight bits form a byte, which can represent values from 0 to 255 (00000000 to 11111111). A kilobyte is 1,024 bytes, a megabyte is 1,048,576 bytes, and so on. Understanding binary is essential for low-level programming, bitwise operations, network subnet masks, and digital logic design. The binary representation of 42 is 101010, which means 1×32 + 0×16 + 1×8 + 0×4 + 1×2 + 0×1 = 32 + 8 + 2 = 42.
Hexadecimal: Compact Binary
Hexadecimal uses sixteen symbols (0-9, A-F) where each hex digit maps to exactly four binary bits. This makes hex a compact way to represent binary data — the byte 11111111 becomes simply FF. Web colors use hex notation: #FF0000 is pure red (255 red, 0 green, 0 blue), #00FF00 is green, #0000FF is blue, and #FFFFFF is white. Memory addresses in debugging tools display as hex. MAC addresses use hex pairs separated by colons (00:1A:2B:3C:4D:5E). Assembly language and machine code use hex extensively. IPv6 addresses use eight groups of four hex digits. The conversion between binary and hex is trivially simple — group binary digits in fours from right to left and convert each group.
Octal: Unix Permissions
Octal is less common today but remains important in Unix/Linux file permissions. The command chmod 755 sets permissions using three octal digits: 7 (111 in binary = read+write+execute for owner), 5 (101 = read+execute for group), and 5 (101 = read+execute for others). Each octal digit maps to three binary bits, making it natural for the three-permission system. Octal was historically used in older computing systems and some assembly languages. While hex has largely replaced octal in modern programming, understanding octal remains necessary for system administration and understanding legacy code.
How Conversion Works
Converting between number systems follows consistent mathematical principles. To convert any base to decimal, multiply each digit by its positional value (base raised to the position power) and sum the results. For example, binary 1010 = 1×8 + 0×4 + 1×2 + 0×1 = 10 in decimal. To convert decimal to any base, repeatedly divide by the target base and collect remainders in reverse order. For example, 42 divided by 2 gives quotients 21, 10, 5, 2, 1, 0 with remainders 0, 1, 0, 1, 0, 1 — reading remainders bottom-up gives 101010 in binary. The shortcut between binary and hex is grouping: each group of 4 binary digits equals one hex digit, and each group of 3 binary digits equals one octal digit.
Programming Applications
Number system conversion appears throughout programming. Bitwise operations (AND, OR, XOR, NOT, shift) are fundamental to systems programming, cryptography, and graphics. Network subnet masks use binary: 255.255.255.0 = 11111111.11111111.11111111.00000000 in binary, indicating a /24 network. Unicode character encoding uses hex codepoints: U+0041 is the letter A, U+00E9 is the accented letter é. Image formats store pixel data in binary. Compression algorithms manipulate individual bits. Database flags and permission systems use bitmasks. This converter helps you quickly verify calculations and build intuition for number system relationships. Enter any number, select its base, and see all four representations instantly — a daily tool for anyone working with digital systems.
Learning Number Systems
For students learning computer science, number system fluency is as important as understanding variables and loops. Practice converting small numbers mentally — with time, common values like 255 = FF = 11111111, 128 = 80 = 10000000, and powers of 2 become second nature. This converter provides instant feedback for practice: enter your calculated answer and verify it matches the tool's output. Start with decimal to binary conversion, then move to hex, which is the most practically useful in modern programming. Understanding why these systems exist and how they relate to each other gives you deeper insight into how computers actually work at the hardware level.
Whether you are debugging a network configuration, designing a digital circuit, or completing a computer science assignment, this converter eliminates manual calculation errors and saves time. Enter any number in any base and see all four representations instantly — the fastest way to work with number systems in your daily workflow.
From web colors to subnet masks, from file permissions to memory addresses — number system conversion is everywhere in computing. Master it with this free, instant converter.
Tips & Recommendations
Group binary into 4-bit chunks for easy hex conversion: 1111 = F, 1010 = A.
Results update as you type — instant feedback for learning and verification.
Maximum value for one byte. The most common reference point in computing.
Octal 755 = rwxr-xr-x. Unix permissions use 3-bit groups mapped to octal.
Frequently Asked Questions
What is binary?
A base-2 number system using only 0 and 1. The foundation of all digital computing — every file, image, and program is stored in binary.
What is hexadecimal?
A base-16 system using 0-9 and A-F. Widely used in programming for colors (#FF0000), memory addresses, and compact binary representation.
Why do computers use binary?
Because electronic circuits have two states: on (1) and off (0). This maps directly to binary digits (bits).
What is octal?
A base-8 system using 0-7. Used in Unix file permissions (chmod 755) and some legacy systems.
How do I convert manually?
Divide by the target base repeatedly, collecting remainders. Or group binary digits: 3 digits for octal, 4 for hex.
Recent Calculations
No calculations yet