Last updated:
Binary Calculator
Convert decimal to binary, hex, and octal instantly. Perform binary addition, subtraction, and more. Free online binary calculator, 2026.
Binary Calculator
Free online binary calculator — convert and calculate between binary, decimal, octal, and hexadecimal with AI-powered insights.
Enter values above to see results.
About This Calculator
Related Articles
📚 In-Depth Guide
This calculator is part of a comprehensive guide
Algebra & Equations Guide 2026: Solving Linear, Quadratic, Systems, Polynomials & More
Full GuideComprehensive 2026 algebra guide covering order of operations, linear equations, quadratic formula, factoring polynomials, systems of equations (substitution, elimination, matrices), exponent rules, logarithms, fraction arithmetic, rational expressions, absolute value, inequalities, slope-intercept form, and binary/hexadecimal conversions — with free algebra calculators for students, teachers, and test-takers.
The 2026 Complete Percentage Guide: Every Formula, Trick & Real-World Application — From Basic to Advanced
Master every percentage calculation in 2026: the 4 core formulas, percentage increase/decrease, reverse percentage, CAGR, markup vs. margin, tip/tax/discount math, GPA percentages, statistics (percentile, z-score), and compounding — with 15 long-tail keyword examples and a free percentage calculator.
Geometry Guide: Area, Volume & Surface Area Formulas for Every Shape (2026)
Complete 2026 geometry reference covering 2D area formulas, 3D volume and surface area calculations, triangles, circles, coordinate geometry, and composite shapes. Includes free area calculator, volume calculator, surface area calculator, and right triangle solver. NIST-aligned, with 25+ shapes, 40+ formulas, and real-world applications for flooring, landscaping, construction, and engineering.
🔢 Binary Calculator — Complete Guide
Number Base Systems
| Base | Name | Digits | Example |
|---|---|---|---|
| 2 | Binary | 0–1 | 1010₂ = 10₁₀ |
| 8 | Octal | 0–7 | 12₈ = 10₁₀ |
| 10 | Decimal | 0–9 | 10₁₀ = 10₁₀ |
| 16 | Hexadecimal | 0–9, A–F | A₁₆ = 10₁₀ |
Myths vs Facts
Frequently Asked Questions
How do I convert binary to decimal?›
Multiply each binary digit by 2 raised to its positional value (from right, starting at 0), then sum. E.g., 1011₂ = 1×8 + 0×4 + 1×2 + 1×1 = 11₁₀.
What is a bitwise AND operation?›
AND compares bits position-by-position: the result bit is 1 only if BOTH input bits are 1. E.g., 1010 AND 1100 = 1000. Used for masking specific bits in low-level programming.
What is XOR used for?›
XOR (exclusive OR) outputs 1 when bits differ. It's used in encryption algorithms, checksums, RAID parity, and simple bit-swapping without a temporary variable.
What is two's complement?›
Two's complement is the standard way to represent negative integers in binary. Negate a number by inverting all bits (one's complement) then adding 1. It allows CPUs to use the same addition circuit for both positive and negative numbers.
Why do computers use binary?›
Digital circuits have two stable voltage states (high/low, on/off). Binary maps perfectly to this: 1 = high voltage, 0 = low voltage. Boolean algebra (AND, OR, NOT) provides the mathematical foundation for all logic operations.
How does hexadecimal relate to binary?›
Each hex digit represents exactly 4 binary bits (a "nibble"). FF₁₆ = 11111111₂. Programmers use hex to represent memory addresses, color codes (RGB), and machine code compactly.
What is octal used for?›
Octal (base 8) is used in Unix/Linux file permissions (e.g., chmod 755). Each octal digit represents 3 binary bits. It was more common in early computing but largely replaced by hexadecimal.
How do I add binary numbers?›
Binary addition follows the same rules as decimal but with only 0s and 1s: 0+0=0, 0+1=1, 1+0=1, 1+1=10 (carry 1). E.g., 1011 + 0110 = 10001.
Related Calculators
Explore All Math Calculators
Reviewed by CalculatorApp.me Math Team
Binary Calculator — Complete Guide
Convert between binary, decimal, hexadecimal, and octal. Understand bitwise operations, two's complement, and how computers represent data.
0 & 1
Two binary digits
2⁸ = 256
One byte range
IEEE 754
Float standard
UTF-8
Text encoding
Understanding Binary (Base 2)
The binary number system (base 2) uses only two digits: 0 and 1. Each digit (called a bit) represents a power of 2. Binary is the foundation of all digital computing — processors, memory, storage, and networking all operate on binary data.
In the decimal system (base 10), the number 347 means 3×10² + 4×10¹ + 7×10⁰. Similarly, in binary, 1101₂ means 1×2³ + 1×2² + 0×2¹ + 1×2⁰ = 8 + 4 + 0 + 1 = 13₁₀.
Grouping bits creates larger units: 4 bits = a nibble (0–15), 8 bits = a byte (0–255), 16 bits = a word (historical), 32 bits = a dword, 64 bits = a qword. Modern processors work with 64-bit integers natively, handling values up to 2⁶⁴ − 1 = 18,446,744,073,709,551,615.
Number Base Conversions
Repeated Division by 2: 42 ÷ 2 = 21 remainder 0 21 ÷ 2 = 10 remainder 1 10 ÷ 2 = 5 remainder 0 5 ÷ 2 = 2 remainder 1 2 ÷ 2 = 1 remainder 0 1 ÷ 2 = 0 remainder 1 Read remainders bottom→top: 42₁₀ = 101010₂ Verify: 32+0+8+0+2+0 = 42 ✓ For fractions: 0.625 × 2 = 1.25 → 1 0.25 × 2 = 0.5 → 0 0.5 × 2 = 1.0 → 1 0.625₁₀ = 0.101₂
The repeated-division method works for any base conversion. For fractions, multiply by the target base instead and read integer parts top→bottom.
Group bits into nibbles (4 bits): Binary: 1010 1111 0011 1100 Hex: A F 3 C 0000=0 0100=4 1000=8 1100=C 0001=1 0101=5 1001=9 1101=D 0010=2 0110=6 1010=A 1110=E 0011=3 0111=7 1011=B 1111=F Examples: 1111 1111₂ = FF₁₆ = 255₁₀ 0001 0000₂ = 10₁₆ = 16₁₀ 1100 1010₂ = CA₁₆ = 202₁₀ Hex is compact representation: 32-bit address in binary: 32 chars Same in hex: only 8 chars 0xDEADBEEF = 11011110...
Hexadecimal is the standard shorthand for binary data. Memory addresses, color codes (#FF5733), MAC addresses (AA:BB:CC:DD:EE:FF), and debug output all use hex.
Group bits into triplets (3 bits): Binary: 101 010 111 100 Octal: 5 2 7 4 000=0 010=2 100=4 110=6 001=1 011=3 101=5 111=7 Examples: 111 111 111₂ = 777₈ = 511₁₀ 001 000₂ = 10₈ = 8₁₀ Unix File Permissions (octal): chmod 755 = rwxr-xr-x 7 = 111₂ = rwx (read+write+exec) 5 = 101₂ = r-x (read+exec) 4 = 100₂ = r-- (read only) 0 = 000₂ = --- (no permissions)
Octal (base 8) maps cleanly to 3-bit groups. Its primary modern use is Unix file permissions: 644, 755, 777 are all octal representations of 9-bit permission sets.
32-bit float layout: ┌─┬──────────┬───────────────────────┐ │S│ Exponent │ Mantissa │ │1│ 8 bits │ 23 bits │ └─┴──────────┴───────────────────────┘ Value = (-1)ˢ × 1.mantissa × 2^(exp-127) Example: 6.5₁₀ 6.5 = 110.1₂ = 1.101 × 2² Sign: 0 (positive) Exponent: 2 + 127 = 129 = 10000001₂ Mantissa: 10100000000000000000000 Full: 0 10000001 10100000000000000000000 Hex: 0x40D00000 Special values: 0 00000000 000...0 = +0 0 11111111 000...0 = +∞ 0 11111111 1xx...x = NaN 64-bit double: 1+11+52 bits Precision: ~15-16 decimal digits
IEEE 754 (1985) standardized floating-point arithmetic worldwide. The infamous 0.1 + 0.2 ≠ 0.3 is because 0.1 has an infinite binary expansion, causing unavoidable rounding.
Bitwise Operations
| Operation | Symbol | Example (Binary) | Result | Use Case |
|---|---|---|---|---|
| AND | & | 1100 & 1010 | 1000 | Masking bits, checking flags |
| OR | | | 1100 | 1010 | 1110 | Setting flags, combining masks |
| XOR | ^ | 1100 ^ 1010 | 0110 | Toggle bits, encryption, swap |
| NOT | ~ | ~1100 | 0011 | Invert all bits (one's complement) |
| Left Shift | << | 0011 << 2 | 1100 | Multiply by 2ⁿ (fast power of 2) |
| Right Shift | >> | 1100 >> 2 | 0011 | Divide by 2ⁿ (integer division) |
| Unsigned Right Shift | >>> | 1100 >>> 1 | 0110 | Shift with zero-fill (no sign extend) |
Bitwise operations execute in a single CPU clock cycle — far faster than arithmetic equivalents. They're fundamental to device drivers, compression algorithms, hash functions, and graphics programming.
Two's Complement (Signed Integers)
| Binary (8-bit) | Unsigned Value | Signed Value | Notes |
|---|---|---|---|
| 0000 0000 | 0 | 0 | Zero |
| 0000 0001 | 1 | +1 | Smallest positive |
| 0111 1111 | 127 | +127 | Largest positive (signed 8-bit) |
| 1000 0000 | 128 | −128 | Most negative (signed 8-bit) |
| 1111 1110 | 254 | −2 | Invert bits of 2, add 1 |
| 1111 1111 | 255 | −1 | All bits set |
| — | 0 to 255 | −128 to +127 | 8-bit range comparison |
To negate in two's complement: flip all bits (NOT), then add 1. Example: +5 = 00000101 → flip → 11111010 → add 1 → 11111011 = −5. This system makes addition/subtraction hardware identical for signed and unsigned numbers.
Data Types & Storage Sizes
| Type | Bits | Unsigned Range | Signed Range | Common Use |
|---|---|---|---|---|
| byte / int8 | 8 | 0 – 255 | −128 to 127 | Pixel channels, ASCII |
| short / int16 | 16 | 0 – 65,535 | −32,768 to 32,767 | Audio samples, sensor data |
| int / int32 | 32 | 0 – 4.29×10⁹ | −2.15×10⁹ to 2.15×10⁹ | Loop counters, IDs |
| long / int64 | 64 | 0 – 1.84×10¹⁹ | −9.22×10¹⁸ to 9.22×10¹⁸ | Timestamps, file sizes |
| float32 | 32 | ±1.18×10⁻³⁸ to ±3.4×10³⁸ | ~7 decimal digits | GPU, ML weights |
| float64 (double) | 64 | ±2.2×10⁻³⁰⁸ to ±1.8×10³⁰⁸ | ~15 decimal digits | Scientific, financial |
History of Binary Numbers
Pingala — Binary in Indian Prosody
The Indian mathematician Pingala used a binary-like system (laghu/guru, short/long syllables) to classify Sanskrit meters. His Chandaḥśāstra describes a system equivalent to binary numbers, predating Leibniz by nearly 2,000 years.
Leibniz — Formal Binary System
Gottfried Wilhelm Leibniz published 'Explication de l'Arithmétique Binaire', the first formal description of the binary number system. He demonstrated all arithmetic (addition, subtraction, multiplication, division) in base 2. He was inspired by the Chinese I Ching hexagrams.
Boole — Boolean Algebra
George Boole published 'An Investigation of the Laws of Thought', creating Boolean algebra. His binary logic (TRUE/FALSE, 1/0) with AND, OR, NOT operations became the mathematical foundation for all digital circuits and computer science.
Shannon — Boolean Logic in Circuits
Claude Shannon's MIT master's thesis showed that Boolean algebra could be implemented with electrical relay circuits. This breakthrough connected Boole's abstract mathematics to physical hardware, making digital computers possible.
Von Neumann — Binary Computer Architecture
John von Neumann's EDVAC report described a stored-program computer using binary arithmetic and memory. The von Neumann architecture — where both programs and data are stored in binary memory — remains the basis of virtually all modern computers.
IEEE 754 — Floating-Point Standard
The IEEE published Standard 754 for floating-point arithmetic, standardizing how computers represent real numbers in binary. This eliminated incompatibilities between hardware vendors and established the 32-bit float / 64-bit double formats used universally today.
Key Research & Data
Shannon (1948) — Bell System Technical Journal
A Mathematical Theory of Communication
Shannon introduced the 'bit' as the fundamental unit of information: the amount of information in a binary choice. His information theory proved that any data can be encoded in binary with optimal efficiency. This paper founded the entire field of digital communications.
IEEE 754-2019 Standard
Floating-Point Arithmetic Standard
The updated IEEE 754 standard defines binary16, binary32, binary64, and binary128 formats used by every modern processor. It specifies rounding modes, special values (±∞, NaN, ±0), and exception handling. It enables portable numerical computing across all hardware.
Knuth — The Art of Computer Programming Vol. 2
Seminumerical Algorithms (Binary Arithmetic)
Knuth's encyclopedic treatment of binary arithmetic provides the theoretical foundation for computer arithmetic: efficient multiplication (Karatsuba, FFT-based), division algorithms, floating-point gotchas, and random number generation — all operating on binary representations.
Unicode Consortium — Unicode 16.0
Universal Character Encoding
Unicode assigns unique binary codepoints to 154,998 characters from 168 scripts. UTF-8 encoding uses 1-4 bytes per character and is used by 98%+ of websites. It evolved from ASCII's 7-bit (128 chars) through UTF-16 (variable width) to the now-dominant UTF-8 that handles all human writing.
Myths vs. Facts
Computers 'think' in binary — they understand 0s and 1s.
Computers don't 'understand' anything. They're physical circuits where voltage levels (e.g., 0V vs 5V) represent 0 and 1. Transistors switch on/off — no comprehension involved. Binary is the mathematical abstraction we use to describe electrical states.
1 KB = 1000 bytes.
Historically, 1 KB = 1024 bytes (2¹⁰) because binary powers are natural for computers. The IEC standard introduced KiB (kibibyte) = 1024 bytes vs. KB (kilobyte) = 1000 bytes to resolve ambiguity. Storage manufacturers use 1000; RAM uses 1024.
Binary is too limited since it only has two digits.
Binary can represent ANY information: all numbers, text, images, video, and programs are encoded in binary. Two digits is sufficient because position provides the complexity — 64 binary digits can represent 2⁶⁴ ≈ 1.8×10¹⁹ distinct values.
Floating-point numbers are always accurate in binary.
Many decimal fractions have infinite binary representations (e.g., 0.1₁₀ = 0.0001100110011...₂ repeating). This causes the infamous 0.1 + 0.2 = 0.30000000000000004 issue. For exact decimal arithmetic (finance), use integer cents or dedicated decimal libraries.
Frequently Asked Questions
How do I convert decimal to binary?▼
What is a byte?▼
What are hexadecimal numbers?▼
Why do computers use binary instead of decimal?▼
What is two's complement?▼
What does 0.1 + 0.2 ≠ 0.3 mean in binary?▼
What is Big Endian vs Little Endian?▼
How do binary operations work in programming?▼
What is ASCII vs Unicode?▼
How does binary relate to logic gates?▼
What is BCD (Binary-Coded Decimal)?▼
What are binary file formats?▼
References
- Shannon — A Mathematical Theory of Communication (1948)
- IEEE 754-2019 — Floating-Point Arithmetic Standard
- Knuth — The Art of Computer Programming, Vol. 2
- Unicode Consortium — Unicode 16.0 Standard
- Computer Organization and Design — Patterson & Hennessy
- Leibniz — Explication de l'Arithmétique Binaire (1703)
Related Calculators
Explore All Math Calculators
Binary conversions, bitwise operations, and number systems — CalculatorApp.me.
Browse Math Calculators →