Spec-Correct Escaping via JSON.stringify
The Escape operation wraps native JSON.stringify, guaranteeing every required escape sequence (\n, \t, \", \\, \uXXXX) is handled exactly as the JSON RFC requires — no hand-rolling escape logic.
500+ fast, free tools. Most run in your browser only; Image & PDF tools upload files to the backend when you run them.
Escape plain text for JSON or decode escaped text
JSON Escape / Unescape on UtilityKit converts plain text into a valid JSON string value and reverses the process — entirely in your browser with no server involvement. When embedding arbitrary text inside a JSON string, double quotes must become \", newlines must become \n, tabs must become \t, and backslashes must become \\ — otherwise the parser throws a syntax error. This tool handles every sequence in the JSON spec: \" \\ \n \r \t \b \f and \uXXXX for control characters below U+001F. The Escape button wraps JSON.stringify, so output is spec-correct. Unescape reverses via JSON.parse. Common uses: embedding multiline log output in an API payload, fixing Unexpected token errors from unescaped quotes, storing SQL or HTML in a JSON field, and decoding escaped strings from webhooks.
The Escape operation wraps native JSON.stringify, guaranteeing every required escape sequence (\n, \t, \", \\, \uXXXX) is handled exactly as the JSON RFC requires — no hand-rolling escape logic.
Paste the offending string, click Escape, and copy the corrected value back into your JSON payload to resolve parser errors caused by unescaped quotes or control characters in seconds.
Log output, SQL queries, and code snippets often contain newlines and tabs. The tool escapes them to \n and \t so the entire block fits legally inside a single JSON string value.
Webhook payloads, API responses, and log lines often contain JSON strings with embedded escaped content. Paste and Unescape to read the original text without manually replacing every \n.
Escaping and unescaping happen entirely in your browser via native JavaScript. No text is sent to a server, making it safe to use with log lines that may contain credentials or PII.
Characters below U+001F — which are invisible and illegal in raw JSON strings — are automatically escaped to their \uXXXX representation, preventing silent parser failures.
Input: TypeError: Cannot read properties of undefined at app.js:42 at index.js:18
Output: TypeError: Cannot read properties of undefined\n at app.js:42\n at index.js:18
Input: He said "Hello, World!" and left.
Output: He said \"Hello, World!\" and left.
Input: Line 1\nLine 2\tTabbed\nLine 3
Output: Line 1 Line 2 Tabbed Line 3 (rendered with actual newlines and tab)