Encode

Unicode Converter

Turn text into Unicode escapes, or read escapes back into plain characters. DevKitLab encodes each character to its code point and writes it as a JavaScript escape, a U+ code point, an HTML entity, or a legacy percent escape, with a per-character breakdown so you can see which code maps to which letter. The decoder is format-agnostic: paste a mix of \u, U+, and HTML entities and it restores the original text, surrogate pairs and astral emoji included. Everything runs in your browser, so source snippets and private notes never leave the page.

  • Converts both ways and decodes mixed escape formats in a single pass
  • Outputs JavaScript \u, U+ code points, HTML entities, and legacy %u from the same input
  • Handles astral characters and emoji, including UTF-16 surrogate pairs
  • Shows a per-character breakdown that pairs each letter with its escape
  • Lets you escape only non-ASCII or every character to match your target
  • Runs entirely in the browser, so nothing you paste is uploaded
tools/Unicode Converter
0 chars
The conversion result will appear here
Auto-detect
Conversion commands

Overview

A focused Unicode converter for the moment you need to read text as escape sequences, or turn an escape sequence back into the characters it stands for. It keeps the character-to-code-point mapping visible at every step, works without an install, and never sends what you paste to a server.

  1. 01

    Encode and decode in one panel

    Convert plain text into Unicode escapes and decode escapes back into characters from the same place, with no separate convert step. Pick the direction and the result, the per-character breakdown, and the decoded-sequence count all update as you type.

  2. 02

    Five escape formats

    Write each character as a JavaScript \u escape, a U+ code point, an HTML hex or decimal entity, or a legacy %u escape. The output is ready to paste into JavaScript, TypeScript, JSON, HTML markup, a specification, or a troubleshooting note without reformatting.

  3. 03

    Correct surrogate-pair handling

    JavaScript and percent escapes operate on UTF-16 code units, so an astral character such as an emoji becomes the right high-and-low surrogate pair and decodes back to one character instead of two broken halves.

  4. 04

    Per-character breakdown both ways

    When encoding, the breakdown pairs each character with its escape; when decoding, it pairs each escape with the character it produced and groups surrogate pairs, so you can confirm a mixed string was read exactly as intended.

  5. 05

    Format-agnostic decoder

    Paste a string that mixes \u, \u{…}, U+, %u, and HTML entities and the decoder restores them all in a single pass, recombines surrogate pairs, and leaves the ordinary text between them untouched.

  6. 06

    Choose what gets escaped

    Escape only the non-ASCII characters to keep code readable, or escape every character when a field, protocol, or older tool needs a strictly ASCII-safe string. The U+ form lists every code point, since that is how the notation is read.

  7. 07

    One-click swap and reuse

    Send the current result back into the input and flip the direction, turning an encode-then-decode round-trip check into a single click.

  8. 08

    Local-only processing

    Encoding, decoding, and the breakdown all run in your browser. Source snippets, log lines, and private text stay on your device and are never uploaded.

How to use

Paste your text, choose how it should be written, and copy the result. Everything recalculates as you type, so there is no separate convert button to press.

  1. 01

    Type or paste text into the input to encode it, or paste a string of Unicode escapes you want to decode.

  2. 02

    Set the direction to Encode to turn text into escapes, or Decode to turn escapes back into characters.

  3. 03

    When encoding, choose the output format: JavaScript \u, U+ code points, HTML hex or decimal entities, or legacy %u.

  4. 04

    Decide whether to escape only non-ASCII characters or every character; when decoding, every format is detected automatically.

  5. 05

    Switch to the breakdown view to check the per-character mapping, then copy the output or swap it back into the input.

Details

Which settings fit depends on where the result is headed and what you are reading. A few notes on when each format and option earns its place.

  • JavaScript \u escapes paste straight into JS, TypeScript, and JSON string literals and keep a source file plain ASCII.
  • The \u{…} code-point escape and U+ notation both name a single code point, which is how characters are listed in the Unicode charts and specifications.
  • HTML hex and decimal entities, also called numeric character references, render a symbol or emoji in markup without saving a non-ASCII file.
  • Legacy %u escapes match the output of older escape and unescape routines you may still need to read or reproduce.
  • Non-ASCII scope keeps ordinary letters readable and escapes only accented, CJK, and symbol characters; full scope produces an entirely ASCII-safe string.
  • The decoder is deliberately forgiving, so a value that mixes several escape styles still comes back as the original text.
  • The breakdown is the quickest way to explain code points, surrogate pairs, and multibyte characters to someone learning Unicode.
  • Swap makes a fast round-trip check: encode, swap, and confirm the original text returns unchanged.

Use cases

