Skip to main content

Sigma Calculator — 527+ Free Calculator Tools

Binary Converter

Convert between binary, octal, decimal, and hexadecimal instantly — with the positional expansion shown step by step. Free and exact.

Home » Math Calculators » Binary Converter

Binary Converter

Every photo, video, message, and app on your devices is ultimately stored as binary — strings of ones and zeros. Programmers, network engineers, and electronics hobbyists constantly translate between binary and the more compact hexadecimal, or back to familiar decimal. Our free Binary Converter converts instantly among binary, octal, decimal, and hexadecimal, showing the positional expansion so you learn the method — not just the answer.

The core idea is positional notation: in any base, each digit’s value equals the digit times the base raised to the position’s power, counting from zero at the right. Decimal 345 means 3×10² + 4×10¹ + 5×10⁰. Binary 101 means 1×2² + 0×2¹ + 1×2⁰ = 5. Once you see that every base works the same way, converting becomes mechanical — and hexadecimal’s popularity becomes obvious: one hex digit represents exactly four binary digits, so long bit strings compress neatly.

How to Use the Binary Converter

  1. Type the number into the Value box (use digits 0–1 for binary, 0–7 for octal, 0–9 for decimal, 0–9 plus A–F for hex).
  2. Select the input base under From base.
  3. Select the output base under To base.
  4. Click Convert — the result appears with the positional expansion steps.

About Number Bases

