How to convert Text to Hex
Encoding text to hex is a direct, byte-for-byte translation. The text is first converted to bytes with UTF-8; each byte, a value from 0 to 255, is then written as exactly two hexadecimal digits (00 to ff). So an ASCII string of N characters becomes 2N hex digits, and multi-byte UTF-8 characters expand accordingly.
Worked example
Take the text Hi!. Each character has a byte value, written as two hex digits:
H= 72 =48i= 105 =69!= 33 =21
Joined together, Hi! is 48 69 21 in hex.
ASCII characters and their hex bytes
| Character | Hex |
|---|---|
| space | 20 |
| ! | 21 |
| " | 22 |
| # | 23 |
| $ | 24 |
| % | 25 |
| & | 26 |
| ' | 27 |
| ( | 28 |
| ) | 29 |
| * | 2a |
| + | 2b |
| , | 2c |
| - | 2d |
| . | 2e |
| / | 2f |
| 0 | 30 |
| 1 | 31 |
| 2 | 32 |
| 3 | 33 |
| 4 | 34 |
| 5 | 35 |
| 6 | 36 |
| 7 | 37 |
| 8 | 38 |
| 9 | 39 |
| : | 3a |
| ; | 3b |
| < | 3c |
| = | 3d |
| > | 3e |
| ? | 3f |
| @ | 40 |
| A | 41 |
| B | 42 |
| C | 43 |
| D | 44 |
| E | 45 |
| F | 46 |
| G | 47 |
| H | 48 |
| I | 49 |
| J | 4a |
| K | 4b |
| L | 4c |
| M | 4d |
| N | 4e |
| O | 4f |
| P | 50 |
| Q | 51 |
| R | 52 |
| S | 53 |
| T | 54 |
| U | 55 |
| V | 56 |
| W | 57 |
| X | 58 |
| Y | 59 |
| Z | 5a |
| [ | 5b |
| \ | 5c |
| ] | 5d |
| ^ | 5e |
| _ | 5f |
| ` | 60 |
| a | 61 |
| b | 62 |
| c | 63 |
| d | 64 |
| e | 65 |
| f | 66 |
| g | 67 |
| h | 68 |
| i | 69 |
| j | 6a |
| k | 6b |
| l | 6c |
| m | 6d |
| n | 6e |
| o | 6f |
| p | 70 |
| q | 71 |
| r | 72 |
| s | 73 |
| t | 74 |
| u | 75 |
| v | 76 |
| w | 77 |
| x | 78 |
| y | 79 |
| z | 7a |
| { | 7b |
| | | 7c |
| } | 7d |
| ~ | 7e |
Frequently asked questions
- How do I convert Hex back to Text?
- Use the Hex to Text converter, or just type into the matching pane above — every pane is editable and the others update to match.
- Is my data sent to a server?
- No. All encoding and decoding happens in your browser, so you can safely convert tokens, keys, or anything else sensitive.
- Does this handle non-ASCII text?
- Yes. Text is encoded as UTF-8, so accented letters, emoji, and non-Latin scripts convert correctly — the hex pane always shows you the exact bytes.