Skip to content
JSON Tools

Last updated:

JSON Unescape Online

Use this free JSON unescape tool to turn escaped JSON strings back into readable text. Paste the escaped value and the decoded result appears instantly. Everything runs in your browser.

Escaped JSON text

0 characters · 0 lines

Unescaped text

Loading tool
0 characters · 0 linesLive preview

Your text is processed in your browser and never uploaded.

More free tools you may need next.

How to use JSON Unescape

  1. 1

    Paste the escaped text

    Paste the escaped string into the left box. The surrounding double quotes are optional, so you can copy a value straight out of a JSON file, a log line or an API response.

  2. 2

    Read the decoded text

    The readable text shows up on the right as you type. If the input isn't a valid JSON string, a short message explains what to look for.

  3. 3

    Copy it or send it back

    Copy the result, or press the swap button to escape it again with JSON Escape.

What does it mean to unescape JSON?

Unescaping is escaping in reverse. It takes the backslash sequences inside a JSON string, such as \n, \" and \u00e9, and turns them back into the characters they stand for: a line break, a double quote and the letter é.

You usually meet escaped text when JSON has been stored inside something else. A log line, a database column or an API field holds a whole JSON document as one long string, so every quote picks up a backslash and the result is hard to read.

Where escaped JSON usually comes from

  • Application logs that print a request or response body as a string.
  • Database columns that store JSON as plain text.
  • Message queues and event streams that carry JSON as text.
  • API responses where one field contains another JSON document.
  • Values copied from a browser's network tab, a debugger or a terminal.
  • Config files and environment variables that keep JSON on a single line.

A quick example

This came out of a log file:

Text
{\"name\":\"Sam\",\"note\":\"Line one\\nLine two\"}

After unescaping, the quotes are back to normal and you have JSON you can read and format. The \n inside the note stays as it is, because it belongs to the inner document and is still valid there:

JSON
{"name":"Sam","note":"Line one\nLine two"}

Double-escaped JSON

Sometimes JSON gets turned into a string more than once, for instance when one service stores a payload inside another service's JSON field. After one round of unescaping you still see backslashes. That doesn't mean the tool missed something. Paste the result back into the input to remove another layer, and repeat until the text looks like ordinary JSON.

Why you get an invalid string error

The tool follows JSON's rules strictly, so these are the usual reasons it refuses an input:

  • An unescaped double quote in the middle of the text. Inside a JSON string every quote must be written \". If you have plain text with raw quotes, run it through JSON Escape first.
  • An escape sequence JSON doesn't allow. Only \", \\, \/, \b, \f, \n, \r, \t and a backslash followed by u and four hex digits are valid. Escapes borrowed from other languages, like \' or \x41, fail.
  • An incomplete Unicode escape. A backslash and a u must be followed by exactly four hexadecimal digits.
  • A backslash at the very end. It has nothing to escape, so the string is invalid.

Unescaping in your own code

In code, wrap the escaped text in double quotes and parse it as JSON:

JavaScript
const text = JSON.parse('"' + escaped + '"');
Python
import json

text = json.loads('"' + escaped + '"')

Is it safe to paste private text here?

Decoding happens in your browser. The text you paste is processed on your own device and isn't sent to our servers, so log lines and API responses stay with you. The Privacy Policy covers the details.

Frequently asked questions

Paste the escaped text into the left box. Every escape sequence is turned back into the real character, and the readable result appears on the right instantly.

No. You can paste the text with or without the outer double quotes, and the tool handles both.

The usual causes are an unescaped double quote inside the text, an escape that JSON doesn't support (such as a backslash followed by x), an incomplete Unicode escape, or a lone backslash at the end.

Yes. A sequence like \u00e9 becomes é, and a pair of surrogate escapes becomes a single emoji.

It is JSON that was turned into a string twice, so it still has backslashes after one round of unescaping. Paste the output back in to remove another layer.

It checks the string you paste, not the structure of the JSON document inside it. Use a JSON validator or formatter for that.

No. All decoding happens in your browser and nothing is uploaded.

Press the swap button between the two boxes. It opens JSON Escape with your result already loaded.