Skip to Text to Hex converter

Text to Hex Converter

By Muhammad Abdullah Rauf · Founder, EverydayTools.proUpdated 2026-07-05· Reviewed by EverydayTools Developer Tools Team

What does text to hex conversion do?

This Text to Hex converter encodes strings as hexadecimal in your browser with three explicit modes: **UTF-8 bytes** (standard for protocols and crypto), **Unicode code points** (U+ notation style), and **Latin-1** (legacy single-byte mapping).

Unlike basic converters that misuse `charCodeAt` for all Unicode, this tool shows per-character UTF-8 breakdown, a hex dump with ASCII gutter, and side-by-side binary and Base64 comparison. Delimiters (spaces, colons, none), prefixes (`0x`, `\x`), uppercase toggle, file upload, share URLs, and code snippets for JavaScript/Python/Go are included.

How to use Text to hex encoding guide

  1. Choose encoding mode

    Select UTF-8 bytes (default for protocols), Unicode code points, or Latin-1. Pick Text → Hex or Hex → Text direction.

  2. Enter or upload text

    Type, paste, or upload a .txt file (max 512 KB). For decode, paste hex with spaces, colons, 0x prefixes, or continuous digits.

  3. Review inspector and hex dump

    Use the character byte inspector and hex dump to verify multi-byte sequences (e.g. euro, emoji). Compare binary and Base64 in the panel below.

  4. Copy, download, or share

    Copy hex output (Ctrl+Shift+C), download as .hex/.txt, or copy a share URL (Ctrl+Shift+S) with your settings encoded.

Who uses Text to hex encoding guide?

Common real-world scenarios where this tool saves time.

Protocol and API debugging

Inspect exact UTF-8 bytes sent on the wire for JSON, HTTP, or binary protocols—verify escaping before comparing with packet captures.

Hash and digest verification

SHA-256 and MD5 digests are hex-encoded. Convert sample strings to hex here, then verify with the Hash Generator.

Reverse-engineering hex logs

Paste hex from debug logs or memory dumps; hex dump view shows offset and ASCII gutter for quick orientation.

Teaching encoding fundamentals

Byte inspector makes UTF-8 multi-byte sequences visible—useful for students learning the difference between code points and wire bytes.

Workflow guides

Step-by-step chains that connect related tools for common tasks.

Verify a hex hash input

  1. Encode your plaintext in UTF-8 byte mode and note the hex.
  2. Generate SHA-256 with Hash Generator — digest is hex by default.
  3. Compare compactness with Base64 Encoder for the same bytes.

Text to hex encoding guide examples

ASCII string

Input

Hello

Output

UTF-8: 48 65 6C 6C 6F

Each ASCII letter is one UTF-8 byte identical to its code point value.

Euro sign (UTF-8)

Input

Output

E2 82 AC (3 bytes)

UTF-8 represents U+20AC as three bytes — not a single 20AC code-unit pair.

Emoji (UTF-8 vs code point)

Input

😀

Output

UTF-8: F0 9F 98 80 · Code point: 1F600

Switch modes to see wire-format bytes vs scalar U+1F600 notation.

How text-to-hex encoding works

UTF-8 mode uses the Web API TextEncoder to produce bytes, then formats each byte as two hex digits. Decode parses hex pairs back to bytes and decodes with TextDecoder. Code-point mode uses String.codePointAt / fromCodePoint for scalar values.

Reference tables

Hex encoding modes compared

ModeHello€ (euro)Best for
UTF-8 bytes48 65 6C 6C 6FE2 82 ACProtocols, crypto, wire format
Code points48 65 6C 6C 6F20ACUnicode U+ notation, scalar values
Latin-148 65 6C 6C 6FA4 (if in range)Legacy single-byte systems

Hex vs Base64 vs binary

