Skip to content

Hex Converter

Guide
Loading tool workspace...

Inspect 2A in several bases. It is 42 in decimal, 101010 in binary before padding, and 52 in octal.

What is Hex Converter?

When a spec documents a constant in hex but your test needs decimal and binary, convert it once and compare the representations together. Use the worked steps for the first value to check the arithmetic. Switch to a text direction when the input represents character bytes.

How to use Hex Converter

  1. Choose a source format and the format to produce.
  2. Enter the value and check the cross-base summary or first-value working.
  3. Copy the result in the desired format, or use Swap to change direction.

Key features

  • Convert hex to decimal, binary, octal and text
  • Convert decimal, binary, octal or text back to hex
  • Every base shown at once for a single value
  • Step-by-step working for hex to decimal and decimal to hex
  • Exact results for numbers of any size
  • Optional 0x prefix, uppercase hex and a choice of delimiter

Common use cases

  • Reading hex values from logs, memory dumps and network captures
  • Converting color channels, byte values and bit masks
  • Checking hex IDs, addresses and checksums in decimal
  • Decoding hex-encoded text
  • Learning how hexadecimal works with worked examples

Technical details & standards

Hexadecimal uses the digits 0–9 and the letters A–F for the values 10 to 15, and each position is worth 16 times the one to its right: 1F4 is 1 × 256 + 15 × 16 + 4 = 500. Because 16 is 2⁴, every hex digit maps to exactly four bits, which is why hex is the usual shorthand for bytes, colors, memory addresses and hashes.

Numbers are converted with JavaScript BigInt, so there is no precision limit. Text conversions treat each pair of hex digits as one byte and each character as its character code, so 48 65 6C 6C 6F decodes to Hello. Everything runs in your browser; nothing is uploaded.

Frequently asked questions

What is the difference between converting a hex value to decimal and to text?

Decimal represents the number in another base. Text interprets bytes as encoded characters.

What can this hex converter convert?

Hex to decimal, binary, octal and text, and each of those back to hex. Choose the two formats in the menus at the top; it also converts between decimal, binary and octal.

Do I need to type the 0x prefix?

No. 0x1F4 and 1F4 give the same result. To add 0x to hex output, tick Include 0x Prefix.

Can it convert several hex values at once?

Yes. Separate the values with spaces or commas, for example FF 2A 100, and each one is converted. The step-by-step working is shown for the first value.

Is there a limit on how large a hex number can be?

No. Numbers are converted with arbitrary-precision integers, so 64-bit values such as FFFFFFFFFFFFFFFF (18446744073709551615) stay exact.

How do I convert a decimal number into hex?

Set Convert from to Decimal and Convert to to Hex, then type the number: 255 becomes FF and 4096 becomes 1000. For bitwise operations such as AND, OR and shifts on hex values, the Programmer Calculator is the better fit.

Can it decode hex to readable text?

Yes. Set Convert from to Hex and Convert to to ASCII Text, then paste the byte pairs: 48 65 6C 6C 6F decodes to Hello. Pairs can be separated by spaces or commas, or run together as one string such as 48656C6C6F.

How do I convert hex to octal?

Set Convert from to Hex and Convert to to Octal, then type the value: FF becomes 377 and 1F4 becomes 764. By hand, write each hex digit as four bits, regroup the bits in threes from the right and read each group as an octal digit: 1F4 is 0001 1111 0100, regrouped as 000 111 110 100, which is 764.

Can it convert hex color codes?

It converts the hex pairs in a color to decimal, which are its RGB values: enter FF 88 00 with Convert to set to Decimal and #FF8800 becomes 255 136 0, or rgb(255, 136, 0). It does not pick colors or convert them to CMYK or Pantone.

Is this a hex calculator?

No. It converts values between number systems but does not add, subtract or combine them. For arithmetic and bitwise operations with the answer shown in hex, binary and octal, use the Programmer Calculator.

More converters tools

View all