JavaScript decodeURI() Function

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP







<!--
main_leaderboard, all: [728,90][970,90][320,50][468,60]
-->



JavaScript decodeURI() Function



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














Function
decodeURI() Yes Yes Yes Yes Yes

Syntax



decodeURI(uri)

Parameter Values





Parameter Description
uri Required. The URI to be decoded

Technical Details




Return Value: A String, representing the decoded URI


❮ JavaScript Global Functions