en

Escape JSON

Turn arbitrary text into a ready JSON string literal (quotes, line breaks escaped) - locally, with no upload.

Running locally on your device ...

Running locally on your device ...

0%

Is my file uploaded?

No. Everything runs in your browser - your file never leaves your device. How this is verifiable

No upload100% local
Your content stays with youno third-party access
Hosted in GermanyGlobal Content Delivery
Independently auditedTLS A+ · HTTP headers A+

Anyone who wants to embed text in JSON or source code must escape it: quotation marks, backslashes, line breaks and tabs have a special meaning there and would break the surrounding code. This tool takes your raw text and outputs it as a valid JSON string literal - including the surrounding quotation marks - that you can safely paste into a JSON file or into code.

Specifically, double quotation marks, backslashes and control characters such as line break and tab are rewritten into their escaped forms (\" \\ \n \t). The result matches exactly what a programming language produces when serializing a string, and can be turned back losslessly into the original text when read in.

The conversion runs entirely locally in your browser in pure JavaScript - your text is not uploaded, not stored, and no foreign library is loaded from a CDN. You can download the result as a text file or copy it straight into your file.

Specifications

Specifications
Input formatsText input
Output formatTXT
Batch processingNo
ProcessingLocally in your browser (JavaScript)
File uploadNone

In 3 steps

  1. Paste the text into the text field.
  2. Click escape.
  3. Read or download the JSON string literal.

Limitations: The tool produces a single JSON string literal from the entire input text (with surrounding quotation marks). It does not format a whole JSON document - the JSON formatter tool is for that. Very large texts are limited by your device memory.

FAQ

Is my text uploaded?

No. The conversion runs entirely locally in your browser; your text never leaves your device and is not stored.

What gets escaped?

Double quotation marks, backslashes and control characters like line break (\n) and tab (\t) - exactly what a valid JSON string literal requires.

Do I get quotation marks included?

Yes. The output is a complete literal including the surrounding quotation marks, so you can use it directly as a value in JSON or code.

How do I reverse it?

A JSON string literal can be turned back losslessly into the original text by any JSON parser when read in.

Related tools

Format JSON · Encode URL · Text to Base64 · Unicode escape