th

Text to HEX

✓ Free & no signup 🔒 Runs 100% in your browser Updated 2026-11-25 Binary Converter Tools

Hexadecimal is the developer's everyday alphabet: color codes, memory addresses, MAC addresses, protocol dumps, and error messages all speak it. This tool adds text to that list: paste any string and watch it become a sequence of two-digit hex byte values, live as you type. Hi becomes 48 69, where 48 is the hex form of the letter H's byte and 69 is the i. The conversion runs entirely in your browser, nothing is uploaded or stored, and the page is free with no signup, working the same on a phone as at a desk.

The key word, as with every text encoding, is bytes. The tool encodes your text as UTF-8 first, then shows each byte as exactly two hex digits. For basic English that is one group per character, matching the ASCII table: H is decimal 72, and 72 is 48 in hex. Beyond ASCII the byte count grows, because UTF-8 is variable length: é takes 2 bytes, most Chinese characters take 3, and emoji take 4. One visible character does not guarantee one hex pair.

Two digits per byte is the property that makes hex the lingua franca of byte-level work. One byte spans 0 to 255, and 255 is FF, exactly two hex digits. Every byte therefore has a fixed-width, compact representation, which is why hex editors show 16 bytes per line so cleanly and why protocol documentation quotes payload bytes in hex without ambiguity.

Where You Already Use Hex Every Day

CSS colors are hex bytes wearing a costume. The color #48656C is three bytes, 72, 101, 108, the values of H, e, and l, rendered as a muted blue-gray. Memory addresses in debuggers, register values in CPU manuals, MAC addresses in network settings, and hash digests from cryptographic tools are all hex by convention. Learning to read hex pairs is a small investment that pays out across all of those domains at once.

Text arrives in hex most often when bytes matter more than characters: a packet capture showing payload bytes, a hex dump of a file header, an error log quoting a protocol message. Converting your expected text to hex with this tool gives you the pattern to search for in those dumps, byte for byte. Network engineers do this constantly when checking whether a payload contains ASCII data or binary framing, and whether byte order matches expectations.

How to Use This Tool (Step by Step)

  1. Type or paste your text into the input box. The hex output updates live with every keystroke; there is no convert button.
  2. Read the output as space-separated two-digit pairs, one pair per UTF-8 byte. Multi-byte characters produce more pairs.
  3. Use the copy button to take the result into code, search boxes in hex editors, or homework.
  4. If an error message appears, it explains what could not be processed rather than failing silently.
  5. To reverse the process, paste the pairs into the companion hex-to-text tool; the original characters return exactly, emoji included.

Worked Examples Worth Studying

Each row is a conversion you can verify by hand using the weights 16 and 1 per hex digit.

Input textBytes (decimal)Hex output
Hi72, 10548 69
Hello72, 101, 108, 108, 11148 65 6C 6C 6F
space3220
OK!79, 75, 334F 4B 21
€226, 130, 172E2 82 AC
中228, 184, 173E4 B8 AD

The € row is a favorite teaching example: one currency symbol, three bytes, because UTF-8 assigns it to the three-byte range. The last row makes the point for Chinese text. Count pairs, not characters, when size matters; five pairs is always five bytes no matter how many characters produced them.

How the Conversion Works Internally

Step one: the browser's TextEncoder converts your string into UTF-8 bytes, an array of numbers 0 to 255. Step two: each number converts to base 16. Take 105, the letter i: 105 divided by 16 is 6 remainder 9, so the hex digits are 6 and 9, written 69. Take 172: 172 divided by 16 is 10 remainder 12, and 10 is A while 12 is C, so the digits are AC. Step three: every value is padded to two digits, so 33, the exclamation mark, renders as 21 and stays a clean pair.

The padding matters for alignment. Without fixed width, a stream like 48656C could split in several plausible ways; with two digits per byte, the reverse decoder always knows exactly where each byte begins. That fixed-width property, more than compactness, is why hex won as the byte-level notation.

Common Use Cases

  • Searching hex dumps: convert the text you expect to find, then search for its hex pattern in a hex editor or packet capture.
  • Protocol debugging: compare the hex of your intended header or payload against what the wire captured, byte by byte.
  • Encoding verification: paste suspect text and see immediately whether a character took 1, 2, 3, or 4 bytes, which explains length mismatches between systems.
  • Color and design work: understanding that #48656C is literally three bytes makes the connection between text, numbers, and rendered colors concrete.
  • Teaching and homework: converting your own name to hex pairs is the fastest way to make the ASCII table stick.

