Base Converter

Quick answer

A base converter changes a whole number between decimal, binary, octal and hexadecimal. Choose the base you are entering, then type the value, and it shows the number in all four bases at once. For example, the decimal number 255 is 11111111 in binary and FF in hexadecimal.

Updated 2026-09-09By Shakeel MuzaffarReviewed by Prof. Dr. Khalil Mudassar, PhD
Try
Converters
Input base
Enter the number in the base you selected. Hex may use letters A to F.
Decimal (base 10)
--
Binary (base 2)--
Hexadecimal (base 16)--

Calculations run in your browser. Inputs are not sent to our servers; anything you Save stays in this browser only.

Saved results (0)

How to Use the Base Converter

  1. Choose the input base: decimal, binary, octal or hex.
  2. Enter the value in that base.
  3. Read the decimal result.
  4. See the binary and hexadecimal forms too.

Here is what each result means:

ResultWhat it means
DecimalThe value in ordinary base 10.
BinaryThe value in base 2, using 0 and 1.
HexadecimalThe value in base 16, using 0 to 9 and A to F.

What Is a Number Base?

A number base, or radix, is how many digits a counting system uses and what each place is worth. We normally count in base 10, decimal, with ten digits from 0 to 9, where each place to the left is worth ten times the one before. Computers, though, use other bases that suit how they store and process data.

Binary, base 2, uses only 0 and 1, matching the on-off states of electronic switches, so it is the native language of computers. Hexadecimal, base 16, uses 0 to 9 and then A to F for the values ten to fifteen; it is a compact way to write binary, since each hex digit stands for exactly four binary digits. Octal, base 8, uses 0 to 7 and appears in some older systems.

All of these are positional systems, so the same idea applies to each: the rightmost place is worth 1, and each place to the left multiplies by the base. Converting between them does not change the number itself, only how it is written. The decimal 255, the binary 11111111 and the hex FF are all the same value.

How Does the Base Converter Work?

It reads your value in the chosen base and rewrites it in the others.

Idea: every base is positional, so a value equals each digit times the base raised to its place. Converting means finding the digits for a different base.
  1. Your value is checked to make sure every digit is valid for the input base.
  2. It is read into an ordinary decimal number.
  3. That number is rewritten in binary, octal, decimal and hexadecimal.

For other number tools, see the Roman numeral converter and the scientific notation calculator.

Base Converter Example

Convert the decimal number 255.

Result: 255 is 11111111 in binary (eight ones), 377 in octal, and FF in hexadecimal. FF is compact because each F stands for four binary ones.

The Four Common Bases

Each base uses a different set of digits.

BaseNameDigits
2Binary0, 1
8Octal0 to 7
10Decimal0 to 9
16Hexadecimal0 to 9, A to F

Binary and hexadecimal pair up neatly: one hex digit equals exactly four binary digits, so hex is a short, readable way to write long binary strings. This is why hexadecimal is common in programming and colour codes.

Comparing How a Value Looks in Each Base

The same value is written very differently in each base.

DecimalBinaryOctalHex
10101012A
16100002010
25511111111377FF

Higher bases pack the same value into fewer digits. That is why hexadecimal is popular for writing memory addresses and byte values, where a compact form is easier to read than a long row of ones and zeros.

What Affects the Converted Value

The Input Base

The same digits mean different values in different bases, so choosing the right input base is essential.

Valid Digits

Each base allows only certain digits; a 2 is not valid in binary, and a G is not valid in hex.

The Size of the Number

Very large numbers can lose exactness once they pass the safe integer limit.

When to Use a Base Converter

Programming

Convert between decimal, binary and hex when working with code or data.

Networking and Colours

Read hex colour codes or byte values in different bases.

Learning

See how the same number looks across counting systems.

Common Mistakes

1. Wrong Input Base

10 in binary is 2 in decimal, not ten. Always set the base you are entering.

2. Invalid Digits

Binary uses only 0 and 1; hex goes up to F. Other characters are not valid.

3. Confusing Hex Letters

In hex, A to F are digits for 10 to 15, not letters of a word.

4. Dropping Leading Zeros

Leading zeros do not change the value, but keep byte widths in mind when they matter.

5. Very Large Numbers

Beyond the safe integer limit, conversions may lose exactness.

Accuracy and Limitations

Conversions are exact for non-negative whole numbers within the safe integer range.

What it calculates accurately

  • Conversion between decimal, binary, octal and hex
  • Digit validation for the input base
  • All four bases at once

What it does not do

  • Handle negative numbers
  • Convert fractions or decimals
  • Work beyond the safe integer limit exactly
  • Use bases other than 2, 8, 10 and 16

How We Convert Between Bases

Method
Read the value in the input base into a decimal integer, then rewrite it in binary, octal, decimal and hex.
Inputs used
A value and its input base.
Bases
Binary (2), octal (8), decimal (10) and hexadecimal (16).
Assumptions
Non-negative whole numbers; valid digits for the chosen base.
Edge cases
Invalid digits are rejected; very large numbers may exceed the exact integer range.

Frequently Asked Questions

How do you convert decimal to binary?

Repeatedly divide by 2 and read the remainders from bottom to top. This converter does it for you: 255 in decimal is 11111111 in binary.

What is 255 in hexadecimal?

255 is FF in hexadecimal. Each F stands for 15, and the value is 15 times 16 plus 15, which is 255.

What digits does hexadecimal use?

Hexadecimal uses 0 to 9 and then A, B, C, D, E and F for the values 10 to 15, giving sixteen digits in all.

Why do computers use binary?

Binary matches the on-off states of electronic switches, so 0 and 1 map directly to off and on. Everything a computer stores is built from these two digits.

What is the difference between binary and hexadecimal?

Both are used in computing, but binary uses two digits and hex sixteen. One hex digit equals exactly four binary digits, so hex is a shorter way to write binary.

Can I convert from any base?

This tool converts between decimal, binary, octal and hexadecimal, the four most common bases. Choose which base you are entering from the toggle.

Does it handle negative numbers?

No. It converts non-negative whole numbers only. Negative numbers and fractions are outside its range.

What is octal used for?

Octal, base 8, groups binary digits in threes. It was common in older computer systems and still appears in some settings, such as file permissions.

Is my information saved?

No. The calculation runs in your browser and nothing you enter is stored or sent anywhere, unless you choose Save, which keeps the result only on this device.

Sources

Related Guides

Related Calculators

Looking for more converters?

Explore all converters

This converter changes a whole number between decimal (base 10), binary (base 2), octal (base 8) and hexadecimal (base 16). Choose the base of your input and enter the value; hexadecimal uses the digits 0 to 9 and letters A to F. It handles non-negative whole numbers and shows the value in all four bases. Spotted an error? Let us know.

Creator

shakeel-Muzaffar
Founder & Editor-in-Chief at  ~ Web ~  More Posts

Shakeel Muzaffar is the Founder and Editor-in-Chief of MultiCalculators.com, bringing over 15 years of experience in digital publishing, product strategy, and online tool development. He leads the platform's editorial vision, ensuring every calculator meets strict standards for accuracy, usability, and real-world value. Shakeel personally oversees content quality, formula verification workflows, and the platform's commitment to publishing tools that are genuinely useful for students, professionals, and everyday users worldwide.

Areas of Expertise: Editorial Leadership, Digital Publishing, Product Strategy, Online Calculators, Web Standards