JSON Escaper

Free online JSON unescape and escape tool. Instantly decode escaped JSON strings, remove backslashes, convert Unicode sequences. Perfect for parsing API responses, logs, and encoded data. Also escape JSON for embedding. No installation needed.

Loading...
JSON unescape is the process of converting escaped sequences (like \" and \n) back into their original characters, making a JSON string human-readable again. JSON escape is the reverse: encoding special characters into safe sequences so the string can be embedded in another JSON object or transmitted via API without breaking syntax. This free online JSON Unescape & Escape tool handles both directions instantly — paste your escaped API response or raw JSON, and get clean results with one click. It supports nested JSON structures, Unicode sequences, and multi-level escaping. All processing happens locally in your browser; no data is sent to any server.
  1. Paste your raw JSON string into the input text area.
  2. Click the 'Escape' button to convert special characters into their escaped sequences. The result is a single, safe string.
  3. To reverse the process, paste an escaped string and click the 'Unescape' button.
  4. You can also format or compress the JSON before or after escaping/unescaping.
  5. Use the 'Copy' button to grab the result, or 'Load Example' to see how it works.

What is JSON escaping?

JSON escaping is the process of converting special characters in a JSON string into escape sequences. For example, double quotes become \", and newlines become \n. This ensures that the JSON string maintains its integrity when embedded within other JSON structures or transmitted across systems.

JSON Escape vs Unescape: what's the difference?

JSON escape encodes special characters so a string can be safely embedded or transmitted, while JSON unescape decodes those sequences back to readable content. Use escape before embedding JSON in another string, and use unescape when inspecting API responses or logs.

Which characters need to be escaped in JSON?

According to the JSON specification, these characters must be escaped: double quotes (") become \", backslash (\) becomes \\, newline becomes \n, carriage return becomes \r, tab becomes \t, backspace becomes \b, and form feed becomes \f. Additionally, certain control characters require Unicode escaping using the \uXXXX format.

What is the difference between JSON escape and URL encoding?

JSON escaping and URL encoding are two different encoding methods for different purposes. JSON escaping uses backslashes (like \" and \n) to handle special characters within JSON strings. URL encoding uses percent signs (like %20 for space, %22 for quotes) to handle special characters in URLs. They cannot be used interchangeably and must be chosen based on the specific context.

When do I need to escape JSON?

You need JSON escaping in three main scenarios: 1) When embedding a JSON object as a string within another JSON (like nested configurations); 2) When transmitting JSON data through APIs where special characters might cause parsing failures; 3) When storing JSON data as text format in databases or log files.

How to handle nested JSON strings?

Handling nested JSON requires multiple layers of escaping. When a JSON object needs to be embedded as a string within another JSON, all special characters in the inner JSON must be escaped. With multiple nesting levels, escape characters double with each layer (e.g., \" becomes \\\"). Our tool automatically handles this complex escaping process for you.