Esta página ainda não foi traduzida para o português, por isso aparece em inglês.

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.

Atualizado em

Seus dados nunca saem do seu computador. Todo o processamento acontece localmente no navegador.

Como usar: 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.

Também pesquisado como: json escape, json unescape, escape json string, json stringify online, unescape json, json string encoder, remove backslashes json.

Ferramentas que combinam com: JSON Escape & Unescape

  • Formatação JSON — Cole o JSON aqui para formatá-lo, compactá-lo ou validá-lo.
  • Codificação/Decodificação Base64 — Converte texto para Base64 e vice-versa, com suporte total a UTF-8 (acentos, emojis); alterna para Base64 seguro para URLs; ou arrasta um arquivo para obter sua string Base64 ou URI de dados.
  • 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.

Perguntas frequentes

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.
Posso instalar o JSON Escape & Unescape como um aplicativo da web e usá-lo offline?
Sim. O JSON Escape & Unescape é um aplicativo da web instalável (PWA) — instalado a partir do seu navegador, não baixado de uma loja de aplicativos. Clique em “Instalar aplicativo” na parte superior desta página no Chrome ou no Edge (Windows, macOS, Linux, ChromeOS) ou, no Android, use “Compartilhar” → “Adicionar à tela inicial” no iPhone e no iPad, ou “Arquivo” → “Adicionar ao Dock” no Safari 17+ em um Mac. Em seguida, ela se abre em uma janela própria com seu próprio ícone e, como é executada inteiramente no seu navegador, continua funcionando offline. O Firefox no desktop não permite a instalação de aplicativos da web. Como funciona a instalação.

Ferramentas relacionadas