About the JSON Decode
Decode a JSON-encoded string literal, resolving escape sequences such as \n, \t, \" and \uXXXX. If the result is itself JSON, it is formatted too.
Key features
- Resolves \n, \t, \", \\ and \uXXXX escape sequences
- Accepts strings with or without surrounding quotes
- Formats the result automatically if it's JSON
- Returns plain text when the content isn't JSON
- Clear errors for invalid escape sequences
- Runs entirely in your browser
Decode escaped JSON strings
When text or JSON is stored inside a JSON string, special characters are escaped: line breaks become \n, quotes become \", and non-ASCII characters may become \uXXXX. The result is accurate but unreadable. JSON Decode reverses the escaping so you can read the original content.
Example
Input:
"Line one\nLine two\n✓ Done 🚀"
Output:
Line one
Line two
✓ Done 🚀
If the decoded text is JSON, for example "{\"id\":1,\"ok\":true}", it's formatted:
{
"id": 1,
"ok": true
}
JSON escape sequences
| Escape | Character |
|---|---|
\" | Double quote |
\\ | Backslash |
\/ | Forward slash |
\n | Line feed (new line) |
\r | Carriage return |
\t | Tab |
\b / \f | Backspace / form feed |
\uXXXX | Unicode code unit (hex) |
Where escaped strings come from
- Log files, where messages and stack traces are stored as JSON string values.
- Error responses that embed another service's error body.
- Databases storing text with line breaks in JSON columns.
- Translations and CMS exports, where formatted text includes
\n. - LLM and chatbot APIs, whose responses contain escaped Markdown.
Related tools
To produce escaped strings, use JSON Encode. For multiple layers of escaped JSON, use JSON Unstringify. To escape or unescape text without surrounding quotes, try JSON Escape / Unescape.
How to use the JSON Decode
- Paste your data into the input box, upload a file, or click Sample to try it out.
- Adjust the options above the editor if you need to (indentation, delimiter, and so on).
- The result appears instantly in the output panel. Any errors are shown with their line and column.
- Click Copy to copy the result, or Download to save it as a file.