URL Encoder / Decoder

Encode and decode URLs instantly. Convert special characters to URL-safe format and back.

How to Use the URL Encoder

  1. Paste your URL or text into the input field above.
  2. Choose Encode or Decode mode. Encode converts special characters to percent-encoded format. Decode reverses it.
  3. Copy the result using the Copy button and use it in your code, API calls, or wherever needed.

How It Works

URL encoding replaces unsafe ASCII characters with a percent sign (%) followed by two hexadecimal digits. For example, a space becomes %20, and an ampersand becomes %26.

This tool uses JavaScript's built-in encodeURIComponent() and decodeURIComponent() functions, which handle the full range of Unicode characters.

Common Use Cases

  • Query parameters - Encode user input before adding it to URL query strings
  • API requests - Ensure special characters in request bodies are properly encoded
  • Form submissions - HTML forms automatically encode, but manual encoding helps debug
  • SEO - Decode URLs from search console to read them clearly
  • Email links - Encode URLs embedded in email bodies to prevent breaking

Frequently Asked Questions

What is URL encoding?

URL encoding (also called percent encoding) converts characters that are not allowed in a URL into a format that can be transmitted over the Internet. For example, a space becomes %20, an ampersand (&) becomes %26, and a question mark (?) becomes %3F.

When do I need to encode a URL?

You need to encode URLs when passing special characters in query parameters, form submissions, API calls, or when embedding a URL inside another URL. For example, if your search query contains spaces or symbols, those must be encoded.

What is the difference between encodeURI and encodeURIComponent?

encodeURI keeps the URL structure intact (preserves ://, /, ?, #). encodeURIComponent encodes everything including those characters. Use encodeURIComponent for query parameter values, and encodeURI for full URLs.

Is URL encoding the same as percent encoding?

Yes, URL encoding and percent encoding are the same thing. The term "percent encoding" comes from the use of the percent sign (%) followed by two hexadecimal digits to represent each encoded character.

Does this tool send my data to a server?

No. All encoding and decoding happens entirely in your browser using JavaScript. Your input is never sent to or stored on any server, making this tool completely private and secure.

More Free Tools

Explore our collection of free online tools