JavaScript decodeURIComponent

decodes a URI component.

Function

decodeURIComponent ( encodedURI )

Parameters

encodedURI - An encoded component of a URI (Uniform Resource Identifier).

Return value

A decoded version of the given encoded URI (Uniform Resource Identifier) component.

Example

try {
  const a = decodeURIComponent(
    "https%3A%2F%2Furldecoder.net%2F%3Fa%3Djavascript-decodeURIComponent"
  )
} catch(e) {
  console.error(e);
}

Output

https://urldecoder.net/javascript-decodeuricomponent

Github

See also: