Skip to content
hateitall

JSON Escape

Paste a paragraph, a file path or a code snippet and get a string you can drop into JSON without breaking it.

Processed locallyIn: TextOut: Text

Loading tool…

How to use json escape

  1. Type or paste the text, line breaks and quotes included.

  2. Choose whether to wrap it in quotes.

  3. Turn on \u escapes for non-ASCII or \/ for slashes if your system needs them.

  4. Copy the escaped string.

What this tool does

  • Escapes quotes, backslashes, line breaks, tabs and every control character the JSON standard requires.
  • Optional ASCII-only output, with emoji written as surrogate pairs.
  • Optional \/ escaping for embedding JSON inside an HTML script tag.
  • Shows character counts before and after.

How the result is verified

The escaped output is parsed with the browser's JSON reader and must give back your exact text before the tick appears.

Frequently asked questions

Should I include the surrounding quotes?

Keep them on when you paste a whole value into JSON. Turn them off when your template already has the quotes around the placeholder.

Why escape a forward slash?

It is optional in JSON. It only matters when JSON sits inside an HTML script tag, where a closing script tag inside a string could end the block early.

Is my data uploaded to a server?

No. Everything you drop, paste or type is processed by code running in this browser tab. You can check it yourself: open your browser's developer tools, watch the Network panel, and use the tool. No request carries your data.

Decode a JSON string literal into readable text

Text→ TextLight on device

Beautify or minify JSON with your choice of indentation

JSON→ JSONLight on device

Find JSON syntax errors with the exact line and column

JSON→ ReportLight on device

Readable YAML from JSON, with ambiguous values quoted safely

JSON→ YAMLLight on device