Text to Hex Converter
Type or paste text to see its bytes in hex, two digits per byte, as they would sit in a file or a network packet.
Stays in your browser; it isn’t added to the page address.
Outputa space between bytes
In hex
48 69 2C 20 63 61 66 C3 A9
8 characters, 9 bytes in UTF-8.
How this works: Method, 1 source, Checked against 1 worked example,
How this works
Method
Each character is first encoded as bytes, ASCII for plain English and UTF-8 for everything else, and each byte is written as two hex digits from 00 to FF. Hex is how editors, debuggers and network tools show raw text. Full method
Sources
How it’s tested
One worked example for this page is checked by automated tests before every release: given the inputs, the tool must show the expected answer.
Privacy
On your device. Nothing you enter or open leaves this browser. About privacy labels
Changes
- Rebuilt with 18 conversion pages, including text to binary and hex, two’s complement, IEEE 754 floating point, a bitwise calculator and Roman numerals, each with its method and a table.
- Added key facts with worked examples of converting between bases.
- Redesigned: the working shown step by step, and the same number in the other common bases under the answer.
- Fixed large numbers: values above 2^53, such as 64-bit hex, now convert exactly instead of rounding.
- First published.
How text becomes hex
Each character is first encoded as bytes, ASCII for plain English and UTF-8 for everything else, and each byte is written as two hex digits from 00 to FF. Hex is how editors, debuggers and network tools show raw text.
For “Hi!”: H = 0x48, i = 0x69, ! = 0x21, so the hex is 48 69 21. A useful pattern: capitals run from 41 (A) to 5A (Z), small letters from 61 (a) to 7A (z), and digits from 30 (0) to 39 (9), so a digit’s hex is just 3 in front of it.
In code you often need the bytes written as escapes: \x48\x69 in C or Python strings, or %48%69 in URLs. Copy the spaced form and replace the spaces with the escape you need.
character → UTF-8 bytes → two hex digits per byte
- Unicode assigns every character a code point written U+ and hex digits, such as U+00E9 for é; UTF-8 stores it as C3 A9. Source: The Unicode Standard.
Printable ASCII characters in hex
All 95 printable ASCII characters, from the space (20) to the tilde (7E).
| Hex | Character | Decimal |
|---|---|---|
| 20 | space | 32 |
| 21 | ! | 33 |
| 22 | " | 34 |
| 23 | # | 35 |
| 24 | $ | 36 |
| 25 | % | 37 |
| 26 | & | 38 |
| 27 | ' | 39 |
| 28 | ( | 40 |
| 29 | ) | 41 |
Show all 95 rowsShow fewer
| 2A | * | 42 |
| 2B | + | 43 |
| 2C | , | 44 |
| 2D | - | 45 |
| 2E | . | 46 |
| 2F | / | 47 |
| 30 | 0 | 48 |
| 31 | 1 | 49 |
| 32 | 2 | 50 |
| 33 | 3 | 51 |
| 34 | 4 | 52 |
| 35 | 5 | 53 |
| 36 | 6 | 54 |
| 37 | 7 | 55 |
| 38 | 8 | 56 |
| 39 | 9 | 57 |
| 3A | : | 58 |
| 3B | ; | 59 |
| 3C | < | 60 |
| 3D | = | 61 |
| 3E | > | 62 |
| 3F | ? | 63 |
| 40 | @ | 64 |
| 41 | A | 65 |
| 42 | B | 66 |
| 43 | C | 67 |
| 44 | D | 68 |
| 45 | E | 69 |
| 46 | F | 70 |
| 47 | G | 71 |
| 48 | H | 72 |
| 49 | I | 73 |
| 4A | J | 74 |
| 4B | K | 75 |
| 4C | L | 76 |
| 4D | M | 77 |
| 4E | N | 78 |
| 4F | O | 79 |
| 50 | P | 80 |
| 51 | Q | 81 |
| 52 | R | 82 |
| 53 | S | 83 |
| 54 | T | 84 |
| 55 | U | 85 |
| 56 | V | 86 |
| 57 | W | 87 |
| 58 | X | 88 |
| 59 | Y | 89 |
| 5A | Z | 90 |
| 5B | [ | 91 |
| 5C | \ | 92 |
| 5D | ] | 93 |
| 5E | ^ | 94 |
| 5F | _ | 95 |
| 60 | ` | 96 |
| 61 | a | 97 |
| 62 | b | 98 |
| 63 | c | 99 |
| 64 | d | 100 |
| 65 | e | 101 |
| 66 | f | 102 |
| 67 | g | 103 |
| 68 | h | 104 |
| 69 | i | 105 |
| 6A | j | 106 |
| 6B | k | 107 |
| 6C | l | 108 |
| 6D | m | 109 |
| 6E | n | 110 |
| 6F | o | 111 |
| 70 | p | 112 |
| 71 | q | 113 |
| 72 | r | 114 |
| 73 | s | 115 |
| 74 | t | 116 |
| 75 | u | 117 |
| 76 | v | 118 |
| 77 | w | 119 |
| 78 | x | 120 |
| 79 | y | 121 |
| 7A | z | 122 |
| 7B | { | 123 |
| 7C | | | 124 |
| 7D | } | 125 |
| 7E | ~ | 126 |
Frequently Asked Questions
What is “A” in hex?
Capital A is 41 in hex (65 in decimal), and small a is 61. The difference, 20 in hex, is the one bit that sets the case.
Why is my hex output longer than my text?
Every byte takes two hex digits, and characters outside ASCII take two to four bytes in UTF-8. So “é” becomes C3 A9, four hex digits for one character.
How do I get hex without spaces?
Switch the separator to None under the result. The bytes are then written as one run, such as 486921, which most tools accept as well.