...

Next-Gen App & Browser
Testing Cloud

Trusted by 1 Mn+ QAs & Devs to accelerate their release cycles

Next-Gen App & Browser Testing Cloud

Unescape JSON Online

Unescape JSON is a JavaScript utility that restores an escaped JSON string or file back to its unescaped original state.

Enter Value

Output

What is Unescape JSON?

Unescape JSON is the method of converting JSON strings encoded with specific characters to escape special characters such as newlines, quotes, and then converting back to its original format. In other words, JSON Unescape converts JSON strings to plain JSON, so that you can show text that is contained in 'pre' tags. The escape notation character, in most cases the backslash (\), will be unwrapped from any string when the code is parsed. The code may also be pretty printed or minified. In JSON, you need to escape specific characters in order to encode them properly.

For example, if a JSON string has a newline character, it needs to be escaped as "\n" to represent it correctly in JSON. Likewise, a quote character will be escaped as "\." Therefore, when you send JSON to a client, the special characters are unescaped so that they can be properly interpreted by the client.

Difference between JSON Unescapes and Escapes

JSON Unescape is the process of converting back escaped characters in any JSON string back to their original format whereas JSON Escape is the process of converting special characters in any JSON string into their escaped form.

Following are the special characters that typically need to be escaped.

  • Backslash ()
  • Double-quote (")
  • Forward-slash (/)

When the above characters are there in a JSON string, they are typically preceded by a backslash character (). This indicates that the characters should be regarded as literal characters rather than special characters in JSON.

JSON Unescape takes an escaped JSON string and converts it back into its original unescaped format. This is usually done by removing the backslash character () that precedes each special character in JSON string.

For example, the string "Hey"LambdaTesters"" would be escaped as "Hey\"LambdaTesters\"" and would be unescaped back to "Hey"LambdaTesters"".

How does Unescape JSON work?

Unescape JSON removes traces of offending characters that could prevent parsing. To unescape JSON strings, several libraries and tools are available in different programming languages. For example, in Python, the json.loads() can help you to unescape a JSON string and convert it into a Python dictionary and json.dumps() convert the Python object into a JSON string.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud