Online URL Encode And Decode Tool | URL Percent Decoding


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

What is URL Encoding?

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.

Encoded and Decoded URL Samples

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

Reserved and Unreserved Characters in URL Encoding

Certain characters have special meanings in URLs (e.g., ?,=, &). Encoding ensures these are safely used in parameters.

CharacterEncodedUsage
Space%20Used between words
@%40Email addresses
&%26Separates query parameters
=%3DAssigns query parameter value
?%3FStarts query string
#%23Fragment identifier

Frequently Asked Questions (FAQ)

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.

JavaScript Code for URL Encoding and Decoding

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.

JavaScript
// 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!