Hexadecimal Converter - Hex to Decimal, Binary, Octal

Free hexadecimal converter for programmers. Convert hex to decimal, binary, and octal instantly. Supports color codes, memory addresses, and more.

Results

Calculated
Result
—

What the Hex Converter does and when to use it

This converter translates a whole number between hexadecimal, decimal, binary and octal at once. Pick the base of the number you are entering, type it, and the page shows the same value in all four systems, the number of bits it needs, and the bytes those bits fill. It is useful for programmers reading memory addresses, web designers decoding colour codes, electronics students working with registers, and anyone checking a manual conversion.

Hexadecimal is popular because each hex digit equals exactly four binary digits, so long binary strings shrink to a quarter of the length. Two hex digits describe one byte, which is why colours, MAC addresses and character codes are so often written in hex.

Formula and method

Hexadecimal uses sixteen symbols: 0 to 9 and A to F, where A is 10 and F is 15. Each digit position is worth a power of 16, so the number 41 in hex is 4 × 16 + 1 = 65 in decimal. To convert decimal to hex, divide repeatedly by 16 and read the remainders backwards. To convert hex to binary, replace each digit with its four-bit group.

The tool accepts optional prefixes 0x, 0b and 0o, ignores spaces, underscores and commas, and works with very large integers because it uses arbitrary-precision arithmetic. Only unsigned whole numbers are supported.

  • Hex digit one of 0-9, A-F, worth 4 bits.
  • Place value 16 raised to the digit's position, counted from 0 on the right.
  • Bits required the length of the binary form with no leading zeros.
  • Bytes bits divided by 8, rounded up.

Worked example

Convert the hexadecimal number 41 into other bases.

  1. Decimal: 4 × 16 + 1 = 65.
  2. Binary: 65 = 64 + 1, so 1000001 (seven bits).
  3. Octal: group the binary from the right as 001 000 001, giving 101.
  4. Bytes: 7 bits need 1 byte.

The converter shows 0x41, 65, 1000001 and 101, reports 7 bits (1 byte), and notes that 65 is the printable ASCII character A. Entering six hex digits such as 1A2B3C gives decimal 1,715,004, needs 21 bits (3 bytes), and is recognised as a possible CSS colour, #1A2B3C, with red 1A, green 2B and blue 3C.

Common mistakes and how to interpret the result

  • Choosing the wrong input type. The digits 10 mean sixteen in hexadecimal, ten in decimal, and two in binary. Always confirm the selected base before converting.
  • Expecting negative numbers or fractions. Two's complement and floating-point representations are not handled; the converter accepts only non-negative whole numbers.
  • Reading bit counts as field widths. Leading zeros are dropped, so 0x0041 still reports 7 bits even though it might be stored in 16 bits.
  • Mixing up look-alike characters. The letter O is not a hex digit, so use the digit 0, and letters beyond F are rejected as invalid input.

Related calculators

Frequently Asked Questions

How do I convert hex to decimal by hand?
Multiply each digit by 16 raised to its position and add the results. For example, 1F is 1 × 16 + 15 = 31.
Why do colour codes use hex?
Each colour channel runs from 0 to 255, which is exactly two hex digits (00 to FF), so six digits describe red, green and blue compactly.
Is the hex output upper or lower case?
Upper case, for example 0xFF. Input in either case is accepted.
What is the largest number I can convert?
There is no fixed limit in the arithmetic, so very long values work. Practical limits come from your browser's memory and the length you can paste.