JSON Escape & Unescape

  • Auto-direction
  • Unicode safe
  • Nothing uploaded

Turn JSON into an embeddable string literal, or a stringified payload back into JSON.

Input
Result

Paste input on the left to see result.

Everything runs in your browser — nothing is uploaded.

About escape

Escaping JSON turns a document into a string literal you can embed in code. Unescaping reverses it, stripping the backslashes a payload collects when it is nested inside another JSON string or written to a log line. JSONic detects which direction you need from the input itself.

A JSON payload that has been through a log line, a database column or a nested API response arrives covered in backslashes. This unescapes it back into something readable — and goes the other way, turning a document into the escaped literal you can paste into source code or a test fixture. Direction is detected from the input: text containing backslash escapes but no raw newlines is treated as already escaped.

Questions

How does direction detection work?

Input containing backslash escape sequences but no raw control characters is almost certainly already escaped, so it gets unescaped. Anything else gets escaped. You can override the choice.

Does it handle Unicode and emoji correctly?

Yes. Escaping goes through the engine's own string serializer, so surrogate pairs, combining characters and control characters are handled exactly as a compliant parser expects.

Why does my escaped output still contain backslashes after unescaping?

Because the payload was escaped more than once — a common outcome when a JSON string is logged into another JSON document. Run unescape again for each layer.