Unicode escape work tends to show up in coding, troubleshooting, and content cleanup, where a visible mapping from characters to code points beats guessing at what a string contains.

  1. Embedding text in source code

    Turn accented, CJK, or emoji strings into \u escapes so a source file stays plain ASCII and survives any editor, terminal, or build pipeline that might mangle raw Unicode.

  2. Investigating mojibake and encoding issues

    Reveal the exact code points behind a string to track down mojibake, look-alike characters, and invisible control codes that quietly break comparisons.

  3. Reading code points from specs

    Convert a U+ value from a Unicode chart or a specification into the actual character, then encode it back to confirm you have the right one.

  4. Writing HTML entities

    Produce numeric HTML entities for symbols, currency signs, and emoji so markup renders correctly regardless of the file character encoding.

  5. Decoding logs, JSON, and config

    Paste escaped strings copied from log lines, JSON responses, or config files and read them back as the characters they actually represent.

  6. Teaching character encoding

    Show a class or a teammate the live mapping from characters to code points and escapes, with surrogate-pair and emoji examples ready to hand.

  7. Cleaning up copied text

    Inspect each code point to find and replace zero-width spaces, smart quotes, and look-alike characters that slipped into a string from a copy and paste.

  8. Preparing data for other systems

    Generate ASCII-safe escapes for fields, URLs, and protocols that mishandle raw Unicode before you hand the data off.

See also

This tool works at the code-point level; when you need the underlying UTF-8 bytes instead of escapes, the Text to Binary shows each character as binary or hex bytes. For named and numeric HTML entities specifically, HTML Encoder and Decoder covers the markup side, and for percent-encoding meant for addresses, URL Encoder and Decoder handles URLs and query values. Before encoding, when you just need to measure the input, Text Counter reports characters, words, and code-point counts.

Best practices

Conversion stays exact when the format matches the destination and the data. A few habits keep encode and decode fully reversible.

  • Match the format to where the text is going: \u for source code, numeric entities for markup, and U+ for documentation or notes.
  • Use non-ASCII scope for code so plain letters stay readable and only the characters that truly need escaping change.
  • Reach for full-character scope only when a target genuinely requires a strictly ASCII-safe string, since it makes the output much longer.
  • Remember that \u and %u count UTF-16 code units, so a single emoji appears as two escapes rather than one.
  • Use the breakdown to confirm surrogate pairs and multibyte characters encoded as expected before you copy.
  • Run a round-trip with Swap: encode, swap, and check that the original text comes back without any changes.
  • Clear the panel when you finish with sensitive text; local processing keeps data on your device, but the input stays until you remove it.

Limitations

Unicode escaping is a way to write characters, not a way to hide or protect them. A few limits are worth keeping in mind.

  • Converting text to escapes is encoding, not encryption — anyone can decode it back, so it protects nothing.
  • JavaScript and percent escapes are UTF-16, so any character above U+FFFF is written as a two-unit surrogate pair.
  • The decoder accepts code points up to U+10FFFF; tokens outside that valid range are left in place unchanged rather than guessed at.
  • This tool works with code points and escapes, not UTF-8 byte sequences, so reach for the binary converter when you need raw bytes.
  • Decoding is format-agnostic, so a literal string that happens to look like an escape will also be converted.
  • The per-character breakdown is capped for very long input to keep the page responsive, while the full stream output is still produced.

FAQ

Common questions about escape formats, surrogate pairs, the format-agnostic decoder, escaping scope, and how Unicode escaping differs from UTF-8.

How do I convert text to Unicode escapes?

Type or paste your text into the input, set the direction to Encode, and pick a format such as JavaScript \u or U+ code points. The tool escapes each character as you type. By default only non-ASCII characters are escaped; switch the scope to escape every character.

How do I decode Unicode escapes back to text?

Set the direction to Decode and paste the escaped string. The decoder recognizes \u, \u{…}, U+, %u, and HTML entities in the same input and recombines surrogate pairs, so you can paste a mix of formats and still get the original characters back.

What is the difference between \uXXXX and U+XXXX?

Both name a code point. \uXXXX is a JavaScript escape that uses UTF-16 code units, so an astral character becomes a surrogate pair, while U+XXXX is the standard notation for a single code point used in the Unicode charts, specifications, and documentation.

How are emoji and astral characters handled?

For \u and %u an emoji is written as a UTF-16 surrogate pair, since those formats work on code units. For \u{…}, U+, and HTML entities it appears as a single code point. Either way it round-trips back to the original character, and the decode breakdown groups the pair into one entry.

Can I decode a string that mixes several formats?

Yes. The decoder is format-agnostic: it reads \u, \u{…}, U+, %u, and numeric HTML entities together in one input, leaves any plain text between them unchanged, and reports how many escape sequences it converted.

How is this different from UTF-8 byte encoding?

This tool shows code points and escapes, not the bytes a character occupies on disk. The same character has one code point but often several UTF-8 bytes, so use the text-to-binary tool when you need the raw byte values instead of escapes.

Is escaping text a form of encryption?

No. Escapes are just another way to write the same characters, and anyone can convert them straight back. They hide nothing and should never be used to protect sensitive information.

Does my text get uploaded anywhere?

No. Encoding, decoding, and the per-character breakdown all run in your browser. Nothing you paste is sent to a server, so source snippets, log lines, and private text stay on your device.

Related tools

Keep exploring byte-level conversion, HTML entities, and text measurement without leaving the tools collection.