CCalculate.Studio

0️⃣ Binary Calculator

This binary calculator converts a number between the four bases most used in computing: binary (base 2), decimal (base 10), hexadecimal (base 16) and octal (base 8). Enter a value, select which base it is written in, and read all four representations at once. Conversion between bases never changes the number itself — only the notation used to write it.

آخر مراجعة: 2026-07-07

بياناتك

النتائج

Decimal10
Binary1010
HexadecimalA
Octal12

Base conversion reference table

The table shows the same values written in the four bases. Note how one hexadecimal digit corresponds to four binary digits and one octal digit to three.

DecimalBinaryOctalHexadecimal
0000
510155
81000108
10101012A
15111117F
16100002010
100110010014464
25511111111377FF
  • This calculator handles non-negative integers up to the safe-integer limit of IEEE 754 double-precision arithmetic (2⁵³ − 1 = 9,007,199,254,740,991); larger inputs are rejected rather than silently rounded.
  • Fractional values and negative numbers (two's-complement representation) are outside the scope of this converter.

What is the binary number system?

Binary is a positional number system with base 2: it writes every number using only the digits 0 and 1, where each position represents a power of two. Reading the binary number 1010 from the right, the digits stand for 0×1 + 1×2 + 0×4 + 1×8 = 10 in decimal. Digital electronics store and process information as binary because a circuit element with two states (on/off) maps directly onto one binary digit, or bit.

Hexadecimal (base 16) and octal (base 8) are compact companions to binary. Because 16 = 2⁴, one hexadecimal digit represents exactly four binary digits, and because 8 = 2³, one octal digit represents exactly three. Hexadecimal uses the digits 0–9 plus the letters A–F for the values ten through fifteen; the decimal number 255 is 11111111 in binary, FF in hexadecimal and 377 in octal.

All positional systems follow the same rule: a numeral written as digits dₙ…d₁d₀ in base b has the value of each digit multiplied by b raised to the digit's position, summed. Converting between bases is therefore a purely notational operation — evaluate the digits against the source base to get the value, then repeatedly divide by the target base to write it out.

How to use this binary calculator

  1. Type the number you want to convert (up to 64 digits; prefixes like 0b, 0x or 0o are accepted and ignored).
  2. Select the base the number is written in — binary, decimal, hexadecimal or octal.
  3. Read the decimal value and the equivalent binary, hexadecimal and octal representations.
  4. Only digits valid in the selected base are accepted; for example, the digit 8 is invalid in an octal input.

The math behind base conversion

value = Σ (digit at position i) × baseⁱ, counting positions from the right starting at 0
1010₂ = 8 + 2 = 10₁₀ = A₁₆ = 12₈

To convert into decimal, multiply each digit by its base raised to the digit's position (counting from 0 at the right) and sum. To convert out of decimal, repeatedly divide by the target base and read the remainders in reverse order.

Worked example: 1010 in binary equals 1×2³ + 0×2² + 1×2¹ + 0×2⁰ = 8 + 2 = 10 in decimal. Writing 10 in other bases: 10 ÷ 16 = 0 remainder 10 → A in hexadecimal; 10 ÷ 8 = 1 remainder 2 → 12 in octal.

Common mistakes

  • Reading 10 in another base as 'ten' — 10 means the base itself in every positional system (10₂ = 2, 10₈ = 8, 10₁₆ = 16).
  • Using digits that do not exist in the selected base, such as 8 or 9 in octal, or letters beyond F in hexadecimal.
  • Mixing up bit-group sizes: one hex digit is four bits and one octal digit is three bits, so grouping binary digits incorrectly gives a wrong conversion.
  • Forgetting that leading zeros change nothing: 0010₂ and 10₂ are both 2 in decimal.

الأسئلة الشائعة

How do I convert binary to decimal by hand?

Multiply each binary digit by the power of two for its position, counting from 0 at the rightmost digit, and add the results. For 1101: 1×8 + 1×4 + 0×2 + 1×1 = 13. Reading right to left, the position values are 1, 2, 4, 8, 16, 32 and so on.

How do I convert decimal to binary?

Divide the number by 2 repeatedly and record each remainder. The binary result is the remainders read in reverse order. For 13: 13÷2 = 6 r 1, 6÷2 = 3 r 0, 3÷2 = 1 r 1, 1÷2 = 0 r 1 — reading upward gives 1101.

Why do computers use binary?

Digital circuits distinguish two voltage states reliably, and each state maps onto one binary digit (bit). Building hardware around two states makes storage and logic simple and noise-tolerant, so all mainstream processors and memory represent data in binary at the physical level, whatever notation programmers use on top.

What is hexadecimal used for?

Hexadecimal is a compact way to write binary: one hex digit encodes exactly four bits, so a byte is always two hex digits (00–FF). It is standard notation for memory addresses, color codes (e.g. #FF6600), MAC addresses and raw data dumps because it is far shorter than binary while converting to it digit-by-digit.

What is the largest number this calculator accepts?

Inputs are limited to 64 digits and to values at or below 2⁵³ − 1 = 9,007,199,254,740,991, the largest integer that IEEE 754 double-precision floating point can represent exactly. Beyond that limit, ordinary JavaScript numbers lose integer precision, so the calculator rejects the input instead of returning a rounded result.

المراجع

  1. Knuth DE. The Art of Computer Programming, Volume 2: Seminumerical Algorithms, 3rd edition, Addison-Wesley, 1997 — positional number systems and radix conversion.
  2. IEEE Std 754-2019. IEEE Standard for Floating-Point Arithmetic — double-precision format and exact-integer range.

الأنظمة العددية · جميع الحاسبات

حاسبات ذات صلة