JavaScript decodeURI()
❮
Global Methods
❯
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 »
Definition and Usage
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 (ES1) feature.
ES1 (JavaScript 1997) is fully supported in all browsers:
Chrome | IE | Edge | Firefox | Safari | Opera |
Yes | Yes | Yes | Yes | Yes | Yes |
❮
Global Methods
❯