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 »let encoded = encodeURI(uri);
let decoded = decodeURI(encoded);
Description
ThedecodeURI() methoddecodes a URI.
Note
Use theencodeURI() method toencode a URI
See Also:
TheencodeURIComponent() method to encode a URI
ThedecodeURIComponent() 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 |

