JSON Escape / Unescape
Escape special characters in a string so it can be safely embedded inside a JSON value, or take a JSON-escaped string and convert it back to its original form. The escape operation wraps the input in JSON.stringify, properly escaping quotes, backslashes, newlines, tabs, and other control characters. Unescape does the reverse with JSON.parse.
This is useful when you need to embed a JSON document as a string value inside another JSON document (common in AWS Step Functions, API Gateway mappings, and configuration templates), or when you've received a doubly-encoded JSON string and need to unwrap it.
Everything runs locally in your browser — no data leaves your device.
By The Paper Room Editorial Team — Developer Tools
Frequently asked questions
What characters are escaped?▼
Double quotes, backslashes, newlines (\n), carriage returns (\r), tabs (\t), and other control characters (U+0000 through U+001F) are escaped. Unicode characters above U+007F are left as-is in modern JSON.
When would I need to escape JSON?▼
When embedding a JSON string inside another JSON value — for example, storing a JSON document as a string field in a database, passing JSON through a message queue, or configuring AWS Step Functions state machine definitions.
What does unescape do exactly?▼
Unescape takes a JSON-encoded string (with escape sequences like \n, \", \\) and runs JSON.parse on it to produce the original string with actual newlines, quotes, and other characters restored.