JSON Escape / Unescape

Escape or unescape special characters in JSON strings

Result will appear here...

JSON Escape Sequences

\n → newline
\t → tab
\r → carriage return
\" → quote
\\ → backslash
\b → backspace
\f → form feed
\uXXXX → unicode

What is JSON Escape / Unescape?

JSON escape sequences represent special characters within JSON strings. Characters like newlines, tabs, and quotes need to be escaped because JSON strings are enclosed in double quotes. The backslash character starts each escape sequence.

How to Use

  1. Select mode: Escape (convert characters to sequences) or Unescape (reverse).
  2. Enter your text in the input field.
  3. Click Process to convert.
  4. Copy the result to clipboard.

Why Use This Tool?

Escape text for embedding in JSON strings
Unescape JSON content for readable viewing
Handle special characters correctly
Client-side processing, no server involved

Tips & Best Practices

  • JSON.stringify() in JavaScript handles escaping automatically
  • Only these escapes are valid: \n, \r, \t, \b, \f, \", \\, \uXXXX
  • URL encoding is different - use URL Encode tool for URLs

Frequently Asked Questions

When do I need this?

When manually creating JSON or debugging escaped data from APIs.

Difference from URL encoding?

JSON escape is for JSON content. URL encoding is for URL parameters.

Why double backslashes?

Display layer shows escaped backslash. The actual string has single escape.

Related Tools