Number Base Converter

Convert numbers between binary, octal, decimal, hexadecimal, and any custom base from 2 to 36.

Enter a decimal number (Base 10)

All Base Representations

Base Name Result

How to use

  • Enter a number
    Type the number you want to convert. Make sure it's valid for your selected base — for example, binary only uses 0 and 1, and hex uses 0–9 and A–F.
  • Select From and To base
    Choose the base your number is currently in on the left, and the base you want to convert it to on the right. You can also choose a custom base from 2 to 36.
  • Click Convert
    Hit Convert to see your result, a table of all common base representations, and an optional step-by-step breakdown of the conversion process.
  • Swap direction
    Click ⇄ to instantly reverse the From and To bases — useful when you want to convert back.

Valid digits per base

BaseValid Digits
Binary (2)0, 1
Octal (8)0 – 7
Decimal (10)0 – 9
Hex (16)0 – 9, A – F
Base 360 – 9, A – Z
⚠️ Note
This converter handles integers only. Hexadecimal output is shown in uppercase (e.g. FF, not ff). Negative numbers are supported with a leading minus sign.

What is a Number Base?

A number base (or radix) defines how many unique digits a numeral system uses. The most familiar is Base 10 (decimal), which uses digits 0 through 9. Computers, however, operate on Base 2 (binary) — using only 0s and 1s — because electronic circuits naturally represent two states: on and off. Other bases like octal (8) and hexadecimal (16) exist primarily as compact human-readable representations of binary data.

The Four Most Common Number Bases

BaseNameDigits UsedCommon Use
2Binary0, 1Computer hardware, logic circuits
8Octal0 – 7Unix file permissions, older computing
10Decimal0 – 9Everyday counting and arithmetic
16Hexadecimal0 – 9, A – FMemory addresses, color codes, debugging

How Does Binary Work?

Binary uses only 0 and 1. Each digit position represents a power of 2. Reading from right to left: 2⁰ = 1, 2¹ = 2, 2² = 4, 2³ = 8, and so on. To convert binary 1101 to decimal: (1×8) + (1×4) + (0×2) + (1×1) = 13. Every number you know in decimal has a binary equivalent — this is how computers store and process all data.

What is Hexadecimal Used For?

Hexadecimal (hex) is widely used in computing because it compactly represents binary data. Each hex digit represents exactly 4 binary bits. So instead of writing 11111111 in binary, you just write FF in hex — much shorter. Hex is used in memory addresses (e.g. 0x1A3F), HTML/CSS color codes (e.g. #FF5733), and machine-level debugging.

Frequently Asked Questions

What is 255 in binary?

255 in decimal = 11111111 in binary. It is also FF in hexadecimal and 377 in octal. It's a very common value in computing — for example, each color channel in RGB goes from 0 to 255.

What is the difference between binary and hexadecimal?

Binary uses only 0 and 1 (Base 2). Hexadecimal uses 0–9 and A–F (Base 16). One hex digit is exactly equivalent to 4 binary digits (bits). Hex is essentially a shorthand for binary — it's much easier to read and write.

How do I convert decimal to binary?

Repeatedly divide the decimal number by 2 and record the remainders. Read the remainders from bottom to top. For example, 13 ÷ 2 = 6 R1 → 6 ÷ 2 = 3 R0 → 3 ÷ 2 = 1 R1 → 1 ÷ 2 = 0 R1. Reading remainders bottom to top: 1101. So 13 in decimal = 1101 in binary.

What are octal numbers used for?

Octal (Base 8) was historically used in computing because early systems used 6-bit or 12-bit words that divided neatly into groups of 3 bits (each group = one octal digit). Today, octal is most commonly seen in Unix and Linux file permissions — for example, chmod 755 uses octal notation.

What does 0x mean in front of a number?

The prefix 0x indicates a hexadecimal number in programming. For example, 0xFF means FF in hexadecimal, which equals 255 in decimal. This notation is used in languages like C, Java, JavaScript, and Python.

Can I convert to bases other than 2, 8, 10, and 16?

Yes — this converter supports any base from 2 to 36. Bases above 10 use letters A–Z to represent digit values 10–35. For example, in Base 36, Z = 35. Base 36 is sometimes used for URL shorteners and unique ID generation.

Related Calculators