Number System Converter (Binary, Decimal, Hex, Octal)
Convert numbers between binary, decimal, hexadecimal, octal and every base from 2 to 36, including fractions and negative numbers.
How to use this calculator
Type a number, choose the base it is written in and the base you want. Digits above 9 use letters A–Z (A = 10, F = 15, Z = 35); letters are not case-sensitive. You can include a minus sign and a fractional part such as 101.101 or FF.8. Whole numbers of any length are converted exactly; fractional parts are given to up to 20 digits. The result also shows the number in binary, octal, decimal and hexadecimal.
Formula
A number written in base b with digits dₙ…d₁d₀.d₋₁d₋₂… has the value Σ dᵢ × bⁱ. To convert a whole number to base b, divide by b repeatedly and read the remainders from last to first. To convert a fraction, multiply by b repeatedly and read the whole-number parts in order.
Every number base from 2 to 36
This number system converter handles all 35 bases from 2 to 36, including binary, ternary, octal, decimal, duodecimal, hexadecimal, vigesimal and base 36. It converts whole numbers of any length exactly, using arbitrary-precision arithmetic, so long binary strings and large hexadecimal values do not lose digits.
Place value in positional number systems
In a positional system each digit's value depends on its position. In decimal, 345 means 3 × 100 + 4 × 10 + 5. In binary, 101 means 1 × 4 + 0 × 2 + 1. Changing base changes how a number is written, never its value.
Decimal 0–16 in binary, octal and hexadecimal
| 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 |
| 11 | 1011 | 13 | B |
| 12 | 1100 | 14 | C |
| 13 | 1101 | 15 | D |
| 14 | 1110 | 16 | E |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
| 32 | 100000 | 40 | 20 |
| 64 | 1000000 | 100 | 40 |
| 100 | 1100100 | 144 | 64 |
| 128 | 10000000 | 200 | 80 |
| 255 | 11111111 | 377 | FF |
| 256 | 100000000 | 400 | 100 |
| 1000 | 1111101000 | 1750 | 3E8 |
| 1024 | 10000000000 | 2000 | 400 |
Calculator credits
Calculator developmentJulia Edwards
Editorial supervisionSamad Aslam Khan
Expert reviewWasiMathematics and Physics Instructor, Mechanical Engineer
Published byThe Calculatorz
Last updated
Read how we research, test, review and correct our calculators in our editorial policy.
Frequently asked questions
How do I convert decimal to binary?
Divide the number by 2 repeatedly and write down the remainders, then read them from bottom to top. 13 ÷ 2 = 6 r1, 6 ÷ 2 = 3 r0, 3 ÷ 2 = 1 r1, 1 ÷ 2 = 0 r1, so 13 = 1101 in binary.
How do I convert binary to decimal?
Multiply each digit by its place value (1, 2, 4, 8, 16, … from the right) and add them. 1101 = 8 + 4 + 0 + 1 = 13.
How do I convert hexadecimal to decimal?
Each hex digit is worth 16 times the one to its right. 2F = 2 × 16 + 15 = 47. Letters A–F stand for 10–15.
How do I convert binary to hexadecimal?
Group the binary digits in fours from the right and replace each group with one hex digit: 1111 1010 = FA. For octal, group in threes.
What is the octal number system?
Octal is base 8 and uses the digits 0–7. It is used for Unix file permissions, such as 755.
Why do computers use binary and hexadecimal?
Digital circuits store two states, so binary is natural. Hexadecimal is a compact way to write binary, because one hex digit is exactly four bits; colours such as #FF8800 and memory addresses are written in hex.
Can I convert fractions and negative numbers?
Yes. Add a minus sign or a point, for example −1A.8 in hexadecimal. Some fractions that end in one base repeat forever in another (0.1 in decimal is a repeating binary fraction), so fractional results are rounded to 20 digits.
What is the largest base supported?
Base 36, which uses all ten digits and 26 letters. Base 32 here uses 0–9 and A–V, which is different from the RFC 4648 Base32 text encoding.
Is this the same as two's complement?
No. This converter writes negative numbers with a minus sign. Two's complement is how computers store signed integers in a fixed number of bits.
What base do we count in and why?
Most cultures count in base 10, probably because we have ten fingers. Base 12 survives in dozens and hours, base 20 in some languages, and base 60 in minutes and degrees.
References & methodology sources
These sources support the calculator’s formula, definitions, thresholds, units or result interpretation.
- Knuth, D. E. (1997). The art of computer programming: Vol. 2. Seminumerical algorithms (3rd ed.), Section 4.1: Positional number systems. Addison-Wesley. View source
- International Organization for Standardization. (2019). ISO 80000-2: Quantities and units—Part 2: Mathematics. View source
- Ecma International. (2025). ECMAScript language specification (ECMA-262): Number.prototype.toString and parseInt. View source
- Graham, R. L., Knuth, D. E., & Patashnik, O. (1994). Concrete mathematics (2nd ed.). Addison-Wesley. View source