JavaScript decodeURI() Function
The decodeURI() function decodes a complete URL that was encoded with encodeURI().
Description
The decodeURI() function decodes a full URL. It doesn't decode escape sequences for characters that have special meaning in a URL, such as %26 (&), because decoding them would change the URL's structure. Use decodeURIComponent() for individual values.
Characters left encoded include ; / ? : @ & = + $ , #, so a decoded URL keeps the same structure as the encoded one. Malformed escape sequences throw a URIError.
It's mainly useful for displaying an encoded URL in a more readable form, for example showing non-ASCII characters in paths. To read the parts of a URL, the URL object gives decoded values for paths and parameters more reliably.
Syntax
decodeURI(encodedURI)Parameters
- encodedURIA URL that was encoded with
encodeURI().
Return Value
The decoded URL.
Exceptions
- URIErrorThrown if the string contains invalid percent-encoding.
Example
Browser Support
The following information will show you the current browser support for the decodeURI() function. Hover over a browser icon to see the version that first introduced support for this function.
Desktop





Tablets & Mobile





