🌐
W3Schools
w3schools.com › jsref › jsref_encodeuricomponent.asp
JavaScript encodeURIComponent() Method
The encodeURIComponent() method encodes special characters including: , / ? : @ & = + $ # Use the decodeURIComponent() function to decode an encoded URI component. ... If you want to use W3Schools services as an educational institution, team ...
🌐
W3Schools
w3schools.com › jsref › jsref_decodeuricomponent.asp
JavaScript decodeURIComponent() Method
❮ Previous JavaScript Global Methods Next ❯ · Decode a URI after encoding it: let uri = "https://w3schools.com/my test.asp?name=ståle&car=saab"; let encoded = encodeURIComponent(uri); let decoded = decodeURIComponent(encoded); Try it Yourself » · The decodeURIComponent() method decodes a URI component.
🌐
W3Schools
w3schools.sinsixx.com › jsref › jsref_encodeuricomponent.asp.htm
JavaScript encodeURIComponent() Function
Free HTML XHTML CSS JavaScript DHTML XML DOM XSL XSLT RSS AJAX ASP ADO PHP SQL tutorials, references, examples for web building.
🌐
W3Schools
w3schools.com › jsref › jsref_encodeuri.asp
JavaScript encodeURI() Method
decodeURI() decodeURIComponent() encodeURI() encodeURIComponent() escape() eval() Infinity isFinite() isNaN() NaN Number() parseFloat() parseInt() String() undefined unescape() JS Intl Namespace JS Iterators
🌐
Cach3
w3schools.com.cach3.com › jsref › jsref_encodeuricomponent.asp.html
JavaScript encodeURIComponent() Function - W3Schools
❮ JavaScript Global Functions · Encode a URI: var uri = "https://w3schools.com/my test.asp?name=ståle&car=saab"; var res = encodeURIComponent(uri); Try it Yourself » · The encodeURIComponent() function encodes a URI component. This function encodes special characters.
🌐
W3schoolsapp
w3schoolsapp.com › jsref › jsref_encodeuricomponent.html
JavaScript encodeURIComponent() Function
❮ Previous JavaScript Global Functions Next ❯ · Encode a URI: var uri = "https://w3schools.com/my test.asp?name=stÃ¥le&car=saab"; var res = encodeURIComponent(uri); Try it Yourself » · The encodeURIComponent() function encodes a URI component. This function encodes special characters.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › encodeURI
encodeURI() - JavaScript - MDN Web Docs
July 8, 2025 - const name = "Ben & Jerry's"; // This is bad: const link = encodeURI(`https://example.com/?choice=${name}`); // "https://example.com/?choice=Ben & Jerry's" console.log([...new URL(link).searchParams]); // [['choice', 'Ben '], [" Jerry's", ''] // Instead: const link = encodeURI( `https://example.com/?choice=${encodeURIComponent(name)}`, ); // "https://example.com/?choice=Ben%20%26%20Jerry's" console.log([...new URL(link).searchParams]); // [['choice', "Ben & Jerry's"]]
🌐
W3Schools
www-db.deis.unibo.it › courses › TW › DOCS › w3schools › jsref › jsref_encodeuricomponent.asp.html
JavaScript encodeURIComponent() Function
January 25, 2015 - JavaScript Global Functions · ... res will be: http://w3schools.com/my test.asp?name=ståle&car=saab Try it Yourself » · The encodeURIComponent() function encodes a URI component....
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › encodeURIComponent
encodeURIComponent() - JavaScript - MDN Web Docs
October 30, 2025 - The encodeURIComponent() function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters).
Find elsewhere
🌐
W3Resource
w3resource.com › javascript › functions › encodeURIComponent-function.php
JavaScript encodeURIComponent functions - w3resource
August 19, 2022 - The encodeURIComponent function is used to encodes a Uniform Resource Identifier (URI) component by replacing each instance of certain characters by one, two or three escape sequences representing the UTF-8 encoding of the character. ...
🌐
TutorialsPoint
tutorialspoint.com › article › encodeuricomponent-function-in-javascript
encodeURIComponent() function in JavaScript
March 15, 2026 - The encodeURIComponent() function accepts a string representing a URI component and encodes it by replacing special characters with percent-encoded sequences. This is essential for safely passing data in URLs.
🌐
jsschools
jsschools.com › js › reference › global › encodeURIComponent
encodeURIComponent() — JavaScript Reference — jsschools
encodeURIComponent(str) string — The encoded string. URIError — The input contains a lone surrogate. console.log(encodeURIComponent("a b&c=d")); Output · a b&c=d · const q = encodeURIComponent("café/parís"); console.log(q); Output · café/parís · - Escapes everything except `A-Z a-z 0-9 - _ .
🌐
W3Schools
w3schools.com › jsref › jsref_decodeuri.asp
JavaScript decodeURI() Method
The encodeURIComponent() method to encode a URI · The decodeURIComponent() method to decode a URI · decodeURI(uri) decodeURI() is an ECMAScript1 (JavaScript 1997) feature. It is supported in all browsers: ❮ JavaScript Global Methods Next ...
🌐
GeeksforGeeks
geeksforgeeks.org › how-do-we-use-the-encodeuricomponent-function-in-javascript
How do we use the encodeURIComponent() function in ...
January 30, 2024 - Your All-in-One Learning Portal. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
🌐
W3Schools
w3schools.com › tags › ref_urlencode.asp
HTML URL Encoding Reference
In JavaScript you can use the encodeURIComponent() function.
🌐
Medium
medium.com › @ashishkumarjena1437 › encode-and-decode-uri-in-javascript-a-complete-guide-976f4986f6cf
Encode and Decode URI in JavaScript: A Complete Guide | by Ashishkumarjena | Medium
June 17, 2026 - Here, encodeURIComponent() replaces =, &, and spaces with encoded equivalents, making it ideal for safely passing single parameters.
🌐
freeCodeCamp
freecodecamp.org › news › javascript-url-encode-example-how-to-use-encodeuricomponent-and-encodeuri
JavaScript URL Encode Example – How to Use encodeURIcomponent() and encodeURI()
August 4, 2020 - When accepting query parameters that may have reserved characters. ```JS let params = encodeURIComponent('mango & pineapple') let url = "http://mysite.com/?search=" + params; //http://mysite.com/?search=mango & pineapple
🌐
Mastering JS
masteringjs.io › tutorials › fundamentals › encodeuricomponent
The encodeURIComponent() Function in JavaScript - Mastering JS
The encodeURIComponent() function in JavaScript allows you to encode special characters in your query string that would otherwise change the meaning of your query string.
🌐
W3Schools
w3schools.com › jsref › tryit.asp
The encodeURIComponent() Method
The W3Schools online code editor allows you to edit code and view the result in your browser