Number Base Converter Binary · Octal · Decimal · Hex · Custom Base

Live Converter

Type a number above to see the conversion steps.

Quick Reference: 0–15 in All Bases

Decimal Binary Octal Hex

How Number Base Conversion Works

Every number system is built on a base — the number of unique digit symbols used. Our everyday decimal system uses base 10 (digits 0–9). Computers natively use binary (base 2, digits 0–1). Programmers often work with octal (base 8) and hexadecimal (base 16) as compact shorthands for binary data.

Binary to Decimal

Each binary digit (bit) represents a power of 2 based on its position, counting right to left from position 0. Multiply each bit by its positional value and sum:

1010 binary = 1×2³ + 0×2² + 1×2¹ + 0×2⁰ = 8 + 0 + 2 + 0 = 10 decimal

Decimal to Binary (Long Division)

Repeatedly divide the decimal number by 2, recording each remainder. Read the remainders bottom-to-top for the binary result:

10 ÷ 2 = 5 remainder 0 5 ÷ 2 = 2 remainder 1 2 ÷ 2 = 1 remainder 0 1 ÷ 2 = 0 remainder 1 → Read remainders upward: 1010

Hexadecimal

Hex uses 16 symbols: 0–9 and A–F (A=10, B=11, C=12, D=13, E=14, F=15). One hex digit compactly represents exactly 4 binary bits. Two hex digits represent one byte. This makes hex ideal for memory addresses and color codes.

Why Octal?

Octal (base 8) was popular in early computing because 3 binary bits map to exactly one octal digit. It appears in Unix file permissions (chmod 755 = 111 101 101 in binary) and older programming contexts.

Two's Complement

Computers represent negative integers using two's complement. For an N-bit register: if the leading bit is 0, the value is positive (same as unsigned). If the leading bit is 1, the signed value equals the unsigned value minus 2N. For example, 8-bit 11111111 = 255 unsigned = −1 signed.

Two's Complement Interpreter

Enter an N-bit binary number to see both its unsigned and signed (two's complement) interpretations. Use the Bitwise View panel above to toggle individual bits and watch all values update live.

The table below shows common 8-bit two's complement values:

Binary (8-bit)UnsignedSigned (Two's Comp.)
0000 000000
0111 1111127127 (max positive)
1000 0000128−128 (min negative)
1111 1111255−1
1111 1110254−2
1000 0001129−127

Frequently Asked Questions

How do I convert binary to decimal?
Multiply each binary digit by its positional power of 2 and sum the results. For example, 1010₂ = 1×2³ + 0×2² + 1×2¹ + 0×2⁰ = 8+0+2+0 = 10₁₀. This tool does it instantly and shows the steps.
What is hexadecimal used for?
Hexadecimal (base 16) is used in programming for memory addresses, color codes (#FF5733), and representing binary data compactly. Two hex digits always represent exactly one byte (8 bits), making it far more readable than raw binary.
What is two's complement?
Two's complement is the standard way computers represent negative integers. For an N-bit number, if the leading bit is 1, subtract 2N from the unsigned value to get the signed value. 8-bit 11111111 = 255 unsigned = −1 signed.
What is the largest number this converter handles?
This converter uses JavaScript BigInt, so it handles arbitrarily large integers with no precision loss. Standard JS Number is accurate to 253 − 1; BigInt removes that limit entirely.
What is base 36 and where is it used?
Base 36 uses digits 0–9 and letters A–Z. It is the most compact representation using only alphanumeric characters and is used for URL shorteners, serial numbers, and encoded identifiers.