Base Converter

Convert numbers between binary, octal, decimal and hexadecimal.

Written by Ahmet Tur · Reviewed by Kübra Yıldız · Updated

Your result will appear here

Fill in the fields and press Calculate.

Numbers can be written in different bases — the decimal (base 10) we use daily, the binary (base 2) computers run on, and the octal and hexadecimal shorthands programmers use. Converting between them is essential in computing, from reading colour codes to debugging memory. The value is the same; only the representation changes.

Enter a number, pick the source and target base, and the conversion is done instantly.

Base Converter: step-by-step worked example

Convert 2026 from base 10 to base 2.

Example inputs
Number
2026
From base
Decimal (10)
To base
Binary (2)
  1. 1

    Convert to base 10 (place values)

    x = Σ digit × base^position

    2×10³ + 0×10² + 2×10¹ + 6×10⁰ = 2,026

  2. 2

    Divide repeatedly by the target base

    q ÷ base → remainder, until the quotient is 0

    2,026 ÷ 2 = 1,013 r 0 · 1,013 ÷ 2 = 506 r 1 · 506 ÷ 2 = 253 r 0 · 253 ÷ 2 = 126 r 1 · 126 ÷ 2 = 63 r 0 · 63 ÷ 2 = 31 r 1 · 31 ÷ 2 = 15 r 1 · 15 ÷ 2 = 7 r 1 · 7 ÷ 2 = 3 r 1 · 3 ÷ 2 = 1 r 1 · 1 ÷ 2 = 0 r 1 = 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1

  3. 3

    Read the remainders bottom-up

    Result = last remainder … first remainder

    = 11111101010

Result · Converted value11111101010
How many digits the same number needs in each base
  • Base 211
  • Base 84
  • Base 104
  • Base 163

Good to know: In hexadecimal, digits 10–15 are written A–F. Each hex digit maps to exactly 4 binary digits (bits), which is why colour codes (#FF8800) and memory addresses use hex.

Base Converter — how it works

The bases

BaseNameDigits
2Binary0, 1
8Octal0–7
10Decimal0–9
16Hexadecimal0–9, A–F

Hexadecimal uses A–F for the values 10–15, so a single hex digit represents four binary digits — which is why hex is a compact way to write binary.

How conversion works

Every number has one value; the base is just how it's written. 255 in decimal is FF in hexadecimal and 11111111 in binary — all the same quantity. To convert, the tool reads the number in its source base and re-expresses it in the target base.

Where it's used

  • Colours: web colours are hex (FF0000 = red = 255,0,0 in RGB).
  • Programming: memory addresses, bit masks and flags in hex or binary.
  • Networking: IP addresses and subnet masks.
  • Digital electronics: binary logic, octal permissions (chmod 755).

A quick check

Each hex digit maps to exactly 4 binary digits: F = 1111, so FF = 11111111. And 2¹⁰ = 1024 is why memory sizes come in powers of two — a direct consequence of binary.

Worked example

Take 255 in decimal. In hexadecimal it's FF (15 × 16 + 15 = 255, and F represents 15), and in binary it's 11111111 (eight 1s, since 255 = 2⁸ − 1). All three write the same quantity. Converting the other way, the binary number 1010 is 1×8 + 0×4 + 1×2 + 0×1 = 10 in decimal, which is A in hexadecimal — showing how a four-bit group maps neatly to a single hex digit.

Decimal – binary – octal – hexadecimal table

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

Frequently asked questions

How do I convert between number bases?+

Enter the number, choose its current (source) base and the target base. The value stays the same; only its representation changes. 255 decimal is FF hex and 11111111 binary.

What is hexadecimal used for?+

Hex (base 16) compactly represents binary — each hex digit is 4 bits. It's used for web colours (FF0000 = red), memory addresses, and bit flags in programming.

Why do computers use binary?+

Binary (base 2) has just two digits, 0 and 1, which map directly to the off/on states of electronic circuits. All data in a computer is ultimately binary.

How does a hex digit relate to binary?+

Each hexadecimal digit corresponds to exactly four binary digits: F = 1111, A = 1010. So FF = 11111111. That 4-to-1 mapping is why hex is a compact way to write binary.

What is 255 in binary and hexadecimal?+

255 is 11111111 in binary (eight 1s, 2⁸ − 1) and FF in hexadecimal. It is the maximum value of a single byte, which is why colour channels run 0–255.

What does the "0x" prefix mean?+

In many programming languages 0x marks a hexadecimal number (0xFF = 255), and 0b marks binary (0b1010 = 10). They tell the reader which base is being used.

About this page

Publisher:
Kalkoro — Teknolojig Bilişim Teknolojileri A.Ş., İstanbul
Written by:
Ahmet Tur — Editor (Math, date & time, unit conversion, physics & chemistry, everyday tools)
Reviewed by:
Kübra Yıldız — Editor

Parameters come from official sources; the last update date is shown at the bottom of the page.

Spotted a wrong result? Use the "Report a bug" button at the top of the page; every report is reviewed.

How we calculate and our accuracy policy →

Results are for information only. For official matters the relevant authority's calculation prevails.

Last updated: