Skip to main content

JSON Escape Unescape

Escape and unescape special characters in JSON

Escape special characters in JSON strings or unescape them back to normal. Handles quotes, newlines, tabs, and other characters that need special treatment. Essential for safely including special characters in JSON strings.


How to escape/unescape JSON?

The process is simple:

  • Paste your JSON string in the input field
  • Click 'Escape' to convert special characters to escape sequences
  • Click 'Unescape' to convert escape sequences back to normal characters
  • Review the result in the output area
  • Copy the escaped or unescaped string for your code

Related Tools

You May Also Need

Understanding JSON Escaping

JSON strings can contain special characters like quotes, newlines, and tabs. These need to be escaped (converted to escape sequences like \", \n, \t) to be safely included in JSON without breaking the syntax. Escaping ensures your data is valid JSON, while unescaping converts those sequences back to readable characters.

When Escaping is Necessary

  • Including text with quotes or special characters in JSON strings
  • Processing data that contains newlines, tabs, or other control characters
  • Preparing JSON strings for API transmission
  • Storing text data that contains special characters in JSON format

Frequently Asked Questions (FAQs)

What is JSON escaping?

It converts special characters to escape sequences so they can be safely included in JSON strings. For example, a quote becomes \" and a newline becomes \n.

What characters are escaped?

Common ones include quotes ("), backslashes (\), newlines (\n), tabs (\t), and carriage returns (\r). These characters need special handling in JSON strings.

What is unescaping?

Unescaping converts escape sequences back to their original special characters. So \n becomes an actual newline, and \" becomes a quote.

When do I need to escape JSON?

You need escaping when your JSON strings contain special characters that would otherwise break the JSON syntax. Escaping makes these characters safe to include.

Recently Used Tools