[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/decodeURI [Back]  [Original]

decodeURI() - JavaScript | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

decodeURI()

Baseline Widely available

This feature is well established and works across many devices and browser versions. Its been available across browsers since 2015 7.

decodeURI() encodeURI URI(Uniform Resource Identifier, ) .

In this article

const uri = "https://mozilla.org/?x=";
const encoded = encodeURI(uri);
console.log(encoded);
// Expected output: "https://mozilla.org/?x=%D1%88%D0%B5%D0%BB%D0%BB%D1%8B"

try {
  console.log(decodeURI(encoded));
  // Expected output: "https://mozilla.org/?x="
} catch (e) {
  // Catches a malformed URI
  console.error(e);
}

js
decodeURI(encodedURI)

encodedURI

(URI)

URI .

encodedURI URIError ("malformed URI sequence") .

URI () encodeURI . # .

URL

js
decodeURI(
  "https://developer.mozilla.org/ru/docs/JavaScript_%D1%88%D0%B5%D0%BB%D0%BB%D1%8B",
);
// "https://developer.mozilla.org/ru/docs/JavaScript_"

js
try {
  var a = decodeURI("%E0%A4%A");
} catch (e) {
  console.error(e);
}

// URIError: malformed URI sequence

Specification
ECMAScript 2027 LanguageSpecification
# sec-decodeuri-encodeduri


Web Proxy Viewer  |  New URL  |  Original Page