Skip to content

JavaScript unescape string | Example code

  • by

Use unescape() function in JavaScript to decode given string. This string may be encoded by the escape() function.


Note: Do not use unescape to decode URIs, use decodeURI instead.

Example unescape string in JavaScript

HTML example code, This function accepts a single parameter.

<!DOCTYPE html>


   str = escape("Hellow")
   document.write("Encoded : " + str);
   // New Line
   // unescape() function
   document.write("Decoded : " + unescape(str))


JavaScript unescape string

Warning: Although unescape() is not strictly deprecated (as in “removed from the Web standards”), it is defined in Annex B of the ECMA-262 standard, whose introduction states:

Do comment if you have any doubts or suggestions on this JS escape code.

Note: The All JS Examples codes are tested on the Firefox browser and the Chrome browser.

OS: Windows 10

Code: HTML 5 Version

Leave a Reply

Discover more from Tutorial

Subscribe now to keep reading and get access to the full archive.

Continue reading