Escape or restore a JSON string

Developers can use this while debugging or preparing data for an exchange, especially when the result needs a quick visual check. Escape or restore a JSON string.

Escape or restore a JSON string. The result appears instantly in your browser, ready to copy, with no account, upload or storage involved.

How to use

  1. Enter the text or JSON string you want to process in the input area.
  2. Click Encode to escape special characters, or Decode to restore a string.
  3. Use Encode as ASCII if you want to convert non-ASCII characters into escape sequences.
  4. The result appears immediately in the right-hand area, ready to copy.
  5. Clear the fields with the Erase button to start over with a new string.

Example

You need to embed text containing quotes and line breaks into a JSON string. For example: He said "Hello" and new line. Encoding turns these characters into valid JSON escapes that you can paste into your code.

Input

He said "Hello" and
new line

Output

He said \"Hello\" and\nnew line

Limits and formats

Where processing happens

Processing is local: your browser performs the escaping or restoration without sending the string out. Your text therefore stays on your machine throughout the operation.

Frequently asked questions

What is the difference between Encode and Encode as ASCII?

Encode escapes the special characters required for a JSON string. Encode as ASCII goes further by converting non-ASCII characters into Unicode escape sequences, ensuring compatibility with systems that only accept ASCII.

Can I decode a string that contains escaped quotes?

Yes, the Decode function restores escape sequences such as \" or \n. If the string is malformed, the result may be incorrect. Always check that your input string follows JSON rules.

Does the tool handle emojis?

Emojis are Unicode characters. In Encode mode, they can be kept as is or escaped depending on the chosen option. In Decode mode, the corresponding Unicode sequences are restored to emojis.

Tools in the same category