JSON Escape / Unescape

About this tool

Convert any text into a properly escaped JSON string literal, handling quotes, backslashes, and control characters. Also reverse the process to read an escaped JSON string back as plain text.

How to use
  1. Type or paste your text into the input box.
  2. Choose Encode to escape it as JSON, or Decode to unescape it.
  3. Optionally toggle whether the result is wrapped in double quotes.
  4. Copy the result with the Copy button.
Is my data uploaded anywhere?

No. Escaping happens entirely in your browser.

Why would I wrap the result in quotes?

A JSON string literal needs surrounding double quotes. Turn the wrapper off to get just the escaped content for embedding inside JSON you are building by hand.