calculatorkong

Number Base Converter

Binary
Octal
Decimal
Hexadecimal

Positional notation
value = Σ digitᵢ × base^i (i counted from the right, starting at 0)

Computers think in binary, programmers read hexadecimal, and people count in decimal — but they are all just different ways of writing the same number. This number base converter instantly translates any value between binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16).

How number bases work

Every number system uses positional notation: each digit's value is multiplied by the base raised to its position. In decimal, 255 means 2×100 + 5×10 + 5×1. In binary, 1011 means 1×8 + 0×4 + 1×2 + 1×1 = 11. The base just changes how many digits are available and how quickly place values grow.

How to use the converter

Type a value, choose the base you entered it in, and the tool shows the binary, octal, decimal and hexadecimal equivalents at once. It accepts optional prefixes like 0x for hex or 0b for binary, and it validates your input so you cannot accidentally enter a digit that does not exist in the chosen base (like a 2 in binary).

Converting by hand

To convert a decimal number to another base, repeatedly divide by the base and read the remainders from bottom to top. To go the other way, multiply each digit by its place value and sum them. Hexadecimal uses A–F to represent the values 10–15, so 255 becomes FF.

Where these bases show up

Binary and hex are everywhere in computing: RGB colors like #FF8800, file permissions, memory addresses, and byte values. Because each hex digit equals exactly four binary bits, hexadecimal is the most convenient shorthand for the raw data a computer actually stores.

Frequently Asked Questions

What are binary, octal, decimal and hexadecimal? +

They are number bases. Binary (base 2) uses digits 0–1, octal (base 8) uses 0–7, decimal (base 10) uses 0–9, and hexadecimal (base 16) uses 0–9 plus A–F. They all represent the same values using different digits.

How do I convert decimal to binary? +

Repeatedly divide the number by 2 and read the remainders from bottom to top — or simply type your decimal value here and read the binary result instantly.

What is 255 in hexadecimal? +

255 in decimal is FF in hexadecimal and 11111111 in binary — exactly one byte, which is why FF appears so often in color codes and low-level programming.

How do I convert binary to decimal? +

Multiply each bit by its place value (a power of 2) and add them up. For example 1011 = 1×8 + 0×4 + 1×2 + 1×1 = 11. The converter does this automatically.

Why is hexadecimal used in computing? +

Hex is a compact shorthand for binary: each hex digit maps to exactly 4 bits, so a byte is just two hex digits. That makes it ideal for colors (#FF8800), memory addresses and byte values.

Can I paste values with a 0x or 0b prefix? +

Yes. The converter strips common prefixes like 0x (hex) and 0b (binary) and validates that your digits are legal for the base you selected.

Can I embed this calculator on my website? +

Yes — click Get widget in the toolbar above for a free copy-paste embed code with light/dark themes. See our calculator widgets page for a walkthrough.

Powered by Calculator Kong ↗

Related Calculators