JSON Escape

Putting text inside a JSON string means escaping quotes, backslashes, line breaks and control characters. Paste any text (a log message, a SQL query, a JSON document) and get a correctly escaped string.

Input
Output

The result will appear here.

Ready In: 0 B Processed locally

How to use the JSON Escape

  1. Paste the raw text.
  2. Choose whether to include surrounding quotes and whether to escape non-ASCII characters as \uXXXX.
  3. Press Escape and copy the result.

Features

  • Escapes " \ and control characters as the JSON standard requires
  • Optional ASCII-only output
  • Escape a whole JSON document to embed it as a string value

Supported input

Any text.

Limitations

  • Forward slashes are not escaped, because JSON does not require it.

Privacy

Everything this tool does happens in your browser. What you paste or open is never uploaded, stored, logged or used for advertising. Closing the tab discards it. Read the privacy policy.

Frequently asked questions

01When do I need to escape JSON?

Whenever you put text into a JSON string by hand, for example a multi-line message, a Windows path, or a JSON document stored as a string field.

02Is my data uploaded anywhere?

No. This tool runs entirely in your browser tab. Your input is never sent to our servers, stored, or logged. You can disconnect from the internet after the page loads and it keeps working.