Binary, Hex, Decimal & Octal Converter

Free binary converter — instantly convert numbers between binary, hex to decimal, decimal to binary, and octal. Essential number system converter for programmers, CS students, and anyone learning how computers represent data.

💻

Binary / Hex / Decimal Converter

Convert between number bases instantly

Bit Length
Byte Size

Binary Converter: How Number Systems Work in Computer Science

Computers work in binary (base 2) because transistors inside processors have exactly two states: on (1) and off (0). Every piece of data — text, images, video, code — ultimately reduces to sequences of 1s and 0s stored in memory. Decimal (base 10) is the number system humans naturally use, while hexadecimal (base 16) is the programmer's shorthand for binary because one hex digit maps cleanly to exactly four binary bits. Converting between these number systems is a foundational skill in computer science, embedded systems programming, network engineering, and digital electronics. Understanding how hex to decimal and binary to decimal conversions work makes you a more effective developer at every level.

In practice, hexadecimal appears everywhere in the computing world. Web colors are six-digit hex codes — #FF5733 breaks into Red=FF (255), Green=57 (87), Blue=33 (51). IPv6 addresses like 2001:0db8:85a3::8a2e:0370:7334 are groups of 4 hex digits separated by colons. x86 memory addresses in debuggers show up as hex values like 0x7FFE4320. And Unix/Linux file permissions are set in octal — chmod 755 means owner has read (4) + write (2) + execute (1) = 7, group has read (4) + execute (1) = 5, others have the same 5. This binary and hex converter handles all four base conversions simultaneously — type in any field and the rest update instantly.

1️⃣

Binary (Base 2)

The native language of computers. Uses only 0 and 1 — each digit is one bit. 8 bits = 1 byte = values 0–255. Binary 1010 = Decimal 10. Binary 1111 1111 = Decimal 255 = Hex FF. The foundation of all digital data storage and processing.

🔠

Hexadecimal (Base 16)

Uses digits 0–9 and letters A–F. One hex digit represents exactly 4 binary bits, making it a compact shorthand. Hex FF = Binary 11111111 = Decimal 255. Used in web colors, memory addresses, machine code, and network protocols like IPv6.

8️⃣

Octal (Base 8)

Uses digits 0–7. Still relevant today in Unix/Linux file permission notation — chmod 755 (rwxr-xr-x) and chmod 644 (rw-r--r--) are classic examples. Each octal digit maps to 3 binary bits. Octal 7 = Binary 111 = Decimal 7.

💻

Real-World Applications

HTML/CSS colors: hex (#3A86FF). IPv6 addresses: hex groups. Unicode characters: hex code points (U+1F600). Machine code and assembly: hex opcodes. RAM addresses in debuggers: hex. Unix permissions: octal. All RAM contents: binary. The number system converter helps you move fluently between them all.

Formula & Logic

Binary is base 2, so each position represents a power of two rather than of ten, and only the digits 0 and 1 exist. Arithmetic follows the same rules as decimal with a much lower carry threshold: 1 + 1 produces 0 with a carry, exactly as 9 + 1 does in decimal. Conversion to decimal is a matter of summing the place values where a 1 appears; conversion the other way is repeated division by 2, reading the remainders from last to first. Hexadecimal exists as a shorthand because 16 is 2⁴, so each hex digit maps to exactly four binary digits with no arithmetic required.

Decimal value = Σ (digit × 2^position), counting from 0 at the rightDecimal → binary: divide by 2 repeatedly, read remainders bottom-upAddition: 0+0=0 · 0+1=1 · 1+1=10 (0 carry 1) · 1+1+1=11 (1 carry 1)

where:

bit
one binary digit
byte
eight bits, representing 0–255 unsigned
MSB
most significant bit — leftmost, highest place value

Assumptions: Unsigned arithmetic. Signed integers normally use two's complement, where the leading bit indicates sign and negation is "invert all bits and add one" — which is why an 8-bit signed range is −128 to +127 rather than −127 to +127.

Step-by-Step Example: 1011 + 1101 in Binary

Add two binary numbers directly, then verify in decimal.

  • First1011₂
  • Second1101₂
  1. Convert for checking: 1011 = 8 + 0 + 2 + 1 = 11; 1101 = 8 + 4 + 0 + 1 = 13.
  2. Add the rightmost column: 1 + 1 = 10, so write 0 and carry 1.
  3. Next column: 1 + 0 + carry 1 = 10, write 0 and carry 1.
  4. Next: 0 + 1 + carry 1 = 10, write 0 and carry 1.
  5. Leftmost: 1 + 1 + carry 1 = 11, write 1 and carry 1, which becomes the new leading digit.
  6. Result 11000₂ — verify: 16 + 8 = 24, and 11 + 13 = 24. Correct.

Result1011₂ + 1101₂ = 11000₂ (24 in decimal)

The result needed five bits to hold a sum of two four-bit numbers. In fixed-width arithmetic that carry out of the top bit is exactly what an overflow flag detects — and ignoring it is how a four-bit register would report 24 as 8.

Frequently Asked Questions

Type any decimal number in the Decimal field for instant conversion. Manual method: repeatedly divide by 2, collecting remainders. Example: 13 decimal → 13÷2=6r1, 6÷2=3r0, 3÷2=1r1, 1÷2=0r1. Read remainders bottom-up: 1101 binary. Verify: 1×8 + 1×4 + 0×2 + 1×1 = 8+4+0+1 = 13. This calculator converts between binary, decimal, hex, and octal simultaneously.
Hexadecimal (base 16, digits 0-9 and A-F) is used throughout computing: HTML/CSS colors (#FF5733 = R:255 G:87 B:51), memory addresses in debuggers, file signatures (PDF starts with 25504446 in hex), IP addresses in IPv6, Unicode code points (e.g., U+1F600 = emoji), and binary file editing. One hex digit = exactly 4 binary bits, making it a compact binary shorthand.

Related Calculators

✔ Reviewed by the True Value Calc editorial team📅 Last updated May 2026📚 Sources: Peer-reviewed formulas & official U.S. government data📑 How we build & check these