{ } JSON & DATA · ENCODER

JSON Escape / Unescape

Escape text or a whole JSON document so it can be embedded inside a JSON string — or unescape a string full of \" and \n back into readable text. Handles quotes, backslashes, control characters, emoji and Unicode exactly.

Live · Escape & unescape · \uXXXX option · Detects double-escaped strings
Tip: Swap sends the output back as input — handy for double-escaped strings.Need to check the JSON? JSON Validator →
Text or JSON to escapeRaw
Escaped JSON string
Input: 0 chars
Output: 0 chars
Escapes: 0
RFC 8259 §7 strings · 100% Client-Side
◆ ABOUT THIS TOOL

What Is JSON Escaping?

Making text safe to put between the double quotes of a JSON string.

Inside a JSON string, some characters have to be written as escape sequences: a double quote becomes \", a backslash \\, a line break \n, a tab \t, and other control characters \u0000–\u001F. Everything else — including emoji and any language — may appear as-is.

You need this whenever text goes into JSON by hand: a multi-line message in a config file, an HTML snippet in an API payload, a Windows path, or a whole JSON document stored as a string field (common in logs, queues, webhooks and Elasticsearch).

Unescape does the reverse: paste a string like "{\"user\":\"ada\",\n...}" from a log file and get the original text back, pretty-printed if it is JSON. If the result is still escaped (double-encoded), the tool tells you — click Swap to unescape again.

Escaping uses the same rules as JSON.stringify, so the output is always valid and round-trips exactly, including emoji and unpaired surrogates.

\ ESCAPES

JSON Escape Sequences

The complete list from RFC 8259 — nothing else is allowed after a backslash.

CharacterEscapedNotes
Double quote "\"Required
Backslash \\\Required — e.g. C:\\Users
Line feed\nRequired (raw line breaks are invalid)
Carriage return\rRequired
Tab\tRequired
Backspace / form feed\b / \fRequired
Other control chars U+0000–U+001F\u0000…Required
Slash /\/Optional — useful inside HTML <script>
Any Unicode character\u00e9, \ud83d\ude00Optional — emoji use a surrogate pair
◐ THREE STEPS

How to Use the JSON Escape/Unescape

Get your result in under ten seconds.

1

Pick a mode

Escape turns text into a JSON string literal; Unescape turns an escaped string back into text.

2

Paste your input

The result updates as you type. Options let you skip the surrounding quotes, escape Unicode or slashes, or minify JSON first.

3

Copy, download or swap

Copy the result, download it, or Swap to feed it back in — useful for double-escaped strings.

✓ FEATURES

Why Use the JSON Escape/Unescape on Developers Web Tools

Fast, accurate and private — built for developers.

✅

Always valid

Escaping follows JSON.stringify exactly — the output always parses back to your original text.

🔁

Both directions

Escape and unescape on one page, with Swap to chain them.

🌍

Unicode-safe

Emoji and every script are kept, or written as \uXXXX for ASCII-only systems.

🕵

Double-escape detection

Spots strings that are still escaped after one pass.

📍

Precise errors

Invalid escapes like \x or \u12 are reported with line and column.

🔒

Private

Runs entirely in your browser — safe for tokens and payloads.

FAQ

Frequently Asked Questions

When you put text into a JSON string by hand — or store an entire JSON document as a string value (for example a payload field in a log or message queue). Without escaping, quotes and line breaks in the text would break the outer JSON.

Nothing, practically: escaping text produces exactly what JSON.stringify(text) returns in JavaScript or json.dumps(text) in Python. Untick Wrap in quotes if you only want the inside of the string.

JSON allows \/ but doesn't require it. It matters when JSON is embedded in an HTML <script> tag: a literal </script> inside a string would end the script early. Escaping slashes prevents that.

A string that was escaped twice, such as "{\\\"a\\\":1}". One unescape gives another escaped string. The tool detects this and suggests Swap to unescape again.

Yes. If the input is a complete quoted JSON string, it's decoded as one. Otherwise the escapes in your text are decoded directly, and literal line breaks are kept as they are.

No. All processing happens in your browser.