URL Encoder & Decoder

Encode and decode URLs and URL components instantly. Supports full URL and component encoding modes. Free and 100% client-side.

Input
Output
Result will appear here...

How to Use the URL Encoder and Decoder

  1. Choose your mode: Select encode to convert a URL or text component to a percent-encoded format, or decode to convert an encoded URL back to readable text.
  2. Select the encoding type: Choose encodeURIComponent for encoding individual URL components (query parameters, path segments) or encodeURI for encoding a complete URL while preserving reserved characters like :// and ?.
  3. Enter your text: Paste the URL or text you want to process. The output updates in real time as you type.
  4. Copy the result: Copy the encoded or decoded output with a single click.

Understanding URL Encoding (Percent Encoding)

URL encoding, also known as percent encoding, is the mechanism by which special characters in a URL are converted to a format that can be safely transmitted over the internet. URLs can only contain a limited set of ASCII characters — primarily letters, digits, and a few reserved symbols. Any character outside this set, including spaces, non-English characters, and certain punctuation marks, must be encoded as a percent sign followed by two hexadecimal digits representing the character byte value.

The distinction between encodeURI and encodeURIComponent is critical for web developers. encodeURI is designed for encoding complete URLs and leaves reserved characters like colons, slashes, question marks, and ampersands intact, since these have structural meaning in URLs. encodeURIComponent is meant for individual components within a URL — such as query parameter values — and encodes all reserved characters, ensuring that values containing special characters do not break the URL structure.

URL encoding is essential for internationalized domain names, query parameters containing user input, API request construction, and data embedded in URLs. For example, a search query containing spaces must encode each space as %20 or + depending on context. Similarly, Unicode characters in URLs must be converted to their UTF-8 byte sequences and then percent-encoded, a process that can produce multi-byte sequences for non-ASCII characters like accented letters or CJK ideographs.

Frequently Asked Questions

What's the difference between encodeURI and encodeURIComponent?
encodeURI preserves URL structural characters like :/?#&= so the URL stays valid. encodeURIComponent encodes everything, making it ideal for individual parameter values.
Why do I need to URL-encode text?
URLs can only contain ASCII characters. Special characters like spaces, ampersands, and non-English letters must be percent-encoded to be transmitted correctly.
Is this tool safe for sensitive data?
Yes. All encoding and decoding happens in your browser. No data is sent to any server.
Does it handle Unicode characters?
Yes. UTF-8 characters are properly encoded to their percent-encoded equivalents (e.g., spaces become %20 or +).
How are spaces encoded in URLs?
Spaces can be encoded as %20 (the percent-encoded form) or as + (in application/x-www-form-urlencoded contexts, such as form submissions). For query parameters, both are commonly accepted, but %20 is the more universally correct encoding for general URL usage.

Related Tools