JSON Escape / Unescape

Escape JSON to an embeddable string literal, or unescape a JSON string back to readable JSON.

What does Escape do?

Wraps your text in double quotes and escapes all special characters (", \, newlines, tabs) so the entire JSON can be safely embedded as a string value inside another JSON payload, a SQL query, or a Java/C# string literal.

Escape Example

Input JSON:

json
{"name": "Ravi Kumar", "city": "Surat"}

Escaped output (safe to embed as a string value):

"{"name": "Ravi Kumar", "city": "Surat"}"

Characters That Get Escaped

CharacterEscaped asWhy
" (double quote)\"Terminates string literals in JSON, Java, SQL
\ (backslash)\\Escape character itself must be escaped
newline (\n)\nControl characters are not valid inside JSON strings
tab (\t)\tSame — control characters must be escaped
carriage return (\r)\rWindows line endings

Common Use Cases

  • Embed JSON in SQLStore a JSON payload in a VARCHAR column — escape it first to avoid quote conflicts.
  • Java / C# stringsEmbed JSON as a String literal in source code — escaped form is copy-paste ready: String s = "{\"key\":\"val\"}".
  • Nested JSON payloadsSome APIs accept JSON-as-a-string inside another JSON field: {"body": "{"id":1}"}.
  • Debug API logsAPI logs often contain double-escaped JSON — unescape to recover the original readable payload.

Frequently Asked Questions

JSON escaping wraps a string in double quotes and replaces special characters with their escape sequences (e.g. " → \") so the string can be safely embedded inside another JSON value, SQL query or code string.

A single backslash in a JSON string is represented as \\. When your JSON contains a file path like C:\Users, the escaped form is C:\\Users. The unescape tool will convert this back to the original single backslash.

They are the same operation. JSON.stringify() in JavaScript wraps a value in quotes and escapes it — that is exactly what the Escape mode does here.

No — this tool handles JSON escape sequences only (backslash escaping). HTML entities like & or " are a separate encoding. Use an HTML decoder for those.

Related Tools