JSON Escape & Unescape Tool
Escape raw text for JSON strings and unescape JSON string content without hand-counting backslashes.
- Sin límites de longitud
- Sin registro
- Gratis para siempre
- Tu texto nunca sale de tu navegador
Common JSON Syntax Errors
JSON is unforgiving by design. Property names and strings must use double quotes, single quotes are invalid, internal double quotes must be escaped so the parser does not treat them as the end of the string, and literal line breaks are not allowed inside strings — a real newline in a value is a syntax error, not formatting. Trailing commas after the last item of an object or array fail too. In practice the culprits are invisible: a curly quote pasted from a word processor, a line break typed while editing, or an apostrophe that quietly ends a string early.
This page handles both directions. Escaping takes plain text and produces the JSON string literal that represents it, adding exactly the escapes the parser requires. Unescaping does the reverse: it takes a JSON string — for instance one copied from a log or an API response after an extra encoding pass — and restores the real characters the escapes stand for. When you see escape sequences printed as visible backslash-letter pairs, that is a string which was escaped twice and needs one unescape to read correctly.
Handling Unicode and Control Characters
JSON strings support the full range of escaped control characters — the short forms for tab, newline, carriage return, backspace, and form feed, plus escaped double quotes and the backslash itself. Characters outside the literal set can be included directly as UTF-8 in most modern parsers, or written with the four-hex-digit Unicode escape when you need ASCII-safe output. Characters beyond the Basic Multilingual Plane, such as most emoji, require two such escapes (a surrogate pair) in strict JSON.
The same content can look correct and still fail to parse. Smart or typographic quotes render identically to their straight counterparts on screen but are different characters that JSON rejects, and an invisible byte-order mark at the start of a file is enough to break a strict parser. When a document refuses to parse, decode it here, paste the exact bytes into a validator, and inspect the first character — the cause is almost always invisible.
Preguntas frecuentes
Why does my JSON fail to parse even though it looks correct?
Almost always one of a handful of causes: curly or typographic quotes where the parser expects straight ones, an invisible byte-order mark at the start, a trailing comma, a literal line break inside a string, single quotes used instead of double, an unescaped double quote inside a value, or an extra layer of encoding that has turned quotes and slashes into escape sequences. Validate the exact bytes rather than a copy, and if the error points at a position that looks fine, inspect the character before it — non-printing characters are the usual culprit.
Tu texto nunca sale de tu navegador
Cada herramienta se ejecuta localmente en tu dispositivo. Nada de lo que pegues se sube, se almacena ni se rastrea.