{}DevStringToolsAll tools
Blog/

URL Encode Decode: Safely Handle Special Characters in URLs

Free URL encoder/decoder online. Encode query strings, paths, and full URLs. Properly handles spaces, ampersands, Unicode characters, and special symbols.

url encodepercent encodingurl decoderURI encodingdeveloper tools

URLs are designed for ASCII text, but real-world data includes spaces, emoji, international characters, and special symbols. When you need to include any of these in a URL—whether as a query parameter, path segment, or fragment—the browser needs percent encoding to interpret them correctly.

The problem: spaces become + or %20, ampersands split parameters, and Unicode characters need multi-byte encoding. Manually constructing these encoded URLs is error-prone.

This URL encoder online tool handles all of it, encoding and decoding URLs instantly in your browser.

How to Use This URL Encoder Online

Before: Manual Encoding Errors

You want to search a product catalog for "wireless headphones & earbuds":

Broken attempt:

https://store.example.com/search?q=wireless headphones & earbuds

The browser interprets this as three separate parameters: q=wireless, headphones (no value), and earbuds. The results are wrong.

After: Correctly Encoded Query String

Encoded URL:

https://store.example.com/search?q=wireless%20headphones%20%26%20earbuds

Now the search parameter contains exactly what you intended: the space becomes %20, and the ampersand becomes %26 so it's treated as part of the search term, not a parameter separator.

Encoding a Full URL with Multiple Parameters

Suppose you're building a search with filters:

Input URL:

https://api.example.com/products?category=electronics&brand=Apple®&price=100-500&q=wireless headphones

Encoded output:

https://api.example.com/products?category=electronics&brand=Apple%C2%AE&price=100-500&q=wireless%20headphones

Notice:

  • ® (registered trademark symbol) becomes %C2%AE (UTF-8 encoding)
  • Space becomes %20
  • Ampersands (&) used as parameter separators are preserved
  • Hyphens and numbers pass through unchanged

Decoding URL-Encoded Strings

Paste any encoded URL or parameter to decode it back to human-readable text:

Input:

Search%20for%3A%20%E4%B8%AD%E6%96%87%E5%90%8D%E5%AD%97

Output:

Search for: 中文字符

The UTF-8 encoded Chinese characters decode correctly to their original form.

When to Use URL Encoding

URL encoding is essential in these scenarios:

  1. Query string parameters: Any value containing spaces, &, =, or special characters
  2. Path segments: User-generated content in URLs, like /users/john doe/profile
  3. Hash fragments: Client-side routing with special characters
  4. API documentation: Showing example URLs with placeholder values
  5. Form submissions: GET requests where form data becomes query parameters

FAQ

What's the difference between %20 and + for spaces? In query strings, both + and %20 represent spaces. However, + only works for spaces, while %20 works everywhere (paths, fragments, anywhere in the URL). Modern practice prefers %20 for consistency, though + persists in legacy systems.

How are emoji encoded in URLs? Emoji like 🚀 are multi-byte UTF-8 characters. Each byte gets percent-encoded: 🚀 becomes %F0%9F%9A%80. This can make URLs quite long for emoji-heavy content.

Should I encode the entire URL or just the parts that need it? Only encode the dynamic parts—query parameter values, path segments with user content. The URL scheme (https://), domain, and static path segments should remain unencoded for readability.

Related Tools