Hex Converter
Runs 100% in your browserConvert text to UTF-8 or Latin-1 hexadecimal bytes and decode hex back to text — configurable separators, 0x prefix, uppercase or lowercase, byte preview, strict validation, round-trip check, local file input, and private browser-only processing.
Convert text and hexadecimal bytes
Encode readable text as UTF-8 or Latin-1 hex bytes, or decode a hex string back to text with format controls, strict validation, byte preview, and round-trip verification.
Text input
Conversion settings
Hex output
Byte preview
Index · hex · decimal · charNothing to preview yet.
Conversion notes
Encoding and diagnostic detailsText and hex conversion uses browser-native TextEncoder, TextDecoder, and FileReader only. Input is not uploaded, stored in localStorage or sessionStorage, or treated as encryption. Session history disappears when the page closes.
Recent conversions
Recent conversions disappear when this page closes.
Frequently asked questions
A Hex Converter changes readable text into hexadecimal byte values or decodes hexadecimal byte values back into text. It is useful for inspecting UTF-8 data, ASCII strings, byte sequences, logs, API payloads, debugging output, and small binary representations.
Choose Text to Hex, paste your text, select UTF-8 or Latin-1, choose the letter case and byte separator, and click Convert. The output represents each input byte as two hexadecimal digits — for example `Hello` becomes `48 65 6C 6C 6F`.
Choose Hex to Text, paste a hex string such as `48 65 6C 6C 6F`, select the matching encoding, and convert. The decoder accepts spaces, line breaks, commas, colons, dashes, underscores, vertical bars, semicolons, and `0x` byte prefixes.
ASCII assigns one byte to each basic Latin character (values 00–7F), while UTF-8 encodes all Unicode text using one to four bytes per character. ASCII text produces identical byte values in UTF-8, but non-ASCII characters such as accented letters, emoji, and symbols require multiple bytes under UTF-8.
UTF-8 uses a variable-length encoding. A standard ASCII letter like `A` (U+0041) is one byte: `41`. The em dash (U+2014) is three bytes: `E2 80 94`. An emoji like 😀 (U+1F600) is four bytes: `F0 9F 98 80`. The converter reports both character count and byte count so the difference is always visible.
Yes. Select UTF-8 bytes and paste any Unicode text — emoji, Arabic, Chinese, Cyrillic, Japanese, accented Latin, mathematical symbols, or any other Unicode character. The byte count will be higher than the character count for multi-byte characters.
`0x` is a standard notation prefix that tells a reader or programming language the following digits are hexadecimal. For example `0x48` is the byte with value 72 decimal. The converter can add a `0x` prefix to every output byte and the decoder strips `0x` prefixes automatically from input.
The encoder supports five output separators: space (the default, `48 65 6C`), no separator (`48656C`), colon (`48:65:6C`), comma (`48,65,6C`), dash (`48-65-6C`), and one byte per line. Choose the format that matches the destination system or documentation style.
A byte represents values from 0 (00) to 255 (FF). Writing each byte as exactly two hexadecimal digits makes byte boundaries unambiguous. Without padding, `1` and `01` would be indistinguishable, so `00` through `FF` is the conventional two-digit canonical form.
Two hexadecimal digits represent exactly one byte. An odd number of digits leaves a half-byte — a nibble — without a partner, so the input cannot be decoded unambiguously. Add the missing digit or check that a prefix or separator was not accidentally cut during copy.
The decoder accepts whitespace, line breaks, commas, colons, semicolons, vertical bars, underscores, and dashes between bytes, as well as optional `0x` prefixes on each byte. It validates that the remaining tokens contain only hexadecimal digits and form complete byte pairs.
The converter reports each invalid token explicitly instead of silently skipping it. It shows Review or Invalid status, counts the invalid bytes, and does not present a misleading decoded string. Check the error message and byte preview to locate the problem.
Yes, when the dump contains only hexadecimal byte values without address columns or ASCII annotations. Remove metadata and offset columns first, or select only the hex byte column. The converter is not a full hex editor or binary protocol decoder.
Yes. Open local file uses the browser FileReader API to read a selected `.txt`, `.hex`, `.bin`, or compatible text file and places its contents in the input. The file is never uploaded to a server. Very large binary files may use substantial browser memory; use the tool for focused byte-level inspection.
Yes. The byte preview lists the index, uppercase hex value, decimal value, and a printable character representation for up to 80 bytes. Control bytes are shown as safe labels (`\n`, `\t`, `\0`) and non-printable bytes as a middle dot rather than interpreted as HTML.
No. Hexadecimal is a reversible representation of bytes. Anyone who can read a hex string can decode it without a key. Use authenticated encryption and secure transport when data confidentiality or integrity is required. The converter explicitly notes this on every conversion.
Yes. All conversion uses browser-native TextEncoder, TextDecoder, FileReader, and in-memory JavaScript only. Input is never uploaded to a server, stored in localStorage or sessionStorage, or passed to a conversion API. Session history disappears when the page is closed.
Yes. Copy output places the result on the clipboard. Download .txt saves a local text file. Use output as input switches direction and loads the output as the new input for a quick round-trip check. None of these actions send data to a remote service.
Use the round-trip indicator and byte preview. For Text to Hex, the converter re-decodes the generated bytes and compares the result with the original text. For Hex to Text, it re-encodes the decoded text and compares the bytes. Review appears when the re-encoded result does not match exactly.
Use Latin-1 when each input character is intended to represent exactly one byte in the range 00–FF, such as working with a legacy single-byte encoding or a byte-oriented format. Use UTF-8 for all modern Unicode text. Latin-1 silently reduces characters above byte 255 to their low byte.
No. It converts text and hexadecimal representations of text bytes and shows a limited byte preview. It does not interpret executable headers, image formats, compression, cryptographic structures, endianness, or application-specific binary protocols. Use a dedicated hex editor for those tasks.
Inspecting how strings are encoded in UTF-8, decoding hex sequences from API logs or debugger output, preparing hex literals for C, JavaScript, Python, or Java source code, verifying byte-level correctness of a text payload, checking emoji and non-ASCII encoding, and generating hex strings with 0x prefixes for configuration files or documentation.
What is Hex Converter?
What Is a Hex Converter?
A Hex Converter represents text as hexadecimal byte values, or decodes a hexadecimal byte sequence back into readable text. It is useful for inspecting UTF-8 strings, ASCII values, Unicode characters, API debugging, log analysis, byte-oriented formats, protocol traces, and small hex dumps. The safest workflow is: choose the correct encoding, validate every input digit, inspect the byte preview, run a round-trip check, and then copy or download the result for use in code or documentation.
Encoding, Byte Representation, and Format Controls
UTF-8 vs Latin-1. UTF-8 is the encoding standard for all modern text, Unicode characters, emoji, and non-Latin scripts. It encodes each character as one to four bytes depending on the code point. The em dash (—) becomes three bytes; a Japanese character becomes three bytes; an emoji such as 😀 becomes four bytes. JavaScript's character count and the UTF-8 byte count are therefore different for any string containing non-ASCII content. The converter reports both counts explicitly. Latin-1 assigns exactly one byte per character for values 00–FF, making it appropriate for legacy byte-array representations and protocols that use a single-byte charset assumption.
Separators and prefix options. The output separator controls how bytes are displayed: space-separated (48 65 6C 6C 6F) is the most readable and is the default; no separator (48656C6C6F) is used when a protocol or function accepts a continuous hex string; colon-separated (48:65:6C) is conventional in MAC addresses and certificate fingerprints; comma-separated is useful for array literals; dash-separated appears in UUID and certificate representations; one-byte-per-line gives the clearest audit trail. The optional 0x prefix matches the notation used in JavaScript, C, C++, Python byte literals, and assembly output. Two-digit padding keeps byte boundaries unambiguous and is on by default.
Case and readability. Uppercase hex (4A 6F 73 65) is conventional in dumps, certificates, and documentation. Lowercase (4a 6f 73 65) is the default in many programming languages and hash libraries. The converter lets you choose either.
Strict Validation, Byte Preview, and Round-Trip Verification
Input parsing. The decoder accepts hex with spaces, line breaks, commas, colons, dashes, underscores, vertical bars, semicolons, and 0x prefixes. After stripping separators and prefixes it validates every remaining token to contain only hexadecimal characters and form complete two-digit byte pairs. Invalid tokens, odd-length sequences, and non-hex characters are each reported explicitly rather than silently skipped or replaced with question marks.
Byte preview. The preview table shows the index, uppercase hex value, decimal value, and a safe printable representation for up to 80 bytes. Control characters are shown as \n, \t, \0 labels. Non-printable bytes are shown as a middle dot. This makes the byte content auditable without relying on the output textarea alone.
Round-trip verification. After Text to Hex, the converter re-decodes the generated bytes using the selected encoding and compares the result with the original input. After Hex to Text, it re-encodes the decoded text and compares the bytes. The round-trip indicator shows Pass when the two representations match exactly, or Review when they diverge — for example when Latin-1 was used for a string containing characters above byte 255.
No silent data loss. Strict UTF-8 decoding is enforced by default using the browser TextDecoder with the fatal:true option. If the byte sequence is not valid UTF-8, the decoder reports Invalid rather than substituting replacement characters silently. Switch to Latin-1 for byte-oriented formats that are not UTF-8 text.
Common use cases
- Converting Hello, a URL, a JSON string, or a source code sample into spaced UTF-8 hex bytes
- Decoding a hex string copied from a log, API response, debugger output, or network trace
- Inspecting how emoji, accented characters, and non-Latin Unicode text are encoded in UTF-8
- Generating comma-, colon-, dash-, or newline-separated hex for a target format
- Adding 0x prefixes for JavaScript, C, C++, Python, Java, or assembly hex literals
- Comparing byte index, hexadecimal, decimal, and printable values in the byte preview
- Checking odd-length hex, invalid characters, malformed tokens, or invalid UTF-8 sequences
- Opening a small local text or hex file without uploading it to any server
- Verifying a text-to-hex-to-text round trip before embedding a byte sequence in code or documentation
Why use ToolsSonic's Hex Converter?
ToolsSonic's Hex Converter addresses every gap observed in the five leading public hex tools. RapidTables supports broad multi-base conversion but keeps text-to-hex and hex-to-text on separate pages and mixes encoding formats without byte-level diagnostics. Browserling is deliberately minimal and splits both directions into separate tools. Code Beautify offers Auto mode and Save & Share but uses external URL loading that breaks the privacy model. OnlineTools explains UTF-8 clearly and states browser-local processing but lacks reverse conversion, explicit per-token validation, a round-trip check, and a structured byte preview. Cryptii v2 had the best pipeline model but is archived and warns it may produce incorrect results.
ToolsSonic combines the UTF-8 byte clarity and privacy-first positioning of OnlineTools with the bidirectional workflow and format controls of RapidTables in one focused workspace. Both directions are on the same page. UTF-8 and Latin-1 are selectable. Separators, prefix, case, and padding are all configurable. A per-token hex validator reports every problem explicitly. A structured byte preview shows index, hex, decimal, and printable character for each byte. A round-trip indicator verifies correctness before the result is copied or downloaded. Local file input uses FileReader without a server call. Session history holds the six most recent conversions in memory and clears when the page closes. The conversion note on every result states that hex is a reversible representation, not encryption.
How ToolsSonic Beats Every Hex Converter Competitor
| Feature | RapidTables | Browserling | Code Beautify | OnlineTools | ToolsSonic |
|---|---|---|---|---|---|
| Both directions in one page | — | — | — | — | ✅ Text → Hex + Hex → Text tabs |
| UTF-8 byte semantics | ⚠️ Partial | ✅ | ⚠️ Partial | ✅ Explicit | ✅ Explicit + Latin-1 option |
| Configurable separator | ✅ space/comma/none/custom | — | — | ✅ space/none/prefix | ✅ space/none/colon/comma/dash/per-line |
| 0x prefix toggle | ✅ | — | — | ✅ | ✅ |
| Uppercase / lowercase | — | — | — | — | ✅ |
| Per-token hex validation | — | — | — | — | ✅ Named errors per token |
| Odd-nibble diagnostics | — | — | — | — | ✅ |
| Byte preview (index+hex+dec+char) | — | — | — | — | ✅ First 80 bytes |
| Round-trip verification | — | — | — | — | ✅ Pass / Review indicator |
| Local file input (no upload) | ✅ Upload | — | ✅ Upload + URL | ✅ Import | ✅ FileReader only — never uploaded |
| Strictly local processing | ⚠️ | ✅ | ⚠️ URL loading | ✅ | ✅ All browser APIs, no fetch() |
| Session history | — | — | ✅ localStorage | — | ✅ In-memory only, auto-clears |
| Copy + Download | ✅ | ✅ | ✅ | ✅ | ✅ Copy + Download .txt + Use as input |
| Encryption disclaimer | — | — | — | — | ✅ Visible on every conversion |
| Dark mode | — | — | — | — | ✅ |
Why bidirectional tabs matter. Splitting Text-to-Hex and Hex-to-Text into separate pages — the pattern used by RapidTables, Browserling, and Code Beautify — creates friction for the most common real-world workflow: encode a string, paste it somewhere, then decode it back to verify the result. ToolsSonic keeps both directions on the same page with a single tab switch and a Use output as input button for instant round-trip checking.
Why explicit validation matters. Most converters silently strip non-hex characters or produce a truncated result when given malformed input. ToolsSonic names each invalid token, reports the count, and prevents misleading output. This is especially important when decoding hex sequences copied from logs, debuggers, or binary dump tools where trailing spaces, non-hex annotations, or cut-and-paste artifacts are common.
Hex Encoding Quick Reference
| Format | Example (Hello) | Common use |
|---|---|---|
| Space-separated | 48 65 6C 6C 6F | Hex dumps, documentation, readability |
| No separator | 48656C6C6F | Compact hex strings, hash comparisons |
| Colon-separated | 48:65:6C:6C:6F | TLS certificates, MAC addresses, SSH fingerprints |
| Comma-separated | 48,65,6C,6C,6F | Byte array literals in C, Java, Python |
| Dash-separated | 48-65-6C-6C-6F | UUID-style and some Windows certificate formats |
| One byte per line | 48656C | Step-by-step inspection, diff tools |
| With 0x prefix (space) | 0x48 0x65 0x6C 0x6C 0x6F | JavaScript, C/C++, Python 0x notation |
UTF-8 multi-byte examples. The π character (U+03C0) encodes to two bytes: CF 80. The em dash (U+2014) encodes to three bytes: E2 80 94. The 😀 emoji (U+1F600) encodes to four bytes: F0 9F 98 80. These multi-byte sequences are all valid UTF-8 and can be pasted directly into the Hex to Text tab for decoding.
Related tools
Base64 Encode
Editor's choiceEncode UTF-8 text and local files to standard or URL-safe Base64 with optional padding, line wrapping, Data URI prefixes, byte statistics, and browser-only processing.
Base64 Decode
Decode standard or URL-safe Base64 back to UTF-8 text locally. Handles Data URI prefixes, whitespace, missing padding, strict validation, malformed input errors, and readable output statistics.
URL Encoder
Editor's choiceEncode URL components, query values, path segments, form data, or complete URIs locally with UTF-8 percent encoding, + space handling, delimiter preservation, and a URL analyzer.
URL Decoder
Decode percent-encoded URLs and query strings back to readable UTF-8 text — handles %20, +, Unicode escapes, mixed encoding, malformed escape checks, and local URL analysis.
HTML Entity Encode
Editor's choiceEncode HTML-sensitive characters and Unicode text as named, decimal, or hexadecimal entities. Preview safe source, copy or download output, and keep every conversion private in your browser.
JSON Escape / Unescape
Editor's choiceEscape raw text for a JSON string or unescape JSON string content back to readable text. Handle quotes, backslashes, control characters, Unicode, line breaks, tabs, and optional slash escaping privately in your browser.