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.
- Decimal: 4 × 16 + 1 = 65.
- Binary: 65 = 64 + 1, so 1000001 (seven bits).
- Octal: group the binary from the right as 001 000 001, giving 101.
- 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
- Binary Converter — convert between binary and decimal.
- Octal Converter — work in base 8.
- Binary to Hexadecimal Calculator — group bits into hex digits.
- Number Base Converter — convert between any bases.