JavaScript decodeURI()
Example
Decode a URI after encoding it:
let uri = "my test.asp?name=ståle&car=saab";
let encoded = encodeURI(uri);
let decoded = decodeURI(encoded);
Try it Yourself »
Description
The decodeURI()
method decodes a URI.
Note
Use the encodeURI() method to encode a URI
See Also:
The encodeURIComponent() method to encode a URI
The decodeURIComponent() method to decode a URI
Syntax
decodeURI(uri)
Parameters
Parameter | Description |
uri | Required. The URI to decode. |
Return Value
Type | Description |
A string | The decoded URI. |
Browser Support
decodeURI()
is an ECMAScript1 (JavaScript 1997) feature.
It is supported in all browsers:
Chrome | Edge | Firefox | Safari | Opera | IE |
Yes | Yes | Yes | Yes | Yes | Yes |
❮
Global Methods
❯