Encoding

JSON Escape

Escape any text for safe embedding inside a JSON string — quotes, backslashes, newlines, and control characters.

Escaping runs locally in your browser. Nothing is uploaded, logged, or stored.

0 chars
0 chars

How to use

  1. Paste the raw text you want to embed into the input panel.
  2. Click Escape — every special character is converted to its JSON escape sequence.
  3. Copy the result between the quotes of your JSON string value.

Why escaping matters

Inside a JSON string, a bare double quote terminates the value and a backslash starts an escape sequence — so pasting raw text with either one breaks the whole document. This tool applies the exact escaping rules of RFC 8259: "\", \ \\, newlines → \n, tabs → \t, and other control characters to \uXXXX form.

The output contains no surrounding quotes, so you can drop it straight into an existing string field. Going the other way? Use the JSON Unescape tool. To escape a whole JSON document instead of plain text, see JSON Stringify.

Examples

Embed logs or messages

Prepare a multi-line error message for inclusion in a JSON log payload without breaking the structure.

Hand-written JSON bodies

When writing a request body by hand, escape user-provided text before pasting it into a field.

Frequently Asked Questions

Is my text uploaded anywhere?+
No. Escaping happens entirely in your browser.
Are Unicode characters escaped?+
No — non-ASCII characters are valid inside JSON strings and are kept as-is. Only control characters are converted to \uXXXX form.
Why is there no surrounding quote?+
The tool escapes content for embedding in an existing string. Add quotes yourself if you need a standalone literal.
Which escape sequences are produced?+
\" \\ \/ \b \f \n \r \t and \uXXXX for other control characters — the full JSON set.

Related Tools

Looking for something else? Browse all tools