FormatSize ratioReadabilityTypical use
Hex2× input bytesHigh — byte-by-byteHashes, MACs, debug dumps
Base64~1.33× inputMediumEmail, JSON, data URLs
Binary1× (raw)LowLow-level bitwise work

Best practices

Use UTF-8 byte mode for network and crypto work

Protocols transmit UTF-8 bytes, not JavaScript UTF-16 code units. Code-point mode is for notation, not wire format.

Include delimiter when sharing hex manually

Space-separated pairs (48 65 6C) are easier to proofread than continuous strings (48656C).

Validate emoji and CJK with the byte inspector

Surrogate-pair bugs in naive converters split emoji into two values—UTF-8 mode shows the correct four-byte sequence.

Common mistakes to avoid

Treating UTF-16 code units as UTF-8 bytes

Switch to UTF-8 bytes mode — uses TextEncoder, not charCodeAt alone.

Odd-length hex strings on decode

Remove stray characters; use normalize or add leading zero to single-digit nibble if intentional.

Troubleshooting

Decode shows mojibake or wrong characters

Likely cause: Hex was encoded as UTF-8 bytes but decoded as Latin-1 code units, or vice versa.

Fix: Match decode mode to how the hex was produced. UTF-8 wire bytes need UTF-8 byte mode.

Euro sign decodes as three separate characters

Likely cause: Each byte E2, 82, AC was decoded as a separate Latin-1 character.

Fix: Use UTF-8 byte mode decode — three bytes form one U+20AC character.

When this tool isn't the right choice

Encoding binary files or images as hex

Large files exceed the 512 KB text upload limit. Use a dedicated binary hex dump tool or xxd locally.

URL percent-encoding (%41%42)

URL encoding uses percent-hex per byte but with % prefix rules. Use URL Encoder for query strings.

Encrypting or hashing for security

This tool converts representation—it does not hash or encrypt. Use Hash Generator or proper crypto libraries.

What to do next

Continue the workflow with the right follow-up tool.

Frequently Asked Questions

What is the difference between UTF-8 hex and Unicode code point hex?

UTF-8 hex shows the actual bytes transmitted on the network—€ is E2 82 AC (three bytes). Code point hex shows the scalar value U+20AC as 20AC (one value). Both are valid; choose based on whether you need wire bytes or Unicode notation.

How does this differ from charCodeAt hex converters?

Naive converters use charCodeAt(0), which returns UTF-16 code units. Emoji and supplementary characters split into two values (D83D DE00). This tool uses TextEncoder for UTF-8 bytes and codePointAt for scalar mode—matching developer expectations.

What hex formats can I paste for decode?

Space-separated (48 65 6C), continuous (48656C6C6F), colon-separated, 0x prefixes (0x48 0x65), or C-style (\x48\x65). Invalid characters and odd-length byte strings show a clear error.

What is the difference between hex and Base64?

Hex uses 2 characters per byte (100% overhead). Base64 uses ~33% overhead. Hex is easier to debug byte-by-byte; Base64 is more compact for large data. This tool shows both for the same UTF-8 bytes.

Is my text uploaded to a server?

No. Conversion uses TextEncoder, TextDecoder, and local string parsing in your browser. Share URLs encode settings in the query string only.

Does uppercase vs lowercase matter?

Hex digits A–F and a–f are equivalent. Toggle uppercase for convention (many specs use uppercase for hashes and MAC addresses).

Privacy, accuracy, and trust

Privacy

All encoding runs in your browser via TextEncoder/TextDecoder. Inputs are not uploaded to EverydayTools servers.

Accuracy

UTF-8 output matches TextEncoder byte-for-byte in supported browsers.

Advertisement

Reviewed by EverydayTools Developer Tools Team on 2026-07-05.

Same workflow or intent — pick the next step without leaving the site.

Frequently opened tools from the same category.

People also use

Cross-category tools others open in the same session.

Continue learning

Guides and walkthroughs that reference this tool.

Explore categories

Browse full tool collections by topic.