JavaScript Escape/Unescape

Load Sample Data

With the Free Online JavaScript Escape/Unescape tool, replace the reserved characters in JavaScript with their corresponding escaped characters and convert them back to their original ones.

JavaScript Escape/Unescape is the process of removing or escaping the offending characters in a JavaScript string that could prevent the parsing or interpretation of the JavaScript string, or you could unescape the Javascript special characters to their original ones.

The free online JavaScript Escape/Unescape tool performs the two functions.

  • It escapes the reserved characters in JavaScript with its corresponding characters.
  • It unescapes the escaped characters in JavaScript by returning them to their original ones.

JavaScript Escape

Some characters in the string break the program. While working with those characters, you need to escape it because the browser interprets those characters differently than you intended.

Some characters are reserved in JavaScript strings. Those characters should be escaped before the JavaScript string is used.

The following characters are reserved in JavaScript and must be properly escaped before using them in the string. 

In JavaScript Escape,

  • The backspace is converted to \b
  • The form feed is converted to \f
  • A newline is converted to \n
  • The carriage return is converted to \r
  • The single quote is converted to \'
  • The double quote is converted to \"
  • The backslash is converted to \\
  • The horizontal Tab is converted to \t
  • The vertical Tab is converted to \v
  • The null char is converted to \0

JavaScript Unescape

The JavaScript Unescape is the process of bringing the JavaScript escaped characters string to their original ones.

The following characters in the JavaScript string must be appropriately unescaped and bring them back to the original ones.

In JavaScript Unescape,

  • \b is converted to backspace.
  • \f is converted to form feed.
  • \n is converted to a newline.
  • \r is converted to carriage return.
  • \" is converted to a double quote.
  • \\ is converted to backslash.
  • \t is converted to a horizontal tab.
  • \v is converted to a vertical tab.
  • \0 is converted to null char.

How to use the JavaScript Escape/Unescape Tool Online tool?

For this, do the following steps.

  • Open the JavaScript Escape/Unescape Online tool.
  • You can copy-paste the JavaScript code, load it from the URL, or use the "browse" button to upload the file.
  • Click on the "Escape" button.
  • The tool replaces the reserved characters in JavaScript with their corresponding escaped characters.
  • The tool will provide the result in the "Result" section.
  • Please copy and paste the code into the desired location.
  • You can unescape the JavaScript escaped string by clicking on the "Un Escape" button.