🔓String Utility•Client-side only

JSON Escape / Unescape Tool

Escape and unescape JSON strings online. Handle quotes, backslashes, Unicode, newlines, and special characters directly in your browser.

💡
String Escaping vs. JSON Serialization: This utility escapes and unescapes raw character sequences (\", \\, \n, \t, \uXXXX) for embedding inside JSON string values without accidentally double-escaping your payload. To validate and serialize a complete JSON object or array, use our JSON Stringify Tool or JSON Formatter.
Accepts both quoted ("...") and unquoted escaped strings
1 lines•170 chars•170 B
100% lossless round-trip character conversion
0 lines•0 chars•0 B

Examples for Both Unescape and Escape Modes

Example 1: Unescaping a Log or API String (Unescape Mode)

Escaped Input:
{\"status\":\"ok\",\"note\":\"Line 1\nLine 2\t\u2713\"}
Unescaped Output:
{"status":"ok","note":"Line 1
Line 2	✓"}

Example 2: Escaping Multi-line Text & Paths (Escape Mode)

Raw Input:
Say "Hello" in C:\Program Files\App
Second line
Escaped Output:
Say \"Hello\" in C:\\Program Files\\App\nSecond line

RFC 8259 JSON Escape Sequences Reference

\"Double quote (U+0022)
\\Backslash (U+005C)
\nNewline / Line feed (U+000A)
\rCarriage return (U+000D)
\tHorizontal tab (U+0009)
\bBackspace (U+0008)
\fForm feed (U+000C)
\uXXXX4-digit hex Unicode point

Common JSON Escaping Errors & Solutions

1. Invalid Single-Quote Escapes (\')

In JavaScript, \' is valid inside single-quoted strings, but in JSON \' is illegal. Single quotes should never be escaped in JSON strings.

2. Unescaped Windows File Paths

A Windows path like C:\temp\new triggers errors because \t and \n are interpreted as tab and newline. Escape every backslash as \\.

3. Incomplete \uXXXX Hex Escapes

JSON does not support \xXX or variable-length \u{1F600} syntax. Every Unicode escape must have exactly four hexadecimal digits (\u00E9).

Complete Guide to Escaping & Unescaping JSON Strings

Master RFC 8259 string escape rules, Unicode hex sequences, and nested JSON string decoding in your browser.

How to Unescape and Escape JSON Strings Online

When working with nested webhooks, cloud logging platforms (CloudWatch, Datadog), or serialized database fields, JSON objects are frequently stored inside string values with every quote and newline escaped with backslashes.

Our free online JSON Escape & Unescape tool lets you cleanly decode escaped strings or prepare raw multi-line text for safe inclusion inside JSON payloads.

  • Select "Unescape JSON" mode to convert \", \\, \n, \t, and \uXXXX sequences into clean, readable text.
  • Select "Escape JSON" mode to escape quotes, backslashes, and control characters in raw text.
  • Use "Wrap in double quotes" when you want a complete quoted JSON string literal ready to paste into code.
  • Click "Use Output as Input" at any time to verify lossless round-trip conversion.

Handling Nested JSON Strings & Special Characters

A common challenge in API development is embedding one JSON document inside a string property of another JSON document:

  • First-level escaping converts "key": "value" into \"key\": \"value\".
  • Backslashes inside existing escape sequences are doubled (\n becomes \\n) so the outer JSON parser preserves them for the inner parser.
  • After unescaping an embedded JSON string, you can pass the resulting JSON into our JSON Formatter or JSON Viewer to explore its tree hierarchy.

Frequently Asked Questions: JSON Escape & Unescape

What does it mean to unescape a JSON string?
Unescaping a JSON string converts backslash escape sequences—such as \", \\, \n, \r, \t, and \uXXXX—back into their literal characters (double quotes, backslashes, line breaks, tabs, and Unicode symbols). This is especially useful when inspecting stringified JSON payloads from logs or database fields.
What is the difference between escaping a JSON string and serializing a JSON object?
Escaping a string takes raw text (or a serialized JSON snippet) and escapes special characters so it can safely sit inside a JSON string property without breaking syntax. Serializing a JSON object (via JSON.stringify) takes a structured object or array and formats the entire data structure into valid JSON.
Does this tool prevent accidental double-escaping or double-unescaping?
Yes. Our scanner parses escape tokens in a single deterministic pass. For example, when unescaping "\\n" (an escaped backslash followed by the letter n), it accurately produces "\n" rather than turning it into a line break.
How are emojis and Unicode surrogate pairs handled?
In Unescape mode, 4-digit hex sequences (\uXXXX) and UTF-16 surrogate pairs (such as \uD83C\uDF0D for 🌍) are automatically decoded into readable UTF-8 characters. In Escape mode, you can keep UTF-8 characters intact or check "Escape non-ASCII (\uXXXX)" to convert them into ASCII-safe hex escapes.
Is my data private when using this JSON Escape & Unescape tool?
Yes, 100%. All string escaping and unescaping happens locally inside your web browser. No data is ever sent to a backend server or external API.