Number Base Converter

Convert between binary, decimal, hex, octal — instantly and free

Real-time conversion | 100% client-side

Digits: 0 and 1

Digits: 0–7

Digits: 0–9

Digits: 0–9 and A–F

Read-only — 0–9 and A–V

Read-only — 0–9 and A–Z

Bit Length

Requires bits (fits in )

Signed Decimal

2's complement value:

Enable to view 2's complement signed value for the current bit width.

Reset

Clear all fields and start fresh.

Step-by-Step Conversion

1 Decimal → Binary

Result:

2 Decimal → Hexadecimal

Result:

100% Private

All conversions happen locally in your browser using JavaScript. No data is ever sent to any server.

Understanding Number Bases

Why computers speak binary, why developers love hex, and why all four bases matter

A number base (or radix) determines how many unique symbols a positional numeral system uses to represent numbers. The position of each digit carries a weight equal to a power of the base, making conversion between bases a fundamental skill in computer science and software development.

Binary (Base 2)

Uses only 0 and 1. Every piece of digital data — text, images, video — is ultimately stored as binary. Modern CPUs process billions of binary operations per second.

Octal (Base 8)

Uses digits 0–7. Each octal digit maps to exactly 3 binary bits. Still used today in Unix/Linux file permission masks — chmod 755 is octal notation.

Decimal (Base 10)

Uses digits 0–9. The number system humans naturally use, derived from counting on ten fingers. Computers convert all user-facing numbers to decimal for readability.

Hexadecimal (Base 16)

Uses digits 0–9 and letters A–F. One hex digit = 4 binary bits. Used everywhere in programming: memory addresses, color codes #FF5733, byte values, and debugging output.

Conversion Quick Reference

Common values across all four number bases at a glance

Decimal Binary Octal Hex
0 0000 0 0
1 0001 1 1
2 0010 2 2
4 0100 4 4
8 1000 10 8
10 1010 12 A
15 1111 17 F
16 10000 20 10
32 100000 40 20
64 1000000 100 40
128 10000000 200 80
255 11111111 377 FF

Tip: Hexadecimal is the most programmer-friendly base — a full byte (0–255) fits in exactly two hex digits. That's why color codes like #RRGGBB use three pairs of hex digits, one per color channel.

How Base Conversion Works

The mathematics behind converting numbers between different bases

Any Base → Decimal

Multiply each digit by its positional value (base raised to the position index, starting from 0 on the right), then sum all results.

Binary 1011 → Decimal:

1 × 2³ = 8

0 × 2² = 0

1 × 2¹ = 2

1 × 2&sup0; = 1

Sum = 11

Decimal → Any Base

Repeatedly divide the decimal number by the target base, collecting remainders. Read the remainders bottom to top for the result.

Decimal 11 → Binary:

11 ÷ 2 = 5 remainder 1

5 ÷ 2 = 2 remainder 1

2 ÷ 2 = 1 remainder 0

1 ÷ 2 = 0 remainder 1

Read up: 1011

Frequently Asked Questions

Common questions about number bases and this converter tool

A number base (or radix) defines how many unique digits a number system uses. Base 2 (binary) uses only 0 and 1, base 10 (decimal) uses 0–9, and base 16 (hexadecimal) uses 0–9 plus A–F. The position of each digit carries a weight equal to a power of the base.
Computers use binary because electronic transistors have exactly two reliable states: on (1) and off (0). This maps perfectly to binary digits. All data — text, images, video, sound — is ultimately represented as combinations of 1s and 0s at the hardware level.
Hexadecimal is used extensively in programming for memory addresses, color codes (e.g. #FF5733 in CSS), byte values, and low-level debugging. Its key advantage is compactness — one hex digit represents exactly 4 binary bits, so a full byte always fits in exactly two hex characters.
Octal (base 8) was common in early computing and is still used today for Unix/Linux file permissions. The command chmod 755 uses octal: 7 = rwx (read/write/execute), 5 = r-x (read/execute). Each octal digit represents exactly 3 binary bits, making it convenient for grouping bits.
Multiply each binary digit by its positional power of 2 (starting at 2⁰ for the rightmost digit), then add all the results together. For example: 1011 = 1×8 + 0×4 + 1×2 + 1×1 = 8 + 0 + 2 + 1 = 11 in decimal. The step-by-step section in this tool shows exactly this process for your input.