Cette page n’est pas encore traduite en français : elle s’affiche en anglais.

JSON Escape & Unescape — String Encoder

Make any text safe to paste into a JSON string — quotes, backslashes, newlines and Unicode — or turn an escaped string back into readable text or JSON.

Mis à jour le

Vos données ne quittent jamais votre ordinateur. Tout le traitement se fait localement dans votre navigateur.

Comment utiliser : JSON Escape & Unescape

  1. Choose a mode: escape or unescape text, or convert between a JSON document and an escaped string.
  2. Paste the input; the output updates instantly.
  3. Use Reverse to run the opposite conversion on the result.

Which characters must be escaped in JSON?

CharacterEscape
Double quote "\"
Backslash \\\
Newline, carriage return, tab\n, \r, \t
Backspace, form feed\b, \f
Other control characters (U+0000–U+001F)\u0000–\u001f

Everything else, including emoji and accented letters, is allowed as-is in UTF-8 JSON. Tick ASCII only to write non-ASCII characters as \uXXXX for systems that cannot handle UTF-8. The forward slash may optionally be escaped as \/, which some servers do to keep </script> out of inline JSON.

JSON inside JSON

Some APIs and message queues carry a JSON document as a string field — for example an SQS message body or a webhook payload. JSON → string produces that double-encoded form; String → JSON removes one layer of escaping and pretty-prints the inner document, which is the quickest fix for the dreaded "{\"id\":1}" in logs.

In code

JSON.stringify(text)      // escape (JavaScript)
JSON.parse(escaped)       // unescape
json.dumps(text)          # Python
json.loads(escaped)

Need URL or HTML escaping instead? Use the URL encoder or HTML entity encoder.

Aussi recherché comme : json escape, json unescape, escape json string, json stringify online, unescape json, json string encoder, remove backslashes json.

Outils complémentaires : JSON Escape & Unescape

  • Formateur JSON — Collez votre code JSON pour le formater, le compresser ou le valider.
  • Encodage / Décodage Base64 — Convertissez du texte au format Base64 et inversement, avec une prise en charge complète de l'UTF-8 (accents, emojis) ; passez au format Base64 compatible URL, ou glissez-déposez un fichier pour obtenir sa chaîne Base64 ou son URI de données.
  • JSON Diff — Find exactly what changed between two JSON documents — API responses, config versions, fixtures or exports — as a list of paths with old and new values.
  • JSON Schema Validator — Paste a schema and some JSON to see exactly which values break which rule — or generate a starting schema from example data.

Questions fréquentes

How do I remove backslashes from a JSON string?
Choose Unescape text (or String → JSON if the string contains a JSON document). Escape sequences such as \" and \n are turned back into the real characters.
Do I need to escape single quotes?
No. JSON strings use double quotes, so single quotes are valid as-is.
Is my text uploaded?
No. Everything runs in your browser.
Puis-je installer JSON Escape & Unescape en tant qu’application web et l’utiliser hors ligne ?
Oui. JSON Escape & Unescape est une application web installable (PWA) : elle s’installe depuis votre navigateur, sans passer par une boutique d’applications. Cliquez sur « Installer l’application » en haut de cette page dans Chrome ou Edge (Windows, macOS, Linux, ChromeOS) ; sur Android, utilisez « Partager » → « Ajouter à l’écran d’accueil » sur iPhone et iPad ; ou « Fichier » → « Ajouter au Dock » dans Safari 17+ sur Mac. L’application s’ouvre alors dans sa propre fenêtre avec sa propre icône, et comme elle s’exécute entièrement dans votre navigateur, elle continue de fonctionner hors ligne. Firefox sur ordinateur de bureau ne permet pas d’installer d’applications web. Comment fonctionne l’installation.

Outils similaires