Reviewed by CalculatorApp.me Math Team
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
Free online binary calculator โ convert and calculate between binary, decimal, octal, and hexadecimal with AI-powered insights.
Enter values above to see results.
Explore our in-depth guides related to this calculator
Master percentage calculations with this comprehensive guide covering percentage formulas, increase/decrease, percentage of a number, reverse percentages, and common real-world applications.
Complete geometry reference covering area formulas, volume calculations, triangles, circles, and 3D shapes. Free area calculator, volume calculator, and right triangle solver included.
Complete GPA guide covering weighted vs. unweighted GPA, cumulative GPA calculation, grade conversion charts, and strategies to raise your GPA. Free GPA and grade calculators included.
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.
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)
| 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 |
| 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 |
| 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ยณโธ |
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.
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.
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.
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.
Shannon (1948) โ Bell System Technical Journal
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
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
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.
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.
Binary conversions, bitwise operations, and number systems โ CalculatorApp.me.
Browse Math Calculators โLast updated:
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.
| 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.
| โ | 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.
| ~7 decimal digits |
| GPU, ML weights |
| float64 (double) | 64 | ยฑ2.2ร10โปยณโฐโธ to ยฑ1.8ร10ยณโฐโธ | ~15 decimal digits | Scientific, financial |
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.
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.
Unicode Consortium โ Unicode 16.0
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.
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.