Hex Converter

Paste a hexadecimal value to see it as a decimal number, as binary, as octal and, when the bytes make sense, as text. Or go the other way: enter a decimal number or a piece of text and get the hex. Spaces, colons and 0x prefixes are all accepted.

What you enter

What you get

How it works

  1. Pick what you are typing: a hex value, a decimal number, or plain text.
  2. Enter it in the box. For hex you can use spaces, commas, colons or a 0x prefix, for example 48 65 6C 6C 6F.
  3. Read the results: decimal, binary, octal and hex, plus the text those bytes spell when they form valid UTF-8.
  4. In text mode, the decimal, binary and octal rows list one value per byte of your text.

Reading hexadecimal

Hexadecimal counts in sixteens. The digits are 0 to 9 and then A to F for the values 10 to 15, so the two-digit number 3C means three sixteens plus twelve, which is 60. Because 16 is a power of two, every hex digit lines up with exactly four binary digits, and two of them line up with a byte.

That alignment is the reason programmers prefer hex to decimal when looking at raw data. The byte 11111111 is 255 in decimal but simply FF in hex, and the 24-bit colour 255, 136, 0 is FF8800, with each pair being one colour channel.

Hex and text

Text is stored as numbers. In ASCII, the capital letter A is 65, which is 41 in hex; the space character is 20 in hex. UTF-8 extends this so that all the world's writing systems fit, using one byte for the basic English range and up to four for rarer characters. When you convert text here, you see the real bytes that would be sent over a network or saved in a file.

Going from hex to text is only meaningful when the bytes were text to begin with. A hash such as an MD5 or SHA value is a number written in hex, and decoding it as text produces nonsense. The decimal and binary rows are the right reading for numbers and the text row is the right reading for strings.

If you only need numbers in other bases, the binary converter gives a grouped binary display and works from any base.

Tips

Frequently asked questions

How do I convert hex to decimal?

Give each digit a place value that is a power of 16 (1, 16, 256, 4096 and so on, from the right) and add up digit x place. For 2F: 2 x 16 + 15 = 47.

How do I convert decimal to hex?

Divide by 16 repeatedly and write the remainders from last to first, using A to F for 10 to 15. For 255: 255 / 16 = 15 r 15, so FF.

How do I convert hex to text?

Split the hex into pairs, treat each pair as a byte, and read the bytes as UTF-8. 48 65 6C 6C 6F is the bytes 72, 101, 108, 108, 111, which spell Hello.

Why does the text row say nothing for my hex?

Either the number of digits is odd, or the bytes are not valid UTF-8 text. For example FF on its own is not a valid character, so only the number rows are shown.

What is hexadecimal used for?

Hex is a compact way to write binary data. One hex digit equals four bits, so web colours, memory addresses, MAC addresses and file checksums are all written in hex.

Related: Binary converter, Hex colour picker, Case converter.

Start for free or see all free tools. We.Inc is free to start, with no card needed. AI building is on paid plans from $20 a month.

More in Free Tools

We.Inc is an AI-powered website builder you can resell under your own brand. Launch a branded client dashboard, bill on Stripe Connect, and deliver AI-generated websites in minutes. White-label plans start at $99 a month for 25 client sites, with a 7-day free trial and no per-site fees.

Product

Who It's For

Features

Resources

Company

View Sitemap