Online URL Encode And Decode Tool | URL Percent Decoding
Contents
Online URL Encoder and Decoder Tool. Use this free online tool to encode or decode URLs instantly. URL encoding (also known as percent encoding) converts special characters into a format that can be safely transmitted over the internet. Similarly, decoding reverses this process, making the URL human-readable again.
URL Decoder Encoder Tool
Simply paste your text or URL into the input box and click on Encode or Decode to get the result instantly.
Add URL or text and click Decoder Encode
URL encoding is a technique used to replace special characters in a URL with a percent sign (%) followed by two hexadecimal digits. This ensures URLs are properly formatted and transmitted over the web. For example, a space becomes %20.
When Do You Need to Encode URLs?
You need to encode a URL when:
- Submitting form data via GET method
- Passing parameters in hyperlinks
- Creating shareable links with dynamic query strings
- Encoding URLs in APIs or JavaScript code
- Avoiding broken links due to special characters
What is URL Decoding?
URL decoding is the reverse process of converting an encoded URL back to its original form. This helps when you need to:
- Read encoded URLs from logs or databases.
- Display readable URLs on your web page.
- Debug URL parameters during development.
Below are some common examples showing how URLs look before and after encoding or decoding. This helps illustrate how special characters are safely represented in web links.
Original URL
https://example.com/search?q=hello world
Encoded URL
https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dhello%20world
Original email
email@example.com
Encoded email
email%40example.com
Original text
Hello & Welcome
Encoded text
Hello%2520%2526%2520Welcome
Certain characters have special meanings in URLs (e.g., ?,=, &). Encoding ensures these are safely used in parameters.
Character | Encoded | Usage |
---|---|---|
Space | %20 | Used between words |
@ | %40 | Email addresses |
& | %26 | Separates query parameters |
= | %3D | Assigns query parameter value |
? | %3F | Starts query string |
# | %23 | Fragment identifier |
What is the difference between encodeURI and encodeURIComponent?
encodeURI
encodes a full URI but leaves certain characters like :, /, ? unescaped. encodeURIComponent
encodes every character, ideal for query parameters.
Can I decode URLs that are double-encoded?
Yes, run the decode function multiple times if needed.
Is URL encoding the same as HTML encoding?
No. HTML encoding is for rendering in HTML (like & for &), whereas URL encoding is for URLs.
Use the following JavaScript code to easily encode or decode URL strings. This is especially useful when handling form inputs, query parameters, or dynamic URLs in web development. JavaScript provides built in functions like encodeURIComponent()
and decodeURIComponent()
to safely manage special characters in URLs.
// Encode a URL component
const encoded = encodeURIComponent("hello world & welcome!");
console.log(encoded); // Output: hello%20world%20%26%20welcome%21
// Decode a URL component
const decoded = decodeURIComponent(encoded);
console.log(decoded); // Output: hello world & welcome!