User Rating 0.0 β˜…β˜…β˜…β˜…β˜…
Total Usage 0 times
ASCII Text 0 chars
Hexadecimal 0 chars
Is this tool helpful?

Your feedback helps us improve.

β˜… β˜… β˜… β˜… β˜…

About

Character encoding errors corrupt data silently. A misinterpreted byte in a network packet, a wrong hex value in firmware, or a malformed escape sequence in a protocol payload - each produces failures that are difficult to trace after the fact. This converter performs bidirectional translation between ASCII text and its hexadecimal representation, operating on raw code point values via charCode = charCodeAt(i). It handles the full byte range 0x00 - 0xFF and extends to multi-byte Unicode. The tool parses hex input regardless of delimiter format: space-separated, colon-separated, comma-separated, or 0x-prefixed tokens.

Approximation note: values above 0xFF represent multi-byte Unicode code points, not strict single-byte ASCII. For protocol work (MQTT, SPI, UART debug logs), verify your target system's encoding assumption - UTF-8 multi-byte sequences differ from raw code point values. Pro tip: when pasting hex dumps from Wireshark or serial monitors, select the matching delimiter format before converting to avoid parse errors on mixed whitespace.

ascii to hex hex to ascii text to hexadecimal hex converter character encoding ascii table hex decoder

Formulas

The conversion from a text character to its hexadecimal representation operates on the Unicode code point of each character.

hexString = charCodeAt(i).toString(16)

For each character at index i in the input string, charCodeAt returns the decimal code point c. This integer is then converted to base-16 notation. Single-digit results are zero-padded to maintain consistent two-character width per byte.

char = String.fromCharCode(parseInt(hexPair, 16))

The reverse operation splits the hex input into valid tokens, parses each as a base-16 integer, and maps the resulting code point back to a character. Tokens are isolated by a regex pattern that handles mixed delimiters.

Where hexPair is a string of 1 - 4 hex digits (e.g., "48", "0A", "20AC"), i is the character index, and c is the decimal code point in range 0 - 65535.

Reference Data

CharDecHexDescription
NUL000Null
SOH101Start of Heading
STX202Start of Text
ETX303End of Text
EOT404End of Transmission
ENQ505Enquiry
ACK606Acknowledge
BEL707Bell / Alert
BS808Backspace
HT909Horizontal Tab
LF100ALine Feed
VT110BVertical Tab
FF120CForm Feed
CR130DCarriage Return
ESC271BEscape
SP3220Space
!3321Exclamation Mark
"3422Double Quote
#3523Hash / Number Sign
04830Digit Zero
95739Digit Nine
A6541Uppercase A
Z905AUppercase Z
a9761Lowercase a
z1227ALowercase z
~1267ETilde
DEL1277FDelete
Γ‡12880Extended: Latin C-cedilla
ΓΌ252FCExtended: Latin u-umlaut
255FFExtended: Non-breaking space (Latin-1)

Frequently Asked Questions

Standard ASCII defines code points 0 - 127. Characters in the 128 - 255 range correspond to Extended ASCII (ISO 8859-1 / Latin-1). This tool uses JavaScript's charCodeAt, which returns the UTF-16 code unit. For characters above 0xFF (e.g., the Euro sign € at 0x20AC), the hex output will be more than two digits. Be aware that in UTF-8 encoding, such characters occupy multiple bytes, so the raw hex from this tool represents the code point, not the UTF-8 byte sequence.
The parser accepts space-separated pairs (e.g., 48 65 6C 6C 6F), colon-separated (48:65:6C:6C:6F), comma-separated (48,65,6C,6C,6F), and 0x-prefixed tokens (0x48 0x65 0x6C). You can also paste a continuous hex string without delimiters (48656C6C6F), which will be split into two-character pairs. Mixed delimiter formats within a single input are supported.
Code points 0x00 - 0x1F and 0x7F are control characters (null, backspace, escape, etc.). They have no visible glyph. The tool converts them correctly to their character equivalent via String.fromCharCode, but your browser renders them as empty or as a replacement symbol. The conversion is mathematically valid - the display limitation is inherent to how control characters work.
This tool outputs the raw Unicode code point in hex. For single-byte ASCII (0x00 - 0x7F), the output matches UTF-8 exactly. For code points above 0x7F, UTF-8 encoding uses a multi-byte scheme that differs from the raw code point. For example, € is code point U+20AC but encodes as E2 82 AC in UTF-8. If you need UTF-8 byte sequences specifically, you must apply the UTF-8 encoding algorithm separately to each code point.
The converter processes inputs up to approximately 100 KB of text (roughly 100,000 characters). Beyond this threshold, the input is truncated to prevent browser tab memory issues. For typical use cases - debugging protocol payloads, encoding short messages, verifying firmware strings - this limit is more than sufficient. If you need bulk file conversion, a command-line tool like xxd or od is more appropriate.
No. The parser treats 4a and 4A identically. JavaScript's parseInt(str, 16) is case-insensitive. For the output direction (ASCII β†’ Hex), you can choose uppercase or lowercase formatting via the case toggle in the options panel. The default is uppercase, which aligns with common conventions in datasheets, RFCs, and memory dump tools.