String to Hex & Hex to String
Convert text to hexadecimal notation or decode hex back to readable text. Supports UTF-8.
Common Hex Values
200a09004161307fAbout This Tool
This tool converts plain text to hexadecimal notation and vice versa. Each character is represented by its UTF-8 byte value in hex. Hexadecimal is base-16 (digits 0 to 9 and A to F) and is the standard representation used in cryptography, debugging, network protocols, and binary data inspection. The tool handles full UTF-8 input including emoji and international characters, multi-byte characters produce multiple hex pairs.
How to Use
- Select Text → Hex or Hex → Text conversion direction.
- Type or paste your input into the text field.
- The converted output appears instantly below.
- Toggle the separator option to display hex pairs with spaces, colons, or no separator.
Common Use Cases
- Converting a color hex code to decimal RGB. A CSS color like
#3B82F6is three hex byte pairs:3B(red),82(green),F6(blue). Paste just the pairs into Hex to Text mode won't give you RGB directly since this tool converts hex to readable text, but the same byte-pair logic applies when you manually convert each pair,3B= 59,82= 130,F6= 246, givingrgb(59, 130, 246). - Inspecting the raw byte values of a file's magic number. Every file format starts with a signature, for example a PNG always begins with the bytes
89 50 4E 47. If you have those bytes copied from a hex editor, paste them into Hex to Text to confirm what they decode to, or use them as a reference when writing a file-type detector. - Debugging a raw network packet or serial data dump. Packet captures and embedded device logs often show payloads only in hex. Pasting a hex dump here converts it straight to readable ASCII/UTF-8, making it much faster to spot a recognizable string, header, or command inside the raw bytes.
- Verifying a hash or key was copied correctly. Cryptographic output like SHA-256 digests and API keys are usually displayed in hex. Converting a suspect value back and forth, or comparing byte counts, is a quick sanity check that no characters were dropped during copy-paste.
- Encoding a short string to embed in firmware or a config file that expects hex literals. Enable the 0x prefix option to produce values like
0x48 0x65 0x6C 0x6C 0x6F, ready to paste directly into C-style source code or a hex-based configuration field.
Hex vs Decimal vs Binary
The same byte can be written three common ways. Binary (base-2) shows the raw bits directly, for example the letter 'A' is 01000001, which is exact but tedious to read for anything longer than a few bytes. Decimal (base-10) is the everyday number system and shows 'A' as 65, easy to read but it does not map cleanly onto byte boundaries, a single byte can be any value from 0 to 255, an awkward range in decimal. Hexadecimal (base-16) is the compromise engineers settled on: exactly two hex digits represent exactly one byte (0 to FF covers 0 to 255), and it is far more compact than binary while staying easy to convert mentally in groups of 4 bits (a "nibble"). This is why hashes, memory addresses, color codes, and MAC addresses are shown in hex rather than decimal or binary, it is the most information-dense format that still maps predictably onto byte and nibble boundaries.
Troubleshooting
- Hex to Text throws "Hex string must have an even number of characters". Every byte needs exactly two hex digits. A stray extra character, a copy-paste that cut off mid-pair, or mixing in a non-hex letter will throw off the count. Recount the string in pairs, or re-copy the source value.
- The decoded text shows replacement characters or looks wrong. If the hex bytes do not form a valid UTF-8 sequence, decoding will produce garbled or replacement characters instead of readable text. This is common when hex represents non-text binary data (like an image chunk) rather than an encoded string.
- Auto-detect keeps treating my short text as hex. Very short inputs made only of the letters a to f and digits 0 to 9 (for example "face" or "0123") are ambiguous, they look like valid hex even though they were meant as plain text. Use the explicit Text to Hex button instead of relying on auto-detect for such inputs.
- Toggling the separator or 0x prefix option didn't change existing output. The display options only apply the next time you click Text to Hex, they do not retroactively reformat output already shown. Click the conversion button again after changing an option.
Frequently Asked Questions
Why do some characters produce more than 2 hex digits?
Characters outside the basic ASCII range (0 to 127) are encoded as multiple bytes in UTF-8. For example, the euro sign € becomes the 3-byte sequence E2 82 AC. Emoji and CJK characters can be 3 to 4 bytes.
What is hex used for in security?
Hex is the standard display format for cryptographic hashes (SHA-256 digests), encryption keys, certificate fingerprints, and raw bytes in network packet captures. When tools say a hash is "64 characters", they mean 64 hex digits = 32 bytes = 256 bits.
Is 0x prefix required?
No. The 0x prefix is a convention used in source code (C, Python, JavaScript) to indicate a hexadecimal literal. This tool works with plain hex strings like 48 65 6C 6C 6F without any prefix.
How many bytes does a hex string represent?
Divide the number of hex characters by two, ignoring any spaces, colons, or 0x prefixes. A 64-character hex string is 32 bytes, a 40-character hex string (like a SHA-1 digest or an Ethereum address without the 0x prefix) is 20 bytes.
Can this tool convert hex directly to decimal RGB values?
This tool converts hex to UTF-8 text rather than to numeric decimal values, so for a color code you would split the hex into its three byte pairs and convert each pair to decimal separately (for example FF = 255). It's best suited for text and byte-level conversions rather than direct color math.