Hexadecimal Calculator

Hexadecimal Calculator: solve hexadecimal problems step-by-step. Clear formula, worked example, and FAQs included.

For nearby base-specific checks, compare the binary-to-decimal calculatorthe while keeping the source and target bases visible.

Hexadecimal is base 16. It uses the decimal digits 0 through 9 plus A through F for values 10 through 15. Because one hexadecimal digit represents four binary bits, hexadecimal gives people a compact way to inspect values that would be much longer in binary.

This page starts with hexadecimal as the source and decimal as the target, making it useful for checking a memory value, byte, colour component, or programming literal. It also supports any target base from 2 through 36, so a reverse base-16 conversion can be checked directly. Hexadecimal is common in CSS colour codes, memory addresses, MAC addresses, hashes, byte dumps, Unicode notation, and low-level debugging because it aligns neatly with binary.

Strict validation: Only 0–9 and A–F are valid for hexadecimal. G may look like a plausible continuation of the alphabet, but it represents 16 and therefore belongs to a base greater than 16.

  1. Enter a whole number using the symbols allowed by the selected source base. Spaces are ignored, but prefixes such as 0b and 0x are not part of the input.
  2. Choose the source base from 2 through 36. The source base controls how every character is interpreted.
  3. Choose the target base. The result updates immediately and uses 0–9 followed by uppercase A–Z for values from 10 onward.
  4. Open the place-value expansion when converting from a non-decimal base and check each digit contribution.
  5. Use “Swap bases and convert reverse” to send the result back through the opposite direction and confirm the original value.
  6. If an error appears, correct the complete input rather than relying on a partial parse. A rejected digit means the numeral is not valid in the selected source base.

Hexadecimal Calculator formula and method

For a numeral with digits d and source base b, each position contributes d×bⁿ, where n starts at zero on the right. Add the contributions to obtain the quantity in decimal. The calculator uses exact integer arithmetic for this part, so long values are not first rounded to a JavaScript floating-point number.

The hexadecimal value A3 expands to 10×16¹ + 3×16⁰ = 160 + 3 = 163. The A is a digit with value 10, not the first letter of a word and not the decimal number 3.

To convert a decimal integer into another base, divide by the target base and keep each remainder. Continue with the quotient until it reaches zero, then read the remainders from the last one back to the first. The quotient-and-remainder method is the reverse of positional expansion.

To reverse the example, decimal 163 divided by 16 gives quotient 10 and remainder 3, then quotient 0 and remainder 10. Reading the remainders upward gives A3, confirming the original hexadecimal value.

Binary, octal, and hexadecimal have convenient shortcuts: one hex digit corresponds to four binary bits, and one octal digit corresponds to three. Those shortcuts are checks on the same place-value mathematics, not different definitions of the number.

Reading your hexadecimal calculator result

The base is part of the answer

A result without its base is incomplete. For example, “10” means two in binary, eight in octal, ten in decimal, and sixteen in hexadecimal. Always copy the target base with the displayed digits when moving the value into code, a worksheet, a shell command, or technical documentation.

This page starts with hexadecimal as the source and decimal as the target, making it useful for checking a memory value, byte, colour component, or programming literal. It also supports any target base from 2 through 36, so a reverse base-16 conversion can be checked directly. The hexadecimal value A3 expands to 10×16¹ + 3×16⁰ = 160 + 3 = 163. The A is a digit with value 10, not the first letter of a word and not the decimal number 3. The decimal value is shown as a reference, while the selected target-base result is the answer to the conversion you requested.

To reverse the example, decimal 163 divided by 16 gives quotient 10 and remainder 3, then quotient 0 and remainder 10. Reading the remainders upward gives A3, confirming the original hexadecimal value. If the reverse result differs, check the source and target selectors, the direction of the copied value, and whether a leading zero is meaningful for the format you are using.

Math tips and best practices

Common mistakes to avoid

Number-base conversion is educational mathematical information, not a security guarantee or a substitute for testing the syntax required by a particular programming language, operating system, protocol, or file format. Integer conversions on this page are exact when the input is valid. Check the receiving system's documentation for signed interpretation, fixed-width padding, prefixes, overflow rules, and permission semantics before using a result in a consequential technical setting.

Related Calculators