Math calculator

Free binary calculator

Convert decimal numbers to binary (base 2) — enter any positive integer to see its binary representation, updated live, as you type.

InputsLive
Conversion direction
Decimal integer
Result
Binary
101010
Input42
Binary101010

Binary (base-2) representation. Only non-negative integers supported.

Results are estimates. Consult a professional.

How it's calculated

How the binary calculator works

Binary is base-2 notation: every digit is either 0 or 1, and each position represents a power of 2. To convert a decimal number to binary, repeatedly divide by 2 and record the remainders — reading them in reverse gives the binary result. To go the other way, multiply each binary digit by its corresponding power of 2 and sum the products.

Decimal → Binary: divide by 2, collect remainders (LSB first), reverse
Binary → Decimal: Σ (bit × 2^position), positions count from 0 at the right
Base-2 positional notation is documented in IEEE 754 and foundational computer-science texts including Knuth's The Art of Computer Programming.
Example

Worked example: converting 25 to binary and back

Example: 25₁₀ ↔ binary

Convert the decimal number 25 to binary, then verify by converting the result back to decimal.

25 ÷ 2 = 12 remainder 1
12 ÷ 2 = 6 remainder 0
6 ÷ 2 = 3 remainder 0
3 ÷ 2 = 1 remainder 1
1 ÷ 2 = 0 remainder 1
Reading remainders bottom-to-top: 11001₂
Back-check: 1×2⁴ + 1×+ 0×+ 0×+ 1×2⁰
= 16 + 8 + 0 + 0 + 1 = 25 ✓
11001₂
25 in decimal equals 11001 in binary. Verified: 16 + 8 + 1 = 25.
Quick reference

Decimal 0–15 in binary and hexadecimal

The first 16 values (one hex digit, one nibble) are the building blocks for all larger conversions. Memorising these makes manual binary and hex work much faster.

DecimalBinaryHex
000000
100011
200102
300113
401004
501015
601106
701117
810008
910019
101010A
111011B
121100C
131101D
141110E
151111F

One hex digit equals exactly 4 binary bits (one nibble), making hex a compact shorthand for binary.

Practical tips

Tips for working with binary numbers

A few patterns and shortcuts cut down on errors when you convert by hand or verify calculator output.

  • Group into nibbles — Split binary strings into groups of 4 from the right (e.g., 11001 → 0001 1001) to read hex digits directly.
  • Powers of 2 anchor points — Memorise 1, 2, 4, 8, 16, 32, 64, 128, 256. Any decimal is the sum of a subset of these.
  • Check the last bit for parity — A binary number ending in 0 is even; ending in 1 is odd. Use this to spot-check your conversion instantly.
  • Padding with leading zeros — Binary representations are often shown in 8-bit (byte) or 16-bit widths. Pad the left with zeros to fill the field without changing the value.
  • Two's complement for negatives — Signed integers in computers use two's complement: flip all bits then add 1 to get the negative representation.
Accuracy & limits

Accuracy and limitations

The division-and-remainder algorithm is exact for any non-negative integer. Decimal fractions (e.g., 0.1) can produce infinitely repeating binary sequences — just as 1/3 repeats in decimal — so this calculator handles integers only. For floating-point binary representation, see the IEEE 754 standard.

Glossary

Key terms

A single binary digit — either 0 or 1. The smallest unit of digital information.
4 bits. Represents one hexadecimal digit, with values 0–15 (0–F).
8 bits. Stores values 0–255. The standard unit for file sizes and memory.
The leftmost bit, representing the highest power of 2. Changing it has the biggest effect on the number's value.
The rightmost bit, representing 2⁰ = 1. Determines whether the number is odd (1) or even (0).
The standard method computers use to represent signed (positive and negative) integers. Negate a number by inverting all bits and adding 1.
About

About this calculator

Part of our math calculators suite — explore all calculators.

Questions

Frequently asked questions about the free binary calculator

A binary calculator is a free online tool that helps you convert decimal to binary. Base 2 representation. It runs entirely in your browser with instant results and no sign-up.
JavaScript double-precision floating-point — accurate to about 15-17 significant digits. For arbitrary precision, use the Big Number calculator.
The statistics calculator computes population variance (divides by n). For sample variance, multiply variance by n/(n-1).

Want a calculator built for your business?

Customize any of our 400+ tools to match your brand, or commission a new one tailored to how your business actually calculates — pricing, payroll, quotes, anything. Deployed on your domain, math runs in your visitors' browsers.