Hex Calculator

Convert a number between hexadecimal and decimal, in either direction.

  • Free to use
  • Accurate results
  • No registration required
  • Works on all devices
Enter a number and choose a direction to convert between hexadecimal and decimal.
Enter a decimal number, or a hex number using digits 0-9 and letters a-f, depending on the direction chosen below.
Convert

Your result

ff

Result

AI explanation

Formula

Repeated division/multiplication by 16 to convert between decimal and hexadecimal place values

Worked example

Decimal 255 to hex

Worked example: Decimal 255 to hex
FieldValue
Value255
Convertfrom-decimal
Resultff

Assumptions

  • Only non-negative whole numbers are supported.
  • Hex input must contain only the digits 0-9 and letters a-f (case-insensitive).

Frequently asked questions

How does hexadecimal (base 16) work?

Hex uses 16 digits — 0 through 9, then a through f for 10 through 15 — with each position representing a power of 16.

Why is hex commonly used in computing?

Hex is a compact way to represent binary data, since each hex digit corresponds to exactly 4 binary digits (bits) — it's commonly used for color codes, memory addresses, and byte values.

What if I only need one direction?

Use the Decimal to Hex Calculator or Hex to Decimal Calculator for a single-purpose version of this same conversion.

Related calculators

Report a calculation issue