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 »

Description

The decodeURI() method decodes a URI.

Note

Use the encodeURI() method to encode a URI

See Also:

The encodeURIComponent() method to encode a URI

The decodeURIComponent() method to decode a URI


Syntax

decodeURI(uri)

Parameters

Parameter Description
uri Required.
The URI to decode.

Return Value

Type Description
A stringThe decoded URI.

Browser Support

decodeURI() is an ECMAScript1 (ES1) feature.

ES1 (JavaScript 1997) is fully supported in all browsers:

Chrome Edge Firefox Safari Opera IE
Yes Yes Yes Yes Yes Yes

Copyright 1999-2023 by Refsnes Data. All Rights Reserved.