Helper-KitCode Tools

JSON Stringify & Parse

Escape JSON or text into a string you can paste inside JSON or code, or unescape a string back into readable JSON, even when escaped several times.

JSON or text to escape
Try an example:
Escaped string

More:JSON BeautifierJSON FormatterURL EncodeBase64

Stringify turns JSON or any text into a string you can paste inside JSON or code: quotes, backslashes, line breaks and tabs are escaped. Parse does the reverse. It also handles strings copied from logs that were escaped twice or more, and strings missing their outer quotes, then formats the result if it is JSON. Large numbers are kept exactly. Everything runs in your browser.

About This Tool

Stringify turns JSON, or any text, into a string literal: quotes, backslashes, line breaks and tabs are escaped, the same as JSON.stringify() in JavaScript. If the input is JSON, it is compacted first. Options let you use JavaScript single quotes and escape non-ASCII characters such as é as \u00e9. Parse does the reverse. It also handles strings copied from logs that were escaped twice or more, removing every level, adds missing outer quotes, and accepts single-quoted strings. If the result is JSON, it is shown formatted with large numbers kept exactly. "Use result as input" switches direction with one click, so you can check that a string round-trips. Everything runs in your browser.

Common Use Cases

  • Embedding a JSON payload as a string inside another JSON document
  • Reading JSON that an API or log returned as an escaped string
  • Unwrapping JSON that was escaped two or more times
  • Preparing a string to paste into code, a config file or an environment variable

Frequently Asked Questions

What is the difference between this and the JSON Beautifier?

The JSON Beautifier formats JSON. This tool converts between JSON (or text) and its escaped string form, the same as JSON.stringify() and JSON.parse().

Can it handle double-escaped strings?

Yes. Parse removes up to 10 levels of escaping and tells you how many it found.

What if my string has no outer quotes?

Parse adds them automatically when the text looks escaped, and tells you it did.

Was this tool helpful?

More in this category