FreecalcSite
Everyday Utility

Number Base Converter

Convert numbers between decimal, binary, hexadecimal, and octal instantly.

Select input base, then type your number

Valid characters: 0123456789

Number Properties (decimal 255)
Decimal
255
Bits needed
8
Bytes needed
1
Is even?
No
Common Values Reference Table
DecimalBinaryOctalHex
0000000
1000111
2001022
4010044
7011177
81000108
10101012A
15111117F
160001 00002010
320010 00004020
640100 000010040
1281000 000020080
2551111 1111377FF
2560001 0000 0000400100
5120010 0000 00001000200
10240100 0000 00002000400

Understanding Number Bases

A number base (or radix) defines how many unique digits a number system uses. The decimal system (base 10) that we use daily has digits 0–9. Binary (base 2) has only 0 and 1. Octal (base 8) uses 0–7. Hexadecimal (base 16) uses 0–9 plus A–F to represent values 10–15.

These number systems aren't just academic — they're the foundation of modern computing. Every piece of data a computer stores or processes is ultimately binary. Hexadecimal provides a human-readable shorthand for binary: since 16 = 2⁴, each hex digit perfectly represents exactly 4 binary bits, making it far more compact than writing out long strings of 0s and 1s.

Understanding base conversion is useful for web developers (CSS color codes), security professionals (reading hex-encoded data), computer science students, and anyone working with low-level systems or networking.

The Four Common Bases

Binary (Base 2)

Digits: 0, 1

Used for: Computer hardware, logic gates, bitwise operations, networking masks

255 = 1111 1111

Octal (Base 8)

Digits: 0–7

Used for: Unix/Linux file permissions (chmod), legacy systems

255 = 377

Decimal (Base 10)

Digits: 0–9

Used for: Human everyday math, currency, most user-facing displays

255 = 255

Hexadecimal (Base 16)

Digits: 0–9, A–F

Used for: Memory addresses, color codes, cryptographic hashes, bytecode

255 = FF

Conversion Methods

Decimal → Binary (Repeated Division by 2)

Convert 42 to binary:

42 ÷ 2 = 21 R0

21 ÷ 2 = 10 R1

10 ÷ 2 = 5 R0

5 ÷ 2 = 2 R1

2 ÷ 2 = 1 R0

1 ÷ 2 = 0 R1

Read remainders bottom-up → 101010

Binary → Decimal (Positional Value)

Convert 1010 1100 to decimal:

1×2⁷ + 0×2⁶ + 1×2⁵ + 0×2⁴ + 1×2³ + 1×2² + 0×2¹ + 0×2⁰

= 128 + 0 + 32 + 0 + 8 + 4 + 0 + 0 = 172

Hex → Binary (Group of 4 bits)

Each hex digit = exactly 4 binary bits:

A = 1010, B = 1011, C = 1100, D = 1101

E = 1110, F = 1111, 5 = 0101, 7 = 0111

So: 0x5F = 0101 1111 = decimal 95

And: 0xFF = 1111 1111 = decimal 255

Real-World Uses of Number Bases

Web Colors (CSS)

#FF6600 is hex for RGB(255, 102, 0). FF=255 red, 66=102 green, 00=0 blue. Hex is compact and human-readable for 24-bit color values.

IPv4 Networking

Subnet masks like 255.255.255.0 are expressed as decimals but are really binary masks. 255 = 1111 1111 — all 8 bits set.

Unix Permissions

chmod 755 = 111 101 101 in binary. Owner: rwx (7), Group: r-x (5), Other: r-x (5). Octal is a natural fit for 3-bit permission groups.

Memory Addresses

RAM addresses are shown in hex: 0x00400000. A 64-bit address space goes from 0x0 to 0xFFFFFFFFFFFFFFFF.

ASCII / Unicode

The letter 'A' is 0x41 (hex) = 65 (decimal) = 0100 0001 (binary). Character encoding tables always use hex for readability.

Cryptographic Hashes

SHA-256 hashes are 256-bit binary outputs displayed as 64 hex characters. e.g. a3f8...d2c1 is 256 bits in 64 hex digits.

Frequently Asked Questions

How do I convert binary to decimal?

Multiply each bit by 2 raised to its position (right to left, starting at 0) and sum. For 1011: 8+0+2+1 = 11.

How do I convert decimal to binary?

Repeatedly divide by 2, record remainders, read bottom-up. 13 → R1, R0, R1, R1 → 1101.

What is hexadecimal and why is it used?

Base 16, using 0–9 and A–F. Each hex digit = 4 binary bits. Used for memory addresses, color codes, and bytecode because it compactly represents binary data.

How do I convert hexadecimal to decimal?

Multiply each digit by 16 raised to its position. For 2F: (2×16) + (15×1) = 32+15 = 47. A=10, B=11, C=12, D=13, E=14, F=15.

What is octal (base 8)?

Digits 0–7. Each octal digit = 3 binary bits. Used in Unix file permissions (chmod 755). Decimal 8 = octal 10.

What does 0x mean before a number?

The 0x prefix indicates hexadecimal in programming. 0xFF = 255 decimal. 0b prefix = binary; 0o prefix = octal.

How many binary digits does a decimal number need?

Bits = floor(log₂(n)) + 1. So 255 needs 8 bits. A byte (8 bits) holds 0–255.

What is a nibble, byte, and word?

Nibble = 4 bits (one hex digit, 0–15). Byte = 8 bits (two hex digits, 0–255). Word = 16/32/64 bits depending on CPU architecture.

Related Calculators

Methodology & Disclaimer

Calculation method: Converts via JavaScript's parseInt(value, fromBase) and Number.toString(toBase). Supports non-negative integers. Input is validated to only accept characters valid for the selected base. Hex output is uppercase. Binary output is grouped in nibbles (4 bits) for readability. Last updated: September 2026. Maintained by The Free Calculator Site.

Share your thoughts

Help us improve The Free Calculator Site

What kind of feedback?

Screenshot / attachment (optional)

Page:/

We read every submission. Your email is never shared.