The worked example, line by line
Setup: text “Hi”, direction text to hex, space-separated style.
Line 1 — look up each character. H is ASCII code 72; i is code 105.
Line 2 — convert to hexadecimal. 72 in base 16 is 48 (4 × 16 + 8); 105 is 69 (6 × 16 + 9). Each byte becomes exactly two hex digits.
Line 3 — join with spaces. The result is 48 69 — 2 bytes for a 2-character word. With the 0x style it reads 0x48 0x69; continuous, 4869.
Line 4 — check the round trip. Switch direction, paste 48 69 back, and the converter returns “Hi”. A hex string with an odd number of digits, a non-hex character, or a non-ASCII character in text mode is reported as an error instead of silently producing wrong output.
Why programmers read hex, not binary
Binary for “Hi” is 01001000 01101001 — 16 digits to read. Hex for “Hi” is 48 69 — 4 digits for the same 2 bytes, because each hex digit stands for exactly 4 bits. That is why memory dumps, color codes, hashes, and network packets are all shown in hex: it is binary, compressed to a quarter of the length, with no information lost. One byte is always two hex digits, which is also why an odd-length hex string can never be valid — a byte cannot be half a digit.
ASCII-to-hex reference
| Character | Decimal code | Hex byte | Note |
|---|
| H | 72 | 48 | First byte of the default example. |
| i | 105 | 69 | Second byte of the default example. |
| A | 65 | 41 | Uppercase letters run 65–90 (41–5A hex). |
| a | 97 | 61 | Lowercase letters run 97–122 (61–7A hex); exactly 32 above uppercase. |
| 0 | 48 | 30 | Digits run 48–57 (30–39 hex). Note: the character “0” is not the value zero. |
| (space) | 32 | 20 | The space character itself is a byte, not a separator here. |
| ! | 33 | 21 | Punctuation lives in the 33–47 and 58–64 ranges. |
| ~ | 126 | 7E | The last printable ASCII character. |
Output · formula · meaning
| Output | Formula | What it means |
|---|
| Hex for a character | ASCII code in base 16, two digits, uppercase | H (72) → 48; padding keeps every byte two digits. |
| Hex for a word | one byte per character, joined per the chosen style | “Hello” → 48 65 6C 6C 6F — 5 bytes, 10 hex digits. |
| Text from hex | each byte pair back to its ASCII code | 69 → 105 → i. |
| Byte count | hex digits ÷ 2 | 48 69 is 4 hex digits = 2 bytes. An odd digit count is an error, not a guess. |
Who uses this
- The computer science student: checks homework by hand — converts “Hello” to 48 65 6C 6C 6F and confirms the base-16 conversion before an exam.
- The web developer: reads a color or a URL-encoded byte and translates it back to its character to find a bug in an encoded string.
- The hobbyist programmer: sanity-checks a data dump, converting a suspicious byte pair back to its character to spot an off-by-one error.
- The teacher: shows a class why hex exists at all, putting binary (01001000 01101001) and hex (48 69) for “Hi” side by side on the board.
Accuracy & limitations
This converter covers printable ASCII only (codes 32–126). It does not handle accented letters, emoji, or other Unicode characters — those need UTF-8, where a character can occupy multiple bytes, and they are reported as errors here rather than silently mangled. Control characters (codes 0–31) and delete (127) are likewise excluded. Hex input must use only 0–9 and A–F (either case), in complete byte pairs; an odd-length string, a non-hex character, or an empty input is reported as an error with the problem named.
Cite this calculatorBright Side Kit. “ASCII to Hex Converter: Text to Hexadecimal Code Tool.”
brightoolbox.com, 2026.
Bright Side Kit. "ASCII to Hex Converter: Text to Hexadecimal Code Tool." https://brightoolbox.com/ascii-to-hex/ Accessed October 24, 2026.Data sources- ASCII standard (ANSI X3.4): printable characters codes 32–126; A = 65, a = 97, 0 = 48, space = 32.
- All conversions computed in-page from the stated rules: one byte per character, two uppercase hex digits per byte.
Embed this calculatorPaste this into any web page to embed the live calculator. The “Bright Side Kit” link below it must stay intact.