JSON Escape and Unescape

Turn text into a valid JSON string, turn an escaped string back into text, or nest JSON inside a string.

To put text into JSON, quotes, backslashes, tabs and line breaks have to be escaped — otherwise the file breaks. Paste the text and get a ready string literal: " becomes \", a line break becomes \n, a Windows path keeps its backslashes as \\. The reverse direction turns an escaped string from a log or an API response back into readable text.

Two more modes cover JSON inside JSON. Stringify takes a JSON document and writes it as one escaped string — the shape a config field, an environment variable or a message queue often expects. Parse does the opposite: it unwraps such a string and shows the JSON inside, formatted. Large integers stay exact in both directions.

Auto mode guesses the direction from what you paste, and the result updates as you type. Choose whether to keep the surrounding quotes and whether non-Latin characters should be written as \uXXXX. An invalid sequence such as \x is reported with its position.

Nothing is uploaded: everything runs inside your browser, so API responses, configs, contact lists and datasets stay on your device.

Four directions

How to escape or unescape JSON in 3 steps

  1. 1

    Paste the input

    Text, an escaped string or a JSON document; the Sample shows typical special characters.

  2. 2

    Check the action

    Auto detects the direction; pick escape, unescape, stringify or parse yourself if needed.

  3. 3

    Copy the result

    The output updates as you type; copy it with one click.

Frequently asked questions

Paste the text with the action on Auto or text → JSON string; the escaped literal appears on the right.
It turns \n back into line breaks, \" into quotes and \u0416 into the letter it stands for.
Use JSON → string with JSON. To read such a value back, use string with JSON → JSON.
Some old systems accept only ASCII. With the option on, every non-Latin character is escaped and the JSON stays valid.

Related tools