Text to Hexadecimal Converter
Converts text to hexadecimal by encoding it as UTF-8 bytes and writing each byte as two hex digits, so é becomes C3 A9 rather than its code point E9. Bytes can be separated by spaces, colons, dashes, or 0x prefixes in either case; decoding strips those separators, rejects an odd digit count, and flags bytes that are not valid UTF-8.
This tool sends nothing over the network. Everything you enter is processed on your device and never reaches our servers.
Documentation
A text to hexadecimal converter shows the bytes behind a piece of text, each byte written as two base-16 digits drawn from 0 to 9 and A to F. One hex digit holds four bits, so a pair covers exactly one 8-bit byte, and the range 00 to FF spans all 256 byte values. Hex is a view of the data, not a cipher: it is how debuggers, packet analyzers, and file inspectors display raw bytes.
Which bytes appear depends on the character encoding. UTF-8, the default, writes an ASCII character as one byte equal to its code (A is 41, a space is 20) and every other character as two to four bytes: é is C3 A9 and the rocket emoji is F0 9F 9A 80. ISO-8859-1 writes each character from 0 to 255 as a single byte, so é becomes E9, and ASCII stops at 7F. A character outside the chosen encoding becomes 3F, the question mark, and is listed beside the result. The byte count is the number of bytes, which exceeds the character count whenever UTF-8 needs more than one byte for a character.
Each byte value is divided by 16: the quotient is the first digit and the remainder the second, so the byte 233 (é in ISO-8859-1) is 14 remainder 9, written E9. Settings holds the separator between bytes (a space, a colon as in MAC addresses and certificate fingerprints, a dash, a 0x prefix as in C and JavaScript literals, or none), uppercase or lowercase digits, and the character encoding. Case carries no meaning; C3 and c3 are the same byte.
Decoding strips spaces, colons, dashes, commas, and 0x prefixes, then reads the remaining digits in pairs. An odd number of digits or a character outside 0 to 9 and A to F stops the decode with an error rather than guessing where a byte boundary was lost. Bytes that do not form valid UTF-8 decode with replacement characters and a warning, which usually means the hex came from binary data or from text in another encoding; ISO-8859-1 reads every byte as exactly one character instead. The converter reads typed or pasted text only, not files.
The text Hi! is the bytes 72, 105, and 33. Dividing each by 16 gives 4 remainder 8, 6 remainder 9, and 2 remainder 1, so the hex is 48 69 21, written 48:69:21 or 0x48 0x69 0x21 with the other separators. In café the final é is stored by UTF-8 as the bytes 195 and 169: 195 is 12 remainder 3 (C3) and 169 is 10 remainder 9 (A9), so café becomes 63 61 66 C3 A9, five bytes for four characters.
Hexadecimal is how raw bytes are displayed in networking, programming, and data forensics, and converting between text and hex answers a recurring question: which bytes does this string really contain?
- Network Debugging: Packet analyzers such as Wireshark can copy a payload as a continuous hex stream; decoding that stream shows the HTTP header, DNS name, or protocol message it carries, and encoding a test string gives the bytes to look for in a capture.
- Programming: Byte literals in C, Python, Java, and JavaScript use 0x-prefixed hex. The 0x option produces those values ready to be comma-separated in an array initializer, and the byte count gives the array length.
- Serial Communication: Commands for devices on RS-232, UART, or SPI links are often specified in a datasheet as hex bytes. Encoding the ASCII part of a command shows which bytes the device should receive, with a typed line break appearing as 0A.
- Cryptography: Hash digests, keys, and initialization vectors are usually published in hex. Decoding one shows whether it is printable text or random bytes, which trigger the UTF-8 warning, and encoding a passphrase shows the exact bytes a hashing tool receives.
- Database Administration: SQL Server returns binary columns as 0x-prefixed hex and PostgreSQL shows bytea values with a leading \x; with that prefix removed, decoding recovers any text stored in a binary column.
- File Analysis: File formats begin with fixed signature bytes, such as 25 50 44 46 (the text %PDF) for PDF files and 89 50 4E 47 for PNG images. Decoding the printable part of a signature makes a hex dump easier to read.
- Encoding Mismatch Diagnosis: Text that shows é where é belongs is UTF-8 read as ISO-8859-1. Encoding é under UTF-8 gives C3 A9, and in ISO-8859-1 those two bytes are the characters à and ©, which explains the garbling exactly.
- Quality Assurance: Round trips catch lossy conversions. Text encoded to hex and decoded back should match the original exactly, and a character that comes back as a question mark marks where a legacy encoding could not hold it.
Inputs, outputs, and what the Text to Hexadecimal Converter computes
What the Text to Hexadecimal Converter asks for and what it returns, as a plain list. Defaults, units, and ranges are the ones the form loads with.
Inputs
- Text to Encode
- Hexadecimal to Decode
- Hex Delimiter · default: Space (48 65 6C)
- Hex Case · default: Uppercase (4A)
- Character Encoding · default: UTF-8
- Encoded Result (copyable)
- Decoded Result (copyable)
Controls
Convert · Reset
Example
The text Hi! is the bytes 72, 105, and 33.