Hex Compared with Binary, Decimal, and Octal Text

All four notations describe the same bytes; they differ in compactness and audience. Binary shows every bit but runs eight characters per byte, best for studying individual flags. Decimal matches ASCII tables and textbook exercises, with variable-width numbers. Octal, three digits per byte, lives in C escapes and old Unix tools. Hex, two digits per byte, is the professional default: shortest fixed-width form, aligned with bytes and machine words, and understood by every hex editor and debugger you will ever open.

The same bytes of Hi appear as 48 69 in hex, 110 151 in octal, and 72 105 in decimal. If you need those forms, the site has dedicated converters running the identical UTF-8 pipeline, so outputs agree byte for byte across tools.

Tips and Best Practices

  • Round-trip your work: paste the output into hex-to-text and confirm the original string returns before relying on it.
  • Count pairs to measure size; the pair count equals the UTF-8 byte count, which is what file sizes and buffer limits actually measure.
  • When searching a hex dump, paste the pairs without spaces if the dump is unspaced, or with spaces to match formatted views; either way the byte order is the thing to verify.
  • Watch case when copying into case-sensitive contexts: 6C and 6c are the same value, but some search boxes and pattern matchers care.
  • For long documents, convert a sample first to check byte counts and encoding assumptions; giant inputs render slower with no extra insight per byte.
  • Treat hex as notation, not protection: anyone can decode it, so never use hex encoding to hide sensitive text.

Frequently Asked Questions

How do I convert text to hex by hand?
Look up each character's byte value, then convert that number to base 16. Capital H is decimal 72, and 72 divided by 16 is 4 remainder 8, so the hex digits are 4 and 8: 48. Lowercase i is 105, which is 6 times 16 plus 9, so 69. Hi becomes 48 69. For values above 15, digits 10 through 15 are written A through F, so 172 becomes AC. Pad every byte to two digits, since one byte always fits in exactly two hex characters.
What is the hex value of Hi?
Hi is 48 69 in hex. Capital H is byte 72 decimal, which is 48 in base 16, and lowercase i is 105 decimal, which is 69. Each pair is two digits because one byte spans 0 to 255 and 255 is FF, the maximum two-digit hex value. The same bytes are 110 151 in octal and 72 105 in decimal, all views of identical data. This pair is the standard first example in textbooks and a quick sanity check for any new converter.
Why does the euro sign become three hex pairs?
Because the tool encodes text as UTF-8 first, and € takes three bytes: 226, 130, and 172 decimal, which are E2, 82, and AC in hex. One pair per byte, not per character, is the rule. Basic English letters, digits, and punctuation are one pair; accented letters and Greek take two; Chinese, Japanese, Korean, and Arabic typically take three; emoji take four. Counting pairs therefore measures bytes, which is what file sizes and protocol limits actually count.
How is text-to-hex related to CSS color codes?
Both are hex byte views. A CSS color like #48656C is three bytes written without spaces: 72, 101, and 108 decimal, which happen to be the byte values of H, e, and l. Colors use hex because two digits describe one byte exactly, the same reason hex editors and protocol dumps use it. The difference is context: colors are three specific bytes interpreted as red, green, and blue intensity, while this tool shows your text as however many bytes UTF-8 requires, one pair each.
Is hex the same as ASCII for text?
For basic English, yes: the 128 ASCII characters keep identical values in UTF-8, so 48 is H and 69 is i in any ASCII chart. The difference appears beyond ASCII, where strict ASCII tools fail while this tool shows the multi-byte UTF-8 form: é becomes C3 A9 and emoji become four pairs. There is also a formatting convention: ASCII tables usually quote decimal, 72 for H, while hex quotes base 16. Same bytes, different notation, and this tool always uses the hex view.
Can I convert the hex output back to text?
Yes, with the companion hex-to-text tool on this site. Paste the pairs there and the original characters return, including multi-byte UTF-8 characters and emoji, as long as the byte sequence is intact. Spaces and other separators between pairs are handled, and unspaced streams work too because every byte is exactly two digits wide. A quick round trip, text to hex and back, is the cheapest way to verify that a payload you are about to embed or transmit is byte-exact.

Related Tools