ewory.com logo

Base Converter

Type a number in any field — decimal, binary, octal, or hexadecimal — and all other fields update automatically.


0b
0o
0x

Edit any field — all others update instantly


Number Bases Explained

A number base (or radix) defines how many unique digits are available in a positional numeral system. The position of each digit determines its value, which is the base raised to the power of that position.

In decimal (base 10), which humans use naturally, each position represents a power of 10:

2024 = 2 × 10³ + 0 × 10² + 2 × 10¹ + 4 × 10⁰

The same concept applies to all other bases — only the base number changes.

The Four Common Number Bases

BaseNameDigits UsedPrefixMain Use
2Binary0, 10bComputer hardware, digital logic
8Octal0–70oUnix file permissions, legacy systems
10Decimal0–9(none)Everyday counting, mathematics
16Hexadecimal0–9, A–F0xMemory addresses, colors, encoding

Conversion Reference Table

DecimalBinaryOctalHex
0000
1111
21022
410044
81000108
10101012A
15111117F
16100002010
321000004020
64100000010040
25511111111377FF
256100000000400100
1024100000000002000400

Binary (Base 2)

Binary is the foundation of all digital computing. Every piece of data in a computer is ultimately stored as binary — sequences of 0s and 1s representing off/on states in transistors. Understanding binary helps with:

  • Bit manipulation: Operations like AND, OR, XOR, bit shifts in programming
  • Understanding data sizes: 1 byte = 8 bits = 11111111 in binary = 255 decimal
  • Networking: IP addresses, subnet masks, and CIDR notation use binary logic
  • Digital electronics: Logic gates, flip-flops, and memory cells are binary by nature

Hexadecimal (Base 16)

Hexadecimal is the most practical human-readable format for binary data because each hex digit represents exactly 4 binary bits (a nibble):

  • F = 1111 in binary
  • FF = 11111111 = 255 decimal = one byte max value
  • #FF5733 (an orange color in CSS) = R:255, G:87, B:51

Hex is used pervasively in:

  • Web colors: #RRGGBB format
  • Memory addresses: 0x7FFE3A2B
  • MAC addresses: 00:1A:2B:3C:4D:5E
  • SHA/MD5 hashes: File checksums
  • Unicode code points: U+1F600 (emoji 😀)

Octal (Base 8)

Octal is mostly encountered in Unix/Linux file permissions:

  • chmod 755 = binary 111 101 101 = rwxr-xr-x (owner can read/write/execute; group and others can read/execute)
  • chmod 644 = binary 110 100 100 = rw-r--r-- (owner can read/write; others read only)

Frequently Asked Questions

How do I convert binary to decimal by hand?

Write down the binary number, then assign powers of 2 from right to left (2⁰=1, 2¹=2, 2²=4, 2³=8...). Multiply each bit by its power of 2 and sum the results. Example: 1011 = 1×8 + 0×4 + 1×2 + 1×1 = 8 + 0 + 2 + 1 = 11.

Why do computers use binary instead of decimal?

Electronic circuits have two reliable states: on (high voltage) and off (low voltage). These map directly to 1 and 0. Building hardware to reliably distinguish 10 different voltage levels (for decimal) would be far more complex, error-prone, and expensive.

What is a byte and why is it 8 bits?

A byte is 8 bits. This became standard because it can encode 256 different values (2⁸ = 256), which is enough for all ASCII characters. Early computers used various byte sizes (5, 6, 7 bits) but 8-bit bytes won out commercially with the IBM System/360 in 1964.

What does 0xFF mean in programming?

0xFF is hexadecimal notation for the number 255 (decimal) or 11111111 (binary). It represents the maximum value of an 8-bit unsigned integer (one byte). In many languages, the 0x prefix indicates a hexadecimal literal. You will often see it in color values, bitmasks, and memory operations.

How are colors stored in computers?

Web colors use the hex format #RRGGBB where RR, GG, and BB are each two-digit hexadecimal values representing red, green, and blue intensity from 0 (00) to 255 (FF). For example, #FF0000 is pure red, #00FF00 is pure green, #0000FF is pure blue, and #FFFFFF is white.

Sources

  • Patterson, D.A. & Hennessy, J.L. Computer Organization and Design. Morgan Kaufmann
  • IEEE Standard 754: Floating-Point Arithmetic
  • The Open Group: chmod — Unix File Permissions