Binary, Decimal & Hex Converter

Enter a number in any base and instantly see it in binary, decimal, hexadecimal, and octal.

Last updated: September 23, 2026

Everything is calculated locally in your browser.

How to convert binary to decimal

Each digit in a binary number represents a power of 2, starting from the rightmost digit (2⁰). To convert to decimal, multiply each digit by its place value and add the results together. For example, binary 1111 = (1×8)+(1×4)+(1×2)+(1×1) = 15 in decimal.

How to convert hex to decimal

Hexadecimal (base 16) uses digits 0-9 and letters A-F to represent values 10-15. Each digit represents a power of 16, so hex FF = (15×16)+(15×1) = 255 in decimal. Select "Hexadecimal" above and enter a value to convert it instantly.

Where you'll see each base in real life

Binary (base 2) is the native language of computer hardware every value a computer stores ultimately comes down to a sequence of 1s and 0s, which is why it's a foundational topic in computer science education. Hexadecimal (base 16) is the practical, human-readable shorthand for binary that programmers actually use day to day: every 4 binary digits map to exactly 1 hex digit, so hex is far more compact. You'll see it in web color codes (#FF5733 is a color made of three hex byte values), memory addresses, MAC addresses, and error codes. Octal (base 8) is far less common today but still appears in Unix/Linux file permission notation (chmod 755) and some older systems.

Worked example: decoding a color code

A web color like #FF5733 is really three separate hex byte values FF, 57, and 33 representing the red, green, and blue intensity on a scale of 0-255. Converting FF: F is 15 in each hex position, so FF = (15×16)+(15×1) = 255, the maximum intensity. Converting 33: (3×16)+(3×1) = 51. Select "Hexadecimal" as the input base above and enter FF, 57, or 33 individually to see each channel's decimal value.

Limits of this converter

This tool converts whole, non-negative numbers using standard JavaScript number handling, which is reliable up to 2^53 (about 9 quadrillion) far beyond what most manual conversions need. Numbers larger than that, or negative numbers (which computers represent using a scheme called two's complement rather than a simple minus sign), aren't supported here.

FAQ

What's octal used for?
Octal (base 8) is less common today but still shows up in Unix file permissions (like chmod 755) and some older computing contexts.

Can I convert negative numbers?
This tool works with non-negative whole numbers. Negative numbers in binary typically use two's complement representation, which isn't covered here.

Why does FF equal 255?
F represents 15 in a single hex digit, and hexadecimal is base 16, so FF = (15×16)+(15×1) = 255 which is also why 255 is the maximum value in a single 8-bit byte and the highest value in an RGB color channel.

What's the largest number this tool can convert accurately?
Numbers up to 2^53 (about 9 quadrillion) convert with full precision, which covers essentially any manual conversion need. Beyond that, JavaScript's number handling starts to lose precision, so very large numbers aren't supported.

Why do programmers use hex instead of binary?
Because hex is far more compact every 4 binary digits map to exactly 1 hex digit, so a value that takes 8 binary digits to write takes only 2 in hex. It's a human-readability shortcut for binary, not a different underlying value.

What does 2^0 mean in the binary explanation?
It means 2 raised to the power of 0, which equals 1 the place value of the rightmost binary digit. Each position to the left doubles: 1, 2, 4, 8, 16, and so on, the same way each position in a decimal number is a power of 10.