Skip to content
The Calculatorz
Computing & text

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.

Number and bases

Conversion

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

DecimalBinaryOctalHexadecimal
0000
1111
21022
31133
410044
510155
611066
711177
81000108
91001119
10101012A
11101113B
12110014C
13110115D
14111016E
15111117F
16100002010
321000004020
64100000010040
100110010014464
1281000000020080
25511111111377FF
256100000000400100
1000111110100017503E8
1024100000000002000400

Calculator credits

Calculator developmentJulia Edwards

Editorial supervision

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.

  1. 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
  2. International Organization for Standardization. (2019). ISO 80000-2: Quantities and units—Part 2: Mathematics. View source
  3. Ecma International. (2025). ECMAScript language specification (ECMA-262): Number.prototype.toString and parseInt. View source
  4. Graham, R. L., Knuth, D. E., & Patashnik, O. (1994). Concrete mathematics (2nd ed.). Addison-Wesley. View source