X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

JavaScript decodeURI() Function

Function Reference JavaScript Global Functions

Example

Decode a 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;

The result of res will be:

my%20test.asp?name=st%C3%A5le&car=saab      // Encoded URI
my test.asp?name=ståle&car=saab             // Decoded URI

Try it yourself »


Definition and Usage

The decodeURI() function is used to decode a URI.

Tip: Use the encodeURI() function to encode a URI.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The decodeURI() function is supported in all major browsers.


Syntax

decodeURI(uri)

Parameter Values

Parameter Description
uri Required. The URI to be decoded

Return Value

Type Description
String The decoded URI


Function Reference JavaScript Global Functions

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates FREE Website Templates Free HTML Templates

SHARE THIS PAGE

facebook