ToolGuest
Global · Tier-1 optimized
✓Escape or unescape · unicode aware · nothing uploaded

JSON Escape & Unescape

Turn raw text into a valid JSON string literal, or decode a payload full of backslashes back into readable characters. The page opens in escape mode.

Quotes & newlines Unicode escapes Round-trip safe No uploads
0 B input 0 B output 0% vs input 0 values 0 levels deep
Input JSON

Drop a .json file anywhere in this pane — it is read with FileReader in this tab.

0 lines · 0 characters · 0 B
Formatted output
0 lines · 0 characters · 0 B

Parsed with the native JSON.parse in your browser. Zero network requests, no upload endpoint.

AI summary

What does ToolGuest JSON Escape & Unescape do? ToolGuest JSON Escape & Unescape converts raw text into a valid JSON string literal, escaping quotes, backslashes, newlines and control characters, and decodes escaped payloads back into plain text including \uXXXX sequences. Both directions run in the browser, round-trip safely, and never upload or store your data.

Complete your JSON debugging workflow Diff Checker Base64 Encoder Epoch Converter
How it works

Escape or unescape a string in three steps

  1. 1

    Paste the text

    Raw text for escaping, or an escaped payload for decoding. The sample shows quotes and a newline.

  2. 2

    Pick a direction

    Escape wraps the text as a JSON string. Unescape turns \n, \t, \" and \uXXXX back into characters.

  3. 3

    Copy the result

    The output is ready to paste into a header, a config value, a log line or a source file.

Escaping

When a JSON string needs escaping

A JSON string cannot contain a raw double quote, a backslash or a control character such as a newline. Each of those has to be written as an escape sequence, which is why a value that looks fine in a text editor can break a request body the moment it is embedded in JSON.

The common cases are a quote inside a message, a Windows path with backslashes, a multi-line address and any non-ASCII text that a system insists on ASCII-only transport. Escaping handles all four, and the round-trip check is simple: unescape the output and you should get your original text back.

Distinctions

Escaping, encoding and serialising are different jobs

Escaping adds backslashes so text can live inside a JSON string. Base64 encoding converts bytes to ASCII, which is what a data URL or a basic-auth header needs. Serialising turns a whole object into JSON text, including braces and keys.

Mixing them up causes most of the confusing double-escaped payloads in the wild. If you need a header value, encode. If you need to embed a string inside JSON, escape. If you need to send an object, serialise it, then escape only if it will be embedded again.

Reference

JSON escape sequences and what they mean

JSON defines a small, fixed set of escapes. Anything else after a backslash is invalid, which is a common cause of a parse error at a seemingly random character.

SequenceMeaningExample
\"Double quoteA quoted phrase becomes \"quoted\"
\\BackslashC:\\temp stays one path
\nLine feedA multi-line message becomes one line
\tTabIndentation inside a string value
\u00e9Unicode code pointé, for ASCII-only transports
\/SolidusLegal but rarely needed; a plain / is fine
FAQ

JSON escape questions

When should I escape a string for JSON?

Whenever the text will sit inside a JSON string and contains a double quote, a backslash or a control character such as a newline or tab. Escaping first prevents a broken document and keeps the value readable once the receiver parses it.

Why is my JSON double-escaped?

The string was escaped, then embedded in another JSON document and escaped again, so the receiver sees a literal backslash instead of an escape sequence. Unescape once to inspect the middle layer, and check whether both escaping steps are actually needed.

Does unescaping handle \uXXXX and emoji?

Yes. A quoted literal is decoded by JSON.parse, so surrogate pairs and four-digit code points resolve exactly as the specification requires. A bare sequence without surrounding quotes is decoded character by character, and surrogate pairs are combined into one character.

Can I escape a full JSON document instead of one string?

Yes, but that produces a string containing JSON, not JSON. It is what you need when a payload must be sent as a single field, for example inside a webhook envelope or a queue message. For transport, prefer sending the object directly.

Is it safe to paste secrets into the escape tool?

Yes, because the conversion happens in your browser and nothing is transmitted or stored. That said, treat any escaped secret as still sensitive: the output is only as private as the clipboard and the file you paste it into afterwards.

The cluster

All JSON Formatter, Validator & Viewer Tools

Seven pages, one client-side engine. Every tool formats, validates and minifies in the same workspace, and each page opens with the mode its name promises — a validator that lands on errors, a minifier that shows the bytes saved, a viewer that starts in the tree.

Last updated ·Reviewed by the ToolGuest editorial team