JavaScript (ES2026) reference · JSON and Global Functions
JavaScript decodeURI() Function
Decode a full URL encoded by encodeURI(), keeping escape sequences that represent reserved URL characters.
JavaScript (ES2026) Since ES3
Syntax
decodeURI(encoded)
Parameters
| Parameter | Description |
|---|---|
encoded |
An encoded URL. |
Return value
A decoded string.
Examples
console.log(decodeURI("https://example.com/my%20file.pdf"));
Output
https://example.com/my file.pdf
console.log(decodeURI("a%26b"), decodeURIComponent("a%26b"));
Output
a%26b a&b
Version history
| Version | Change |
|---|---|
| JavaScript ES3 | Added |
Related
encodeURI()· Encode a complete URL, leaving characters with special meaning in URLs (like :, /, ? and &) untouched.decodeURIComponent()· Decode a URL component encoded by encodeURIComponent(), turning %20-style escapes back into characters.- JavaScript Fetch API · tutorial