Useful Hacks

JSON Stringify / Escape

Escape text into a JSON string literal, or unescape it back — with an optional \uXXXX-only mode.

Processed locally in your browser. Nothing you enter is uploaded or stored.
  • Escapes quotes, backslashes, newlines and control characters correctly, with surrounding quotes.
  • Optional \uXXXX-escaping for non-ASCII characters (accents, emoji, non-Latin scripts), for parsers or pipelines that expect ASCII-only JSON.
  • Unescape direction turns a string literal back into readable text.
  • Runs in your browser.

Why this is private

  • Processed locally in your browser. Nothing you enter is uploaded or stored.
  • Open your browser's DevTools → Network tab while using this tool — you won't see a request carrying your input, because it never leaves your device.
  • Nothing you enter is uploaded to a server or shared with us — the processing happens entirely on your device.

Overview

Converts raw text into a properly escaped JSON string literal (escaping quotes, backslashes and newlines), or decodes one back to plain text. An optional mode escapes non-ASCII characters to \uXXXX too, for maximum compatibility with stricter parsers.

How to use it

  1. 1Choose Escape or Unescape.
  2. 2Paste your text.
  3. 3In Escape mode, check "Escape non-ASCII characters" if you need \uXXXX output instead of literal Unicode.
  4. 4Copy the result.

Examples

Escape

Input

Line one Line "two"

Output

"Line one\nLine \"two\""

Frequently asked questions

What people use it for

Embed a multi-line string in JSONTurn a code snippet or template into a single valid JSON string value.
Put HTML or a query in a config fileEscape a value with quotes and newlines so the JSON stays valid.
Read an over-escaped log fieldUnescape a string literal from a log line back into plain text.
Build a JSON payload by handEscape each string value before assembling the object.
Produce ASCII-only JSON for a strict older parserCheck the \uXXXX option so accented letters, emoji and non-Latin text come out as escape sequences instead of raw UTF-8 bytes.

Related guides

Related tools

All developer tools

Ready to use JSON Stringify / Escape?

JSON Stringify / Escape

Search tools

Search for any tool by name, category or keyword