Binary (base 2) uses only 0 and 1, mirroring the on/off states of transistors — which is why all digital hardware speaks it. Octal (base 8) groups three bits per digit and survives mainly in Unix file permissions (like chmod 755). Decimal (base 10) is the human everyday system, likely inherited from ten fingers. Hexadecimal (base 16) uses digits 0–9 plus letters A–F for values 10–15; because 16 = 2⁴, each hex digit maps to exactly four bits, making it the standard shorthand for memory addresses, color codes (#FF5733), and cryptographic hashes.

Converting to decimal always works the same way: expand each digit as digit × baseposition and add. Converting from decimal uses repeated division: divide by the target base, record remainders, and read them bottom-to-top. Between binary, octal, and hex there is a shortcut — digit grouping: 3 bits per octal digit, 4 bits per hex digit, converted directly without touching decimal.

The Base Conversion Formula

Decimal value = ∑ (digiti × basei), with i = 0 at the rightmost digit

To go the other way, repeatedly divide the decimal value by the target base and collect remainders from last to first. Binary↔hex conversion skips decimal entirely: regroup bits in fours.

Worked Examples

Example 1 — Binary 101101 to decimal. Expand: 1×25 + 0×24 + 1×23 + 1×22 + 0×21 + 1×2⁰ = 32 + 0 + 8 + 4 + 0 + 1 = 45.

Example 2 — Decimal 255 to hexadecimal. Divide by 16: 255 ÷ 16 = 15 remainder 15; 15 ÷ 16 = 0 remainder 15. Remainders bottom-to-top: 15, 15 → digits F, F. Answer: 0xFF — the maximum value of one byte, which is why it appears everywhere in computing.

Example 3 — Hex 0x2A to binary via grouping. 2 = 0010, A (10) = 1010. Concatenate: 00101010 = 42 in decimal. No division needed — grouping is the professional shortcut.

Practical Example 1: Reading a Color Code

The web color #FF5733 is three hex bytes: FF (red), 57 (green), 33 (blue). Convert red: F×161 + F×16⁰ = 15×16 + 15 = 255 — full red. Green: 5×16 + 7 = 87. Blue: 3×16 + 3 = 51. So #FF5733 is rgb(255, 87, 51), a vivid orange-red. Designers tweak these channels constantly, and hex makes the 0–255 range fit in two characters.

Practical Example 2: Subnet Masks

A /24 subnet mask is 255.255.255.0 — in binary, 24 ones then 8 zeros: 11111111.11111111.11111111.00000000. The boundary between the ones and zeros tells routers which bits identify the network versus the host. Converting any octet (e.g., 192 = 11000000) by grouping is a daily task in network certification exams.

5 Common Base Conversion Mistakes

  1. Reading binary left-to-right by place value. Position powers start at 0 on the right; the leftmost bit is the largest, not the “first.”
  2. Using O instead of 0, or I instead of 1. In many fonts they look identical — always use numeric zero and one in binary strings.
  3. Forgetting hex letters go to F. Hex digits run 0–9 then A(10) through F(15); “G” is never valid.
  4. Dropping leading zeros when grouping. Hex digit 2 is 0010, not 10 — pad each group to full width or the bits shift.
  5. Confusing endianness. Some systems store multi-byte values least-significant-byte first; the digits are the same but the byte order flips — always check which end is first.

Binary in Modern Technology

Binary is not an academic curiosity — it is the native language of every digital device you own. IP addresses are 32-bit numbers (IPv4) written as four decimal octets for human convenience: 192.168.1.1 is 11000000.10101000.00000001.00000001 in the machine’s tongue. Unicode text assigns every character a numeric code point — the letter “A” is 65, which is 1000001 in binary and 0x41 in hex — and UTF-8 encodes those numbers as variable-length byte sequences.

Cryptographic hashes like SHA-256 output 256 bits, conventionally displayed as 64 hex characters; comparing hashes is how software verifies downloads haven’t been tampered with. Permissions in Unix compress nine yes/no flags into three octal digits — chmod 755 is 111 101 101 in binary, read-write-execute for the owner and read-execute for everyone else. Even colors are numbers: 24-bit “true color” packs red, green, and blue intensities into three bytes, giving 16,777,216 possible colors.

At the hardware level, logic gates — AND, OR, NOT built from transistors — compute directly on bits, and an adder circuit chains them to sum binary numbers exactly the way you learned column addition in decimal. Floating-point numbers (IEEE 754) split bits into sign, exponent, and mantissa — which is why 0.1 + 0.2 ≠ 0.3 in most programming languages: the fractions are repeating binaries, rounded at 53 bits.

More Worked Examples

Example 4 — Octal 755 to binary (permissions). Expand each digit: 7 = 111, 5 = 101, 5 = 101. Concatenate: 111101101 — nine bits encoding rwxr-xr-x. System administrators read these fluently.

Example 5 — Decimal 200 to hex. 200 ÷ 16 = 12 remainder 8; 12 ÷ 16 = 0 remainder 12. Remainders bottom-to-top: 12, 8 → C, 8. Answer: 0xC8. (200 is also the decimal value of the binary 11001000.)

Example 6 — Hex 0xDEAD to decimal. D=13, E=14, A=10, D=13. Expand: 13×163 + 14×162 + 10×161 + 13×16⁰ = 53,248 + 3,584 + 160 + 13 = 57,005. Programmers love “hexspeak” constants like 0xDEADBEEF — recognizable in memory dumps.

Base Quick-Reference Table

Signed Numbers and Two’s Complement

So far we have handled only positive integers, but computers must represent negatives too. The dominant scheme is two’s complement: to negate a binary number, flip every bit and add one. In 8 bits, 5 is 00000101; flipped, 11111010; plus one, 11111011 = −5. The beauty of the scheme: the leftmost bit doubles as a sign flag (1 means negative), zero has a single representation, and addition hardware works unchanged — 5 + (−5) = 00000101 + 11111011 = 00000000 (the ninth carry bit falls off the 8-bit register).

This is why an 8-bit signed byte spans −128 to 127 rather than −127 to 127: the pattern 10000000 represents −128, with no “negative zero.” The same idea scales up — 32-bit integers run from −2,147,483,648 to 2,147,483,647 — and its limits cause real bugs: the famous Year 2038 problem will overflow signed 32-bit Unix timestamps, just as unsigned 32-bit odometers roll over at 4,294,967,295.

Example 7 — Negate 42 in 8-bit two’s complement. 42 = 00101010. Flip: 11010101. Add one: 11010110 = −42. Verify: 00101010 + 11010110 = 1 00000000 → the carry drops, leaving 00000000. Correct.

Example 8 — Hex 0xFF as signed vs unsigned byte. Unsigned: 0xFF = 255. Signed two’s complement: the leading 1 means negative; flip-and-add gives 00000001 = 1, so the value is −1. Same bits, different meaning — the programmer’s declared type decides.

Try It Yourself: Practice Problems

  1. Convert 1101102 to decimal. (Answer: 54)
  2. Convert 20010 to hexadecimal. (Answer: 0xC8)
  3. Convert 0x1F to binary using grouping. (Answer: 00011111)
  4. What is −7 in 8-bit two’s complement? (Answer: 11111001)

ASCII: When Binary Becomes Text

The bridge from numbers to the words you are reading is a character encoding. ASCII assigns the numbers 0–127 to letters, digits, and control codes: “A” is 65 (1000001 in binary, 0x41 in hex), “a” is 97, and “0” is 48 — which is why the digit characters sit 48 above their face values, a fact every programmer memorizes. Unicode extends the same idea past a million code points so every script on Earth — Arabic, Devanagari, emoji — has a number, and UTF-8 encodes those numbers as one to four bytes, staying identical to ASCII for English text. Try it above: convert 65 to binary and hex, and you have just hand-decoded the letter A.

Related Calculators

Frequently Asked Questions

How do I convert binary to decimal?

Multiply each bit by 2 raised to its position (starting at 0 on the right) and add. For 101101: 32 + 0 + 8 + 4 + 0 + 1 = 45.

How do I convert decimal to binary?

Repeatedly divide by 2 and record the remainders, then read them bottom-to-top. For 45: 45→22 r1, 22→11 r0, 11→5 r1, 5→2 r1, 2→1 r0, 1→0 r1 → 101101.

What is hexadecimal and why do programmers use it?

Hexadecimal is base 16 (digits 0–9, A–F). Because 16 = 2^4, one hex digit represents exactly four bits, so long binary strings compress 4:1 — ideal for memory addresses, color codes, and hashes.

What does 0xFF mean?

0xFF is hexadecimal for 255 — the largest value one byte can hold (eight 1-bits). The “0x” prefix is the conventional marker for hex notation in programming.

How do binary and hexadecimal relate?

Group binary digits in fours from the right; each group converts directly to one hex digit (0000=0 … 1111=F). Example: 0010 1010 → 0x2A.

What is octal used for?

Octal (base 8) groups three bits per digit and is used mainly for Unix file permissions — e.g., chmod 755 means rwxr-xr-x, with each digit encoding three permission bits.

Can binary represent fractions?

Yes, with the binary point: 101.11₂ = 4 + 0 + 1 + 1/2 + 1/4 = 5.75. Positions right of the point are negative powers of two (1/2, 1/4, 1/8…).

What is the largest number 8 bits can hold?

255 unsigned (0–255), or −128 to 127 in signed two’s-complement representation, which is how most systems store negative integers.

Cite this page as: Binary Converter. Sigma Calculator. Retrieved October 12, 2026, from https://sigmacalculator.net/math-calculators/binary-converter/

Last updated: October 12, 2026