URL decoding with Javascript
Published Date: September 9, 2022
Updated Date: September 9, 2022
URL decoding in javascript is probably the easiest of the lot and hence we are covering it the first. You can encode URI components like a string or part of a string or a URL using the decodeURIComponent()
Here is a quick example, of how to encode a URL or string using javascript
const value = "Tööls Cönverters xyz URLEncoder@Javascript"
const encodedValue = encodeURIComponent(value)
console.log(encodedValue)
Output:
// T%C3%B6%C3%B6ls%20C%C3%B6nverters%20xyz%20URLEncoder%40Javascript
Now, let us decode the above coded string
const value =
"T%C3%B6%C3%B6ls%20C%C3%B6nverters%20xyz%20URLEncoder%40Javascript"
const decodedValue = decodeURIComponent(value)
console.log(decodedValue)
Output:
// Tööls Cönverters xyz URLEncoder@Javascript
Related Decoding techniques:
- URL decoding with Javascript
- URL decoding with Python
- URL decoding with Ruby
- URL decoding with Java
- URL decoding with Golang
Related Encoding techniques:
- URL encoding with Javascript
- URL encoding with Python
- URL encoding with Ruby
- URL encoding with Java
- URL encoding with Golang
There are many applications that require you to encode your URL into a format that the systems can understand. If you wish to encode a URL, check out our free online URL Encoder.
Some systems communicate with encoded URLs, so you may need to decode a URL. If you want to decode a URL online, we have our free online URL Decoder.