JavaScript decodeURI() Function

Definition and usage

decodeURI() Function used to decode URI.

Tip:Please use encodeURI() Function to encode URI.

Example

Decode the URI after encoding it:

var uri = "my test.asp?name=ståle&car=saab";
var enc = encodeURI(uri);
var dec = decodeURI(enc);
var res = enc + "<br>" + dec;

Try it yourself

Syntax

decodeURI(uri)

Parameter value

Parameter Description
uri Mandatory. The URI to be decoded.

Technical details

Return Value: String representing the decoded URI.

Browser Support

Function Chrome Edge Firefox Safari Opera
decodeURI() Support Support Support Support Support