Toolypet
Dev Tools/URL Encoder/Decoder

URL Encoder/Decoder

Encode or decode URL components and query strings

Input

Output

Result will appear here...

Options

URL Encoding Guide

Learn how to encode and decode URLs properly

What is URL Encoding?

URL encoding converts characters into a format that can be safely transmitted over the Internet. Special characters like spaces, &, ?, and = are converted to percent-encoded values (e.g., space becomes %20).

How to Use This Tool

  1. Enter a URL or text containing special characters
  2. Choose between full URL encoding or component encoding
  3. Click 'Encode' or 'Decode' as needed
  4. Copy the result using the copy button

Pro Tips

  • Use 'Encode Component' for query parameter values only
  • Full URL encoding preserves the URL structure (://, /, etc.)
  • Always encode user input before adding it to URLs to prevent injection

Browser Support

URL encoding uses the standard encodeURIComponent() and encodeURI() functions available in all modern browsers.

Frequently Asked Questions

What's the difference between Encode and Encode Component?

encodeURI() encodes a complete URL while preserving structural characters like ://, /, ?, &, and =. encodeURIComponent() encodes everything including those characters, making it suitable for encoding individual query parameter values.

Why is space encoded as %20 and not +?

Standard URL encoding uses %20 for spaces. The + sign for spaces is only valid in query strings (application/x-www-form-urlencoded format). This tool uses %20 which is universally safe for all parts of a URL.

Why do I need to encode URLs?

URLs can only contain certain ASCII characters. Special characters like spaces, non-ASCII characters (ü, 中), and reserved characters (&, =, ?) must be encoded to be safely transmitted. Unencoded special characters can break URLs or cause security vulnerabilities.

Should I encode the entire URL or just parts of it?

Generally, encode only the values you're inserting into a URL, not the entire URL structure. Use encodeURIComponent() for query parameter values and path segments. Using encodeURI() on an already-formed URL is safe as it preserves the structure.

What is double encoding and how do I avoid it?

Double encoding happens when you encode an already-encoded string, turning %20 into %2520. Only encode raw values once, and decode before re-encoding if you're unsure. This tool will show you the result so you can verify the output is correct.