99digest is in early access — tools are free while we grow.
Guide

How to Escape and Unescape a JSON String

To escape a JSON string, paste your raw text into the tool and choose Escape; quotes, backslashes and line breaks become escape sequences safe to put inside a JSON string. Choose Unescape to turn an escaped string back into plain text.

Follow along with the free JSON Escape/Unescape, which runs in your browser, or browse more tools in this category.

How to use the JSON Escape/Unescape

  1. Paste the raw text or the escaped string.
  2. Choose Escape or Unescape.
  3. Read the result.
  4. Copy it into your JSON or code.

Worked example

The text He said “hi” and a new line becomes He said “hi”n when escaped, with the quotes backslashed and the line break shown as n.

Tips and common mistakes

  • Escape text before placing it inside a JSON string value, or the JSON will break.
  • Use Unescape to read logs where JSON strings appear with many backslashes.
  • Double-escaped strings need to be unescaped twice.

Frequently asked questions

Why do I see so many backslashes?

Each backslash marks a special character such as a quote or line break inside a JSON string.

What characters get escaped?

Double quotes, backslashes and control characters such as new lines and tabs.

Is it private?

Yes. It runs in your browser.

Try the JSON Escape/Unescape Free, instant, and runs in your browser.