How to calculate binary
Value = Σ digit × base^position
Worked example. Decimal value: 255.
Example inputs — Number: 255; This number is in: Decimal (base 10). Starting values are illustrative.
0b11111111
From George Guju, founder of Calculyn · Educational calculator guidance, not professional advice.
How it works
Every number can be written in any base. Binary uses digits 0–1, octal 0–7, decimal 0–9, and hexadecimal 0–9 plus A–F. The same value, four ways to write it.
Assumptions & limitations
- Results are rounded for display.
Formula and assumptions reviewed October 2026 by the Calculyn team. How we build our calculators
Frequently asked questions
Why do programmers use hex?
One hex digit maps exactly to four binary bits, so it's a compact way to read and write binary values.
