I Help You

JSON Escape / Unescape

Escape special characters in JSON strings or unescape them. Free, and it runs entirely in your browser — nothing you enter is uploaded.

How to use the JSON Escape / Unescape

1. Select Escape to convert a raw string into a JSON-safe string, or Unescape to reverse it.

2. Paste your text in the left panel — the result appears instantly on the right.

3. The escaped output includes surrounding quotes, ready to embed in a JSON document.

What is it?

JSON strings must escape certain characters that have special meaning or would break the JSON syntax: double quotes become \", backslashes become \\, newlines become \n, tabs become \t, and carriage returns become \r. Without proper escaping, embedding multi-line text or code snippets inside a JSON value causes parse errors.

This is commonly needed when embedding SQL queries, code snippets, file paths (Windows), or user-generated content inside JSON configuration files, API request bodies, or log entries. The unescape direction is useful when reading escaped strings from raw JSON.

Example

Raw String (with special characters)
Hello "World"
New line	Tabbed
↓
JSON-Escaped String
"Hello \"World\"\nNew line\tTabbed"

Special characters become: " → \" (quote), newline → \n, tab → \t, backslash → \\

Benefits

Escape strings for safe embedding inside JSON values

Quotes, backslashes, and control characters must be escaped to produce valid JSON — the tool handles all required escaping.

Unescape double-encoded JSON strings from APIs and logs

Some APIs return JSON as an escaped string inside another JSON field — unescape to read the actual content.

Prepare user input for JSON storage without injection

Escaped output cannot break out of its JSON string context — prevents malformed JSON from user-submitted content.

Debug JSON serialization issues in your codebase

See exactly which characters are being escaped and why — essential for tracing double-escaping and serialization bugs.

Frequently asked questions

Why does the output include surrounding quotes?

A properly escaped JSON string value always includes the surrounding double-quote characters. If you're embedding the value inside an existing JSON property, remove the outer quotes: {"key": <paste without outer quotes>}.

What characters get escaped?

The following characters are escaped: double quote ("), backslash (\), newline (\n), carriage return (\r), tab (\t), and Unicode control characters (\u0000–\u001F). Regular letters and numbers are never escaped.

How is this different from URL encoding?

JSON escaping is specifically for values inside JSON strings. URL encoding (percent-encoding) encodes characters for use in URLs. The two are completely different — use the URL Encoder tool for URL encoding.