Developer tools

JSON String Escape & Unescape

Convert plain text into a JSON string literal or decode a quoted JSON string back into plain text.

Enter your details

Free tool

Runs in your browser. Your text is not uploaded for processing. Use trusted offline software for secrets, especially when third-party advertising or browser extensions are active.

How to use this tool

Escape uses JSON.stringify and includes the surrounding double quotes. Unescape uses JSON.parse and requires the result to be a string. It handles JSON escapes, not HTML entities, URL escapes or arbitrary JavaScript expressions. Output is displayed as plain text.

A WORKED EXAMPLE

Try these values

A real line break becomes \n inside the escaped JSON string. To unescape, include both surrounding double quotes.

Common questions

Does my input leave this page?

The tool processes its input in your browser. It does not send the text to our server for calculation. If advertising is enabled, third-party ad scripts also run on the page; use a trusted offline tool for secrets.

Can I use the result in my project?

Yes. Check the example and limitations first, and test the output with the system that will consume it.

Something doesn’t add up? Report an issue · Methods & corrections