JSON Escape / Unescape — Free Online
Escape any string into a valid JSON string literal, or unescape a JSON string back to plain text. Handles \n, \t, \u, and quotes.
Escape any string into a valid JSON string literal, or unescape a JSON string back to plain text. Handles newlines, tabs, quotes, backslashes, and \u00XX Unicode escapes — both directions, no signup, no server upload.
Need to inspect the string inside a larger JSON document? JSON Formatter validates and pretty-prints. Want to extract just one path? JSONPath Tester.
How to Escape / Unescape JSON Strings
Pick a direction
Escape converts plain text to a JSON-string literal. Unescape converts a JSON literal back to plain text.
Paste your string
Paste plain text (escape mode) or a quoted/escaped string (unescape mode) into the input.
Convert and copy
Click Convert; copy the result with one click.
When Do You Need to Escape JSON Strings?
Embedding multi-line text in a JSON value: You have a SQL query, a Markdown blob, or a YAML snippet. Escape it once and paste the result into a JSON field.
Reading escaped log output: Logs often serialize errors as JSON-encoded strings — full of \\n and \\". Unescape to read them as the actual newlines and quotes.
Stringifying JSON-in-JSON: Some APIs accept a JSON document as a string field inside another JSON. Escape your inner JSON, then drop the result in.
Building shell scripts that POST JSON: Bash heredocs, Make targets, and Dockerfile RUN steps need careful escaping. Escape your payload here first.
Why Use PDFFlare for JSON Escape?
Both Directions
Escape and unescape in one tool with a dropdown. No second site needed.
Unicode Aware
Handles \u00XX escapes both directions. Your é round-trips cleanly.
100% Browser-Based
Your strings stay on your device. Safe for tokens, secrets, or anything sensitive.
No Signup Required
Open, paste, click. Zero friction.
Frequently Asked Questions About JSON Escape
It wraps your string in double quotes and converts characters that have special meaning in JSON (newlines, tabs, quotes, backslashes, control characters) into their escape-sequence equivalents — \n, \t, \", \\, \u00XX. The result is a valid JSON string literal.
The reverse: takes a quoted-and-escaped JSON string and produces the plain text it represents. \n becomes a real newline; \" becomes a quote character.
Embedding strings inside JSON-in-JSON payloads, building API request bodies in code, generating test fixtures, debugging escaped log lines, or pasting multi-line content into a single-line JSON value.
Yes — both directions. \u00E9 round-trips to é, and the escape mode produces \u00XX for any character outside the printable ASCII range.
Yes. The escape uses JSON.stringify under the hood, so every control character (0x00 through 0x1F) becomes either a named escape (\b, \f, \n, \r, \t) or a generic \u00XX.
Unescape returns a clear error pointing to what's wrong (unterminated escape, bad \u sequence, etc.). The tool won't silently produce garbage output.
No. Escape and unescape both run entirely in your browser — your strings stay on your device.
This tool gives you a clean two-pane comparison and a status bar with byte counts so you can verify the round-trip — useful when escapes interact with size limits (e.g. URL or query params).