100% local — your data never leaves your browser

JSON String Escaper — Escape Text for JSON Online

Escape any text into a valid JSON string literal — quotes, newlines and tabs handled. Free and private, in your browser: nothing leaves your device.

Instant Private Zero cookies

Text input

JSON String output

Why escape text for JSON?

Embedding multi-line text, code snippets or messages with quotes into a JSON document by hand means hunting every ” and newline. Paste your text above to get a correctly escaped JSON string.

How it works

The text goes through JSON.stringify locally: quotes become ”, newlines \n, tabs \t and control characters their \uXXXX form. The result is a valid JSON value, ready to paste into any document or API payload.

Frequently asked questions

Is my text data uploaded to a server?
No. Everything runs entirely in your browser with JavaScript. Nothing is sent over the network, which makes the tool safe for sensitive data.
Is the surrounding double quote included?
Yes, the output is a complete JSON string literal you can paste directly as a value. Strip the outer quotes if you only need the escaped content.

Related converters