URL Encoder/Decoder

Encode or decode URLs and query string parameters instantly.

This tool is for informational and educational purposes only. It is not a substitute for professional financial, medical, legal, or engineering advice. See Terms of Service.

Can't find what you need?

Request a Tool

How to Use the URL Encoder/Decoder

This tool encodes special characters in URLs to their percent-encoded equivalents, or decodes percent-encoded URLs back to readable text. All processing happens in your browser.

  1. Select your mode. Choose "Encode" to convert text into a URL-safe format, or "Decode" to convert a percent-encoded string back to readable text.
  2. Choose the encoding type. When encoding, check "Encode component" to encode all special characters (best for query string values). Uncheck it to preserve URL structure characters like :, /, and ? (best for full URLs).
  3. Enter your text. Type or paste your URL, query parameter, or text. The result updates instantly as you type.
  4. Read the result. The encoded or decoded output appears in the output box. The result card shows the character count for quick reference.
  5. Copy or share. Click Copy to copy the result to your clipboard, or Share to generate a link with your input pre-filled.

The "Encode component" checkbox controls whether the tool uses JavaScript's encodeURIComponent (encodes everything except letters, digits, and - _ . ~ ) or encodeURI (preserves URL structure characters like : / ? # [ ] @ ! $ & ' ( ) * + , ; =). Use encodeURIComponent for individual query string values and encodeURI for full URLs.

About URL Encoding

URL encoding (also called percent encoding) replaces unsafe characters in URLs with a percent sign followed by two hexadecimal digits. For example, a space becomes %20, an ampersand becomes %26, and a forward slash becomes %2F. This is defined in RFC 3986.

URLs can only contain a limited set of ASCII characters. Any character outside this set (including Unicode characters, spaces, and certain punctuation) must be percent-encoded before it can appear in a URL. Web browsers often handle this automatically, but developers working with APIs, query strings, and form data need to encode values manually to avoid broken URLs and security issues.

The distinction between encodeURI and encodeURIComponent is important. encodeURI is for complete URLs where you want to preserve the structure. encodeURIComponent is for individual values within the URL, like a search query or a file name with special characters.

Frequently Asked Questions

What is the difference between encodeURI and encodeURIComponent?

encodeURI encodes a full URL but preserves characters that are part of URL syntax: colons, slashes, question marks, hash signs, and others. encodeURIComponent encodes everything except letters, digits, and a few safe characters (- _ . ~). Use encodeURIComponent for query string values, path segments, or any individual piece of a URL. Use encodeURI when you have a complete URL and want to fix only the unsafe characters without breaking the structure.

Why do spaces sometimes appear as %20 and sometimes as +?

The %20 encoding comes from RFC 3986 (URI syntax) and is the standard way to encode spaces in URLs. The + encoding comes from the application/x-www-form-urlencoded format used by HTML forms. Both represent a space character. Modern web APIs typically use %20, while HTML form submissions use +. This tool uses %20 (the encodeURIComponent standard). If you need + encoding for form data, replace %20 with + in the output.

Can I use this tool for encoding non-English characters?

Yes. JavaScript's encodeURIComponent handles Unicode by first converting characters to UTF-8 bytes, then percent-encoding each byte. For example, the character "cafe" with an accent becomes caf%C3%A9. Chinese, Japanese, Arabic, emoji, and all other Unicode characters encode correctly. The decoder reverses this process to restore the original characters.

When do I need to URL encode my data?

You need URL encoding whenever you include user input or dynamic data in a URL. Common situations include: building query strings for API calls, constructing redirect URLs, passing data through URL parameters, encoding file names with spaces or special characters in download links, and creating mailto: links with pre-filled subjects and bodies. Skipping URL encoding can cause broken links, data loss, or security vulnerabilities like injection attacks.