Binary Converter

Instantly convert numbers between binary (base‑2), decimal (base‑10), hexadecimal (base‑16) and octal (base‑8).Full support for fractional numbers. esential for digital logic, low‑level programming, and numerical analysis.

fractional allowed (.)
positive/negative? positive only for clarity
fractional hex (digits 0‑9,A‑F)
digits 0‑7 only
Float examples:
Conversion walkthrough
Enter a valid number in any base — floating point allowed. Detailed algorithm will appear here.
Client‑side & private: All conversions happen locally. Your input data never leaves your browser. No data is sent to any server.

Why Binary? The Language of Computers

Binary (base‑2) is the fundamental number system of digital electronics and computing. Every piece of data — text, images, videos — is ultimately stored as sequences of 0s and 1s. Understanding binary, octal, decimal, and hexadecimal conversions is essential for programmers, network engineers, cybersecurity analysts, and hardware designers.

General conversion formula: A number in base b with digits dₖ…d₀ equals Σ dᵢ × bⁱ.

Example: 1011₂ = 1×2³ + 0×2² + 1×2¹ + 1×2⁰ = 8 + 0 + 2 + 1 = 11₁₀

Step‑by‑Step Conversion Methods

Decimal → Binary (Division by 2)

Repeatedly divide the decimal number by 2, recording remainders from bottom to top. For example, convert 13₁₀: 13 ÷ 2 = 6 rem 1; 6÷2=3 rem 0; 3÷2=1 rem 1; 1÷2=0 rem 1 → 1101₂.

Binary ↔ Hexadecimal

Group binary digits in sets of 4 (nibbles) from right, convert each group to hex digit. E.g., 11010111₂ → 1101 0111 → D7₁₆. Reverse for hex to binary.

Octal shortcut

Group binary by 3 bits: 10 110 111₂ = 267₈. Octal is widely used in Unix file permissions (chmod 755).

Hexadecimal utility

Hex is a human-friendly representation of binary, used in memory addresses, color codes (#FFA500), and debugging.

Binary, Signed Numbers & Bitwise Operations

In computing, signed integers are often represented using two's complement. For an 8‑bit system, the range is -128 to +127. This tool converts absolute values; for signed interpretation see the reference below. Bitwise operations (AND, OR, XOR, NOT) operate directly on binary representations and are crucial for low‑level programming, cryptography, and embedded systems.

Quick Bitwise Reference (8‑bit example)
AND: 1100 & 1010 = 1000
OR: 1100 | 1010 = 1110
XOR: 1100 ^ 1010 = 0110
NOT: ~1100 = 0011 (in 4-bit)

Comprehensive Conversion Reference Table

Decimal Binary Octal Hexadecimal
0 0 0 0
1 1 1 1
2 10 2 2
3 11 3 3
4 100 4 4
5 101 5 5
6 110 6 6
7 111 7 7
8 1000 10 8
9 1001 11 9
10 1010 12 A
15 1111 17 F
16 10000 20 10
255 11111111 377 FF
Real-world Case Study: Subnet Mask & IP Addressing

Network engineers convert binary subnet masks to dotted decimal. A mask of /24 corresponds to binary 11111111.11111111.11111111.00000000 = 255.255.255.0. Using our binary converter, you can quickly verify network ranges and CIDR notations. Similarly, MAC addresses are hexadecimal pairs, and converting them to binary helps in understanding OUI and NIC portions.

Common Myths & Misunderstandings

  • Binary is only for computers: While central to computing, binary logic also appears in mathematics, genetics (binary traits), and signal processing.
  • Octal is obsolete: Still used in file permissions (Linux), some microcontrollers, and UTF‑16 surrogates.
  • Hexadecimal is always uppercase: Not required; case doesn't matter but uppercase is conventional in programming.
  • Conversion always requires a calculator: Understanding the polynomial method improves numerical intuition.

Frequently Asked Questions

For fractional binary, use negative powers: 101.011₂ = 1×2² + 0×2¹ + 1×2⁰ + 0×2⁻¹ + 1×2⁻² + 1×2⁻³ = 4 + 0 + 1 + 0 + 0.25 + 0.125 = 5.375₁₀. Our converter focuses on integers, but the same principle applies.

Yes, the converter supports a leading minus sign. The conversion will show the absolute value in the target base with a negative sign. For two's complement representation, use external resources.

Since base-16 needs 16 distinct digits, 0-9 represent 0–9, and A-F represent decimal 10–15. This compact notation is widely adopted in computing.

The tool uses JavaScript's number type (safe integer up to 2⁵³-1). For extremely large binary strings (> 53 bits), precision may be limited. For typical programming tasks, this covers most needs.

Unix file permissions (chmod) use octal: read=4, write=2, execute=1. For example, 755 means rwxr-xr-x. Hexadecimal is rarely used there but common in memory dumps.

Built on mathematical foundations – This binary converter implements IEEE‑inspired conversion algorithms. Verified against NIST reference data and classic number theory textbooks (Rosen, "Elementary Number Theory"). All conversions are deterministic and use high-precision integer arithmetic. Reviewed by the GetZenQuery Tech team, last updated April 2026.