Change language

Developers

Base converter: binary, octal, decimal and hexadecimal

Convert numbers between bases 2, 8, 10, 16, 32 and 36.

Reviewed by SolucionesAhora.com How we verify

Calculator inputs

Results

Enter your values and press “Calculate” to see the result.

In short

What it calculates
Convert numbers between bases 2, 8, 10, 16, 32 and 36.
Formula used
Each digit is worth its value × base^position
Example
The number 255 in base 10:

Number base converter

Working with file permissions, bit masks, colours or memory addresses means jumping between number bases constantly.

Enter the number once and get the four common representations at the same time.

How it works

The number is read in the source base, converted to decimal and from there to the target base. Letters up to Z are accepted for bases 32 and 36.

Formula

Each digit is worth its value × base^position

255 decimal = 1111 1111 binary = FF hexadecimal

Worked example

The number 255 in base 10:

Binary: 11111111
Octal: 377
Hexadecimal: FF

Explanation

Why hexadecimal dominates in computing

A byte is eight bits, and eight bits are written with exactly two hexadecimal digits. That clean correspondence makes hex the most compact way to read memory, addresses and colours without losing the direct relationship to the bits. In decimal no such correspondence exists, which is why it was never used.

Web colours

A colour like #FF8000 is three bytes: red at maximum, green at half, blue at zero. Converting each pair to decimal gives 255, 128 and 0, which is the same information in RGB notation. Understanding this lets you adjust colours by hand without a picker.

Binary and powers of two

In binary each position is worth double the previous one, which is why computing sizes are 256, 512, 1024. A traditional kilobyte is 1024 bytes rather than a thousand, which explains why a one-terabyte drive shows less capacity than advertised once formatted.

Octal, the one that nearly disappeared

It survives in Unix file permissions, where 755 or 644 are actually base-eight numbers encoding three groups of three bits: read, write and execute.

Frequently asked questions

Does it handle decimals?

No. Conversion works on whole numbers, which is the usual case in programming and systems work.

Why is hexadecimal so common?

Because each hex digit represents exactly four bits, so a byte is always written with two characters.

Why does a 1 TB drive show less capacity?

Because the manufacturer counts a terabyte as a trillion bytes while the operating system divides by powers of 1024, giving a smaller figure.

What does a colour like #FF8000 mean?

Three hexadecimal bytes: FF is 255 red, 80 is 128 green and 00 is 0 blue. It is the same information as an RGB colour.

Need to calculate something else?

These tools are often used alongside this calculator.

Data

Bytes, kilobytes, megabytes, gigabytes and terabytes, decimal and binary.

Base64

Turn text into Base64 and recover the original text.

Timestamp

Convert between Unix timestamps and readable UTC dates.

Passwords

Random passwords with calculated entropy, generated in your browser.