March 26, 20264 min read

Number Base Converter — Binary, Decimal, Hexadecimal, Octal

Convert between binary, decimal, hexadecimal, and octal number systems instantly. Practical guide to number bases for programmers and students.

number base converter binary to decimal hex converter octal calchub
Ad 336x280

Number base conversions are one of those things you either never think about or deal with daily — depending on whether you write code, work with networking, or study computer science. Binary, hexadecimal, and octal all exist because they map cleanly to how computers process data, and being able to convert between them is a practical skill.

The CalcHub number base converter handles binary, decimal, hexadecimal, and octal conversions instantly.

The Four Common Bases

BaseNameDigits UsedExample (decimal 255)
Base 2Binary0, 111111111
Base 8Octal0–7377
Base 10Decimal0–9255
Base 16Hexadecimal0–9, A–FFF

Quick Reference Table

DecimalBinaryHexOctal
0000000
1000111
5010155
101010A12
151111F17
16100001020
321000002040
64100000040100
100110010064144
12711111117F177
1281000000080200
25511111111FF377
256100000000100400

Where Each Base Is Used

Binary (Base 2)

Everything inside a computer is binary — every file, instruction, and piece of data is ultimately 1s and 0s. You encounter binary directly when working with:
  • Bit flags and bitmasks — permission systems, feature toggles
  • Network subnet masks — 255.255.255.0 = 11111111.11111111.11111111.00000000
  • Low-level programming — embedded systems, hardware registers

Hexadecimal (Base 16)

Hex is the programmer's shorthand for binary. Every hex digit maps to exactly 4 binary digits, making it compact and readable:
  • Color codes — #FF5733 means R=255, G=87, B=51
  • Memory addresses — 0x7FFE (easier to read than 32766)
  • MAC addresses — AA:BB:CC:DD:EE:FF
  • Unicode code points — U+0041 = "A"
  • Cryptographic hashes — SHA-256 outputs are 64 hex characters

Octal (Base 8)

Octal is less common today but still shows up in:
  • Unix file permissions — chmod 755 means rwxr-xr-x (each digit is 3 binary bits)
  • Legacy programming — some older systems and protocols use octal

Decimal (Base 10)

What humans use. The only reason we need converters is that computers don't think in tens.

How to Convert Manually

Binary to Decimal

Each binary digit represents a power of 2 (right to left): 10110 = 1×16 + 0×8 + 1×4 + 1×2 + 0×1 = 16 + 4 + 2 = 22

Decimal to Binary

Repeatedly divide by 2, read remainders bottom-up: 22 ÷ 2 = 11 remainder 0 11 ÷ 2 = 5 remainder 1 5 ÷ 2 = 2 remainder 1 2 ÷ 2 = 1 remainder 0 1 ÷ 2 = 0 remainder 1

Read bottom-up: 10110

Binary to Hex (Shortcut)

Group binary digits in 4s from right, convert each group: 10110 → 0001 0110 → 1 6 → 0x16

This is why hex exists — it's a compact way to write binary.

How to Use the CalcHub Number Base Converter

  1. Open the Number Base Converter at CalcHub
  2. Enter your number
  3. Select input base (e.g., "Decimal")
  4. Select output base (e.g., "Hexadecimal")
  5. See the converted value instantly

Why don't we use base 12 or base 8 in daily life?

Humans have 10 fingers, so base 10 became the default. Some ancient cultures did use base 12 (Babylonians for time — 12 hours, 60 minutes) and base 20 (Mayans). Base 10 isn't mathematically special — it's just what we're used to.

What's the largest number a byte can hold?

A byte is 8 bits. In binary: 11111111 = 255 in decimal = FF in hex. This is why color values range from 0–255 (one byte per channel).

Why do programmers prefix hex with "0x"?

It's a convention to distinguish hex from decimal. Without the prefix, "10" could mean ten (decimal) or sixteen (hex). "0x10" is unambiguously sixteen. Similarly, "0b" prefixes binary (0b1010 = 10 decimal) and "0o" prefixes octal.


Ad 728x90