Skip to content
jsonforge.app

JSON Escape / Unescape

Escape raw text into a JSON string literal, or unescape one back to plain text.

Entrée

Loading editor…

Sortie échappée

Le résultat apparaîtra ici.

Qu'est-ce que JSON Escape / Unescape ?

A JSON string escaper/unescaper converts raw, multi-line text into a single-line JSON string literal — replacing characters that JSON's string syntax forbids or treats specially (double quotes, backslashes, newlines, tabs, and other control characters) with their backslash-escaped equivalents (\", \\, \n, \t, and \u00XX for other control codes). This is exactly what JSON.stringify() does to a string value, but exposed as a standalone tool so you can escape text that isn't attached to any larger object — useful when you're hand-writing a JSON payload, embedding a code snippet or log line inside a config file's string field, or debugging why a string with a literal quote in it broke a JSON parser. Unescaping does the reverse: given an escaped string (with or without its surrounding double quotes), it decodes the escape sequences back into the original raw text.

Comment utiliser JSON Escape / Unescape

  1. Switch to the "Escape" tab, then type or paste the raw text you want to embed as a JSON string value.
  2. The escaped, JSON-safe version appears instantly on the right, ready to paste inside a JSON document.
  3. Switch to "Unescape" to go the other way — paste an escaped string (quoted or not) and get the original text back.
  4. Use the copy button to grab the result without needing to select it manually.

Exemples

Escaping a multi-line snippet

Entrée

Line one Say "hello"

Sortie

"Line one\nSay \"hello\""

Unescaping back to raw text

Entrée

"a\tb\\c"

Sortie

a b\c

Erreurs courantes

  • Pasting already-escaped text into Escape mode again, which double-escapes every backslash.
  • Forgetting that a literal backslash in your source text must itself become \\ — a single \ before an unsupported letter is invalid JSON.
  • Assuming Unicode characters need \u-escaping — they don't; only control characters and " / \ require it in standard JSON.

Pourquoi utiliser cet outil

  • Runs entirely in your browser — no text you escape or unescape is ever sent to a server.
  • Accepts escaped input with or without surrounding quotes, so you don't have to manually add them before unescaping.
  • Faster than manually hand-escaping quotes and newlines when embedding a snippet inside a JSON config or payload.

Questions fréquentes