Text to Hex: How ASCII and UTF-8 Hex Encoding Works
Text to hex is a dump of numbers, not a change of letters into a secret alphabet. Each character becomes one or more bytes; those bytes (or the character’s code point) are then written in base 16. FlashKit’s text to hex converter prints Unicode code points in hex, space-separated, using JavaScript codePointAt(0).toString(16). It does not print UTF-8 bytes. That distinction is why “Hi” looks the same in both views and “₹” does not.
What a text to hex dump actually is
A character is a Unicode code point (H is U+0048). On the wire, UTF-8 turns that code point into one to four bytes. Hexadecimal is how we write those integers with digits 0–9 and a–f. Three different dumps of the same string are easy to mix up:
- Code-point hex — one token per character. FlashKit, and the sibling binary converter in base 2.
- UTF-8 byte hex — one token per byte. What
xxd,TextEncoder, and Pythonbytes.hex()emit. - UTF-16 code units — not used on this page. Surrogate pairs would split a single emoji into two tokens; FlashKit spreads the string into code points so an emoji stays one token.
ASCII letters happen to be one UTF-8 byte equal to the code point, which is why beginner examples never show the trap. “Hello World” (the converter default) is eleven tokens: 48 65 6c 6c 6f 20 57 6f 72 6c 64. Space is U+0020 → 20. That list is also valid UTF-8 byte hex because every character is ASCII. Change the first token to 49 and the text becomes “Iello World”, the same trick the binary sibling uses with 1001001.
Worked example: “Hi” → 0x48 0x69
H is Unicode U+0048. Decimal 72. 72 = 4×16 + 8, so hex 48. i is U+0069, decimal 105 = 6×16 + 9, hex 69. UTF-8 encoding of those two letters is the same two bytes. So:
- Code points (FlashKit):
48 69 - UTF-8 bytes:
48 69 - With a 0x prefix, as a C array:
0x48, 0x69
Type Hi on the left of the converter and the right box shows 48 69. Tokens are lowercase because Number.toString(16) is lowercase. There is no 0x, no colon, no \x. A homework sheet that wants eight-bit padded bytes for “Hi” is asking for 48 69 either way. A sheet that wants padded bytes for a newline wants 0a; this page prints a. Pad on the way out if the spec is two digits per byte. Decoding still accepts 0a because parseInt('0a', 16) is 10.
Convert text ↔ hex in this tab
Unicode code points, spaces between tokens. Not a UTF-8 byte dump and not a file hex editor.
Open the text to hex converter“FlashKit” — character, decimal, hex
Verified with the same toString(16) the widget uses, and with UTF-8 (they match because every letter is ASCII):
| Char | Decimal | Hex (tool) |
|---|---|---|
| F | 70 | 46 |
| l | 108 | 6c |
| a | 97 | 61 |
| s | 115 | 73 |
| h | 104 | 68 |
| K | 75 | 4b |
| i | 105 | 69 |
| t | 116 | 74 |
Full string: 46 6c 61 73 68 4b 69 74. Uppercase sheets write 4B; the tool writes 4b. parseInt accepts both on decode.
UTF-8 multi-byte: é and ₹
é is U+00E9. Code-point hex is e9 (decimal 233). UTF-8 encoding of U+00E9 is two bytes c3 a9. FlashKit prints e9. If a homework sheet wants “UTF-8 hex of é”, the answer is c3 a9, not what this page shows.
The Indian rupee sign ₹ is U+20B9. Code-point hex is 20b9. UTF-8 is three bytes e2 82 b9. “₹100” in UTF-8 is e2 82 b9 31 30 30 (the three ASCII digits 1, 0, 0). FlashKit prints 20b9 31 30 30. Percent-encoding of the UTF-8 bytes is %E2%82%B9 for the sign alone — that is a URL, not a hex dump of code points.
UTF-16 would encode ₹ as a single 16-bit code unit 20b9 (it sits in the Basic Multilingual Plane). An emoji such as U+1F600 is a surrogate pair in UTF-16 and four bytes f0 9f 98 80 in UTF-8; FlashKit still prints one token 1f600 because it uses codePointAt. There is no endianness control on this page and no BOM. If a protocol wants UTF-16LE bytes, this converter will not produce them.
| String | FlashKit (code points) | UTF-8 bytes |
|---|---|---|
| Hi | 48 69 | 48 69 |
| é | e9 | c3 a9 |
| ₹ | 20b9 | e2 82 b9 |
| ₹100 | 20b9 31 30 30 | e2 82 b9 31 30 30 |
Formats: spaced, 0x, \x, URL percent
- Spaced tokens — what FlashKit emits and accepts (
48 69). Commas also split on decode. - 0x-prefixed — C, Go, many data sheets (
0x48, 0x69). Strip 0x before pasting here. - \x escapes — C strings and Python bytes literals (
\x48\x69). Not accepted. - URL percent — UTF-8 bytes with
%(%E2%82%B9). A different encoding; this page will not decode it. - Colon-separated MAC-style —
48:69is an error here.
Newlines are code point U+000A, so the tool prints a, not 0a. toString(16) drops leading zeros. parseInt('0a', 16) still works if you pad on the way in.
Reverse: hex to text, and garbled output
Paste 48 69 on the right and the left box becomes Hi. Invalid tokens (a g, a 0x prefix, a colon) show a red error and leave the last good text in place. The classic “é” mojibake is UTF-8 bytes c3 a9 decoded as Latin-1/Windows-1252: byte C3 and byte A9 become two characters instead of é. The inverse — treating code-point e9 as if it were two UTF-8 bytes — produces a different mess. Decide which dump you have before you decode. If you have a firmware .bin or a PNG, stop: this page is not xxd, not a hex editor, and not an endianness switch. Use a desktop hex tool you control.
Code snippets: JS, Python, bash
UTF-8 bytes (not what FlashKit prints, except for ASCII):
// JavaScript — UTF-8 bytes
[...new TextEncoder().encode('₹100')]
.map(b => b.toString(16).padStart(2, '0'))
.join(' ');
// e2 82 b9 31 30 30
# Python — UTF-8 bytes
'₹100'.encode('utf-8').hex(' ')
# e2 82 b9 31 30 30
# bash
printf '%s' '₹100' | xxd -p -c 32
# e282b9313030
Code points, matching FlashKit:
[...'₹100'].map(c => c.codePointAt(0).toString(16)).join(' ');
# 20b9 31 30 30
What FlashKit actually outputs
The widget is SimpleTextConverter in hex mode: spread the string, codePointAt(0).toString(16), join with spaces. Default sample is “Hello World” → 48 65 6c 6c 6f 20 57 6f 72 6c 64. There is no UTF-8 toggle, no 0x prefix, no uppercase switch, no file picker. Sibling pages print the same points as decimal/ASCII (text to ASCII, text to decimal) or as binary (text to binary guide). If the paste looks like SGVsbG8=, that is Base64 — see the Base64 encoding guide. Very long pastes can freeze the tab; split the work. Nothing is written to localStorage. Refresh restores “Hello World.”
Same points, different base
Binary, ASCII, and decimal siblings use the same code-point algorithm. Hex is the compact form.
Open the binary converterFrequently asked questions
Does “text to hex” mean UTF-8 bytes or Unicode code points?
Both exist. UTF-8 hex of “é” is c3 a9. The code point is e9 (U+00E9). FlashKit’s converter prints code points, lowercase, no 0x, spaces between tokens — so é is e9, not c3 a9.
Why is “Hi” 48 69?
H is U+0048 (72 decimal = 4×16+8). i is U+0069 (105). Those ASCII letters are also one UTF-8 byte, so code-point hex and UTF-8 hex match for “Hi”.
Can I paste 0x48 or \x48 into FlashKit?
No. Tokens are parseInt(token, 16) after a split on spaces or commas. 0x48 and \x48 are invalid on this page. Use 48.
Why does hex-to-text look garbled?
Usually a UTF-8 byte string decoded as Latin-1 (or the reverse), or a code-point dump decoded as bytes. “é” as bytes is C3 A9; as a code point it is e9. Mixing those two is how you get é. A longer hex to text walkthrough covers that mix-up.
Is this a file hex dump?
No. There is no file picker. It is a short-string translator in this tab, the same family as the binary converter. Use a hex editor for a PNG or firmware.