SEOlust
Text/Utilities

URL Encoder/Decoder

Encode and decode URLs.

All tools
0 characters 0 lines

📚 Quick Examples

🌐 URL with Spaces
Before: hello world
After: hello%20world
✨ Special Characters
Before: café & résumé
After: caf%C3%A9%20%26%20r%C3%A9sum%C3%A9
🔍 Query String
Before: name=John Doe
After: name%3DJohn%20Doe
💡 Symbols
Before: email@site.com
After: email%40site.com

💡 When to Use URL Encoding:

  • Query Parameters: Encoding search terms, filters, and parameters in URLs
  • Special Characters: Spaces, &, =, ?, #, %, and non-ASCII characters
  • API Requests: Properly formatting URLs for REST APIs
  • Form Submissions: Encoding form data in GET requests
  • SEO & Analytics: Clean URLs with encoded UTF-8 characters
  • Email Links: Encoding subject lines and body text in mailto: links

🔤 Common Character Encodings

Space %20 or +
! %21
" %22
# %23
$ %24
% %25
& %26
' %27
( %28
) %29
* %2A
+ %2B
, %2C
/ %2F
: %3A
; %3B
= %3D
? %3F
@ %40
[ %5B
] %5D

How to Use URL Encoder/Decoder Tool

Encode and decode URLs instantly with our free tool. Convert special characters, spaces, and symbols into URL-safe format. Perfect for web developers, SEO professionals, and anyone working with URLs. Supports bulk processing, UTF-8 characters, and bidirectional conversion.

Getting Started with URL Encoding

URL encoding (percent-encoding) converts special characters into a format that can be safely transmitted in URLs.

  • Enter Text: Paste URLs, query strings, or any text that needs encoding
  • Encode: Click "Encode URL" to convert special characters to %XX format
  • Decode: Click "Decode URL" to convert %XX format back to readable text
  • Bulk Processing: Enter multiple URLs (one per line) to process all at once
  • Copy Result: Click copy button to use encoded/decoded text
  • Swap: Exchange input and output to continue processing
  • Examples: Click example cards to see encoding in action

What is URL Encoding and Why Is It Needed?

URLs can only safely transmit certain ASCII characters. Other characters must be encoded.

  • Reserved Characters: Special characters like ?, &, =, #, /, : have specific meanings in URLs and must be encoded when used as data
  • Unsafe Characters: Spaces, quotes, <, >, {, } can break URLs or cause security issues
  • Non-ASCII: Characters like é, ñ, 中 must be encoded as UTF-8 bytes
  • Space Encoding: Space becomes %20 (or + in query strings)
  • Example: "hello world" becomes "hello%20world"
  • Use Cases: Search queries, form data, API parameters, email links

Common URL Encoding Use Cases

When and where you need to use URL encoding in web development:

  • Query Parameters: Encoding search terms: ?q=hello%20world&filter=tech%20news
  • Form Submissions: GET requests with form data: name=John%20Doe&email=user%40example.com
  • API Requests: REST APIs require encoded parameters: /api/search?term=caf%C3%A9
  • Email Links: mailto: links with subject/body: mailto:user@example.com?subject=Hello%20World&body=Message%20here
  • Social Sharing: Pre-filled social media posts with encoded text
  • Analytics: UTM parameters with encoded campaign names
  • Redirects: Passing URLs as parameters: ?redirect=https%3A%2F%2Fexample.com
  • File Downloads: Filenames with spaces or special characters in download URLs

Understanding Percent Encoding Format

How the %XX encoding format works and what it represents:

  • Format: Percent sign (%) followed by two hexadecimal digits
  • Example: Space = %20 (hex 20 = decimal 32 = space in ASCII)
  • UTF-8: Non-ASCII characters use multiple bytes: café = caf%C3%A9
  • Case Insensitive: %20 and %20 are the same (uppercase preferred)
  • Reserved vs Unreserved: A-Z, a-z, 0-9, -, _, ., ~ are safe (never encoded)
  • Must Encode: Space ! " # $ % & ' ( ) * + , / : ; = ? @ [ ]
  • Double Encoding: Encoding already encoded URLs creates %25XX format

Encoding vs Decoding: When to Use Each

Understanding when to encode versus decode URLs:

  • Encode Before: Sending data to server, creating shareable links, building API requests, generating email links
  • Decode After: Reading query parameters, debugging URLs, displaying to users, extracting data from URLs
  • Do Not Double Encode: Check if URL is already encoded before encoding again
  • Security: Always validate decoded URLs before using them (prevent injection attacks)
  • Logging: Decode URLs in logs for readability, keep encoded in storage

FAQ

What is the difference between URL encoding and Base64 encoding?
URL encoding (percent-encoding) converts special characters to %XX format specifically for URLs. Base64 encoding converts data to alphanumeric strings for general data transmission. Use URL encoding for URLs and query parameters. Use Base64 for encoding binary data, images, or authentication tokens.
Should I encode the entire URL or just the parameters?
Only encode the parts that need it - typically query parameter values and path segments with special characters. Do not encode the entire URL including http://, //, and domain. Example: Encode "hello world" to "hello%20world" but keep https://example.com/ as-is.
Why does space become %20 sometimes and + other times?
Both are valid but used in different contexts. %20 is the standard URL encoding for space. + is a shorthand used specifically in query strings (application/x-www-form-urlencoded). Modern applications prefer %20 for consistency. Our tool uses %20.
What happens if I encode an already encoded URL?
Double encoding occurs - the % sign itself gets encoded to %25. Example: "hello%20world" becomes "hello%2520world". This causes errors. Always check if a URL is already encoded before encoding again.
Can this tool handle non-English characters?
Yes, the tool fully supports UTF-8 encoding. Characters like é, ñ, 中, مرحبا are properly converted to their %XX%XX%XX multi-byte representations. This ensures international characters work correctly in URLs.
Is URL encoding the same as HTML encoding?
No, they are different. URL encoding uses %XX format for URLs. HTML encoding uses &entity; or &#XX; format for HTML content. Use URL encoding for URLs and HTML encoding for displaying special characters in HTML pages.
How do I encode URLs in my programming language?
Most languages have built-in functions: JavaScript (encodeURIComponent), PHP (urlencode), Python (urllib.parse.quote), Java (URLEncoder.encode), Ruby (CGI.escape). Use these instead of manual encoding for security and correctness.
Why do I see %2F in some URLs instead of /?
Forward slash (/) is a reserved character that separates URL path segments. It should NOT be encoded in normal paths. But if the slash is part of data (like a filename), it must be encoded as %2F to avoid misinterpretation.
Can I use this tool for encoding email addresses?
Yes, especially for mailto: links. The @ symbol should be encoded as %40 in query parameters but not in the email address itself. Example: mailto:user@example.com?subject=Hello%20World
Does URL encoding affect SEO?
Properly encoded URLs are good for SEO. They ensure URLs work correctly, look clean in search results when decoded, and handle international characters. Avoid excessive encoding - keep URLs readable when possible. Google decodes URLs for display.

Related tools

Pro tip: pair this tool with ASCII Art Generator and Small Text Generator for a faster SEO workflow.