Free URL Encoder/Decoder β Convert URLs for Web Use Instantly
Introduction
Need to encode or decode URLs for web use? Our URL Encoder/Decoder Tool instantly converts special characters in URLs to percent-encoded format and back. Perfect for web developers, API integration, and anyone working with query parameters, form data, or web addresses.
This free tool is essential for creating valid URLs, passing data in query strings, and ensuring proper URL formatting. No manual conversion required β just paste your URL or text and encode or decode instantly.
π‘ From my experience: As a developer, I use this tool daily. Improperly encoded URLs are the #1 cause of broken API requests and tracking parameters. This tool ensures your special characters are safely converted to percent-encoded format for valid HTTP transmission. It's essential for UTM parameters and query strings.
What is URL Encoding?
URL encoding (also called percent-encoding) converts characters into a format that can be transmitted over the Internet. It replaces unsafe ASCII characters with a "%" followed by two hexadecimal digits representing the character's ASCII code.
π Example:
Original: Hello World!
URL Encoded: Hello%20World%21
Explanation: Space β %20, ! β %21
Why URL Encoding Matters
URL encoding serves critical purposes:
Valid URLs
URLs can only contain certain characters (A-Z, a-z, 0-9, and a few special characters). Everything else must be encoded.
Data Transmission
Pass data safely in query strings, form submissions, and API requests without breaking the URL structure.
Special Character Handling
Characters like spaces, &, =, ?, #, and / have special meaning in URLs and must be encoded when used as data.
International Characters
Non-ASCII characters (Γ©, Γ±, δΈζ) must be encoded for universal compatibility.
Common URL Encoding Examples
Understanding frequently encoded characters:
| Character | Encoded | Common Use |
|---|---|---|
| Space | %20 or + | Most common encoding |
| ! | %21 | Exclamation mark |
| # | %23 | Fragment identifier |
| $ | %24 | Dollar sign |
| & | %26 | Query parameter separator |
| = | %3D | Key-value separator |
| ? | %3F | Query string start |
| @ | %40 | Email addresses |
Practical Use Cases
1. UTM Parameters for Marketing
Track campaign performance with encoded UTM parameters:
Original:
utm_campaign=Summer Sale 2025
Encoded:
utm_campaign=Summer%20Sale%202025
Full URL:
https://example.com?utm_source=email&utm_campaign=Summer%20Sale%202025
2. API Requests with Special Characters
Passing data to APIs requires proper encoding:
Search query: "best coffee & tea"
Encoded: best%20coffee%20%26%20tea
API URL: /api/search?q=best%20coffee%20%26%20tea
3. Email Links (mailto:)
Pre-fill email subject and body:
Subject: Question about Product #123
Encoded: Question%20about%20Product%20%23123
Link: mailto:support@example.com?subject=Question%20about%20Product%20%23123
4. Social Media Sharing
Share URLs with pre-filled text:
Tweet text: Check out this amazing tool!
Encoded: Check%20out%20this%20amazing%20tool%21
Twitter URL: https://twitter.com/intent/tweet?text=Check%20out%20this%20amazing%20tool%21
URL Encoding vs Other Encoding Types
URL Encoding (Percent-Encoding)
Used for URLs and query strings. Converts characters to %XX format.
HTML Entity Encoding
Used in HTML content. Converts < to < and > to >
Base64 Encoding
Used for binary data in text format. Not the same as URL encoding.
JavaScript encodeURI vs encodeURIComponent
- encodeURI(): Encodes full URL, preserves :, /, ?, &
- encodeURIComponent(): Encodes everything except A-Z, a-z, 0-9, -, _, ., ~
Common URL Encoding Mistakes
Mistake 1: Double Encoding
Problem: Encoding already-encoded URLs.
Example: %20 becomes %2520
Solution: Decode first, then encode, or check if already encoded.
Mistake 2: Not Encoding Reserved Characters
Problem: Using & or = in parameter values without encoding.
Example: ?name=John&Jane (breaks into two parameters)
Solution: ?name=John%26Jane
Mistake 3: Encoding the Entire URL
Problem: Encoding the protocol and domain.
Wrong: https%3A%2F%2Fexample.com
Right: https://example.com?param=encoded%20value
Mistake 4: Using + Instead of %20 in Paths
Problem: + is for query strings, not URL paths.
Wrong: /path/my+file.pdf
Right: /path/my%20file.pdf
Security Considerations
URL Injection Attacks
Attackers can inject malicious code through unencoded URLs:
- XSS (Cross-Site Scripting): Inject JavaScript in URL parameters
- Open Redirect: Manipulate redirect URLs
- SQL Injection: Inject database commands via URL
Best Security Practices
- Always encode user input: Never trust user-provided data
- Validate after decoding: Check for malicious patterns
- Use parameterized queries: Don't concatenate URLs with user input
- Whitelist allowed characters: Reject unexpected characters
International Character Support
UTF-8 Encoding
Non-ASCII characters are encoded as UTF-8 bytes:
Character: Γ© (e with acute accent)
UTF-8 bytes: C3 A9
URL encoded: %C3%A9
Emoji in URLs
Emojis require multiple bytes:
Emoji: π (grinning face)
URL encoded: %F0%9F%98%80
Developer Tips
When to Encode
- Query parameters: Always encode values
- Form data: Browsers auto-encode, but verify
- API requests: Encode before sending
- Dynamic URLs: Encode user-generated content
When NOT to Encode
- Static URLs: Pre-encoded URLs don't need re-encoding
- URL structure: Don't encode https://, /, ?
- Already encoded: Check first to avoid double encoding
Testing Your URLs
- Encode the URL using this tool
- Copy the encoded URL
- Paste into browser address bar
- Verify it loads correctly
- Check server logs for proper decoding
URL Structure Breakdown
Understanding which parts need encoding:
Full URL:
https://user:pass@example.com:8080/path/to/page?key=value&foo=bar#section
Components:
- Scheme: https:// (never encode)
- Credentials: user:pass@ (encode if needed)
- Host: example.com (never encode)
- Port: :8080 (never encode)
- Path: /path/to/page (encode spaces/special chars)
- Query: ?key=value&foo=bar (encode values)
- Fragment: #section (encode if needed)
Conclusion
Whether you're a developer debugging an API or a marketer building tracking links, correct URL encoding is non-negotiable. Our free URL Encoder/Decoder ensures your URLs are valid, safe, and ready for the web.
Bookmark this tool for quick access whenever you need to sanitize a URL or decode a complex query string. It's fast, private, and works right in your browser.




