Useful Hacks

JSON Stringify / Escape

Escape text into a JSON string literal, or unescape it back.

Processed locally in your browser. Nothing you enter is uploaded or stored.

Overview

Converts raw text into a properly escaped JSON string literal (escaping quotes, backslashes and newlines), or decodes one back to plain text.

How to use it

  1. 1Choose Escape or Unescape.
  2. 2Paste your text.
  3. 3Copy the result.

Examples

Escape

Input

Line one Line "two"

Output

"Line one\nLine \"two\""

Related tools

All developer tools

Search tools

Search for any tool by name, category or keyword