URL Encoder/Decoder
Encode and decode URLs instantly. Convert special characters to URL-safe format or decode encoded URLs back to readable text. Perfect for web developers, SEO professionals, and anyone working with URLs.
What is URL Encoding?
URL encoding (percent encoding) converts special characters to URL-safe format. Spaces become %20, ampersands become %26. Essential for URLs with special characters, query parameters, or non-English text. Our tool handles encoding and decoding instantly with real-time results.
Mode
Input
Common Encodings
Encoded Result
Analysis
Statistics
Usage Tips
Batch Processing
Paste multiple URLs (one per line) to encode or decode them all at once.
Avoid Double Encoding
Always decode first before re-encoding. Double encoding breaks URLs.
International Characters
UTF-8 encoding works for all languages, emojis, and special characters.
Make URLs Safe for the Web
Imagine sending someone a link to search for "coffee & tea" on your website, but when they click it, the search breaks or returns wrong results because the ampersand (&) has special meaning in URLs. Or you receive an analytics report with URLs full of %20 and %3F making them completely unreadable—you have no idea what pages people actually visited. These problems happen because URLs have strict rules about which characters they can contain, and special characters must be encoded (converted to %XX format) for URLs to work correctly.
Our URL Encoder/Decoder solves both problems instantly. Need to create a URL with spaces, symbols, or non-English characters? The encoder converts them to URL-safe format (%20 for space, %26 for &). Trying to read an encoded URL full of percent signs and codes? The decoder translates it back to normal, human-readable text. Process single URLs or batch-encode hundreds at once. See results in real-time as you type. Copy the encoded or decoded URLs with one click. Whether you're a developer building URLs programmatically, an SEO analyzing traffic, or someone who just needs to fix a broken link, this tool handles all URL encoding and decoding needs instantly and accurately.
How to Encode or Decode URLs
Choose Encode or Decode
Select "Encode" to convert a readable URL to safe format with special characters encoded. Select "Decode" to convert an encoded URL (with %20, %3F, etc.) back to readable text. Switch between modes instantly.
Paste Your URL or Text
Enter the URL you want to encode or decode. Paste full URLs, query strings, or just the parts with special characters. For batch processing, paste multiple URLs (one per line). The tool handles any length or format.
See Instant Results
Results appear in real-time as you type or paste. For encoding, see which characters get converted to %XX format. For decoding, see the readable text instantly. The tool highlights what changed so you understand the conversion.
Copy and Use
Click "Copy" to copy the encoded or decoded result to clipboard. Use the encoded URL in your web application, API call, or link. Use decoded URLs to understand analytics data or debug issues. Process as many URLs as you need.
Powerful URL Encoding Features
URL Encoding
Convert URLs with spaces, symbols, and special characters to URL-safe format. Automatically encodes all characters that could break URLs or cause issues.
URL Decoding
Translate encoded URLs with %20, %3F, and other codes back to human-readable format. Makes sense of messy-looking URLs instantly.
Batch Processing
Process multiple URLs simultaneously. Paste a list of URLs and encode or decode them all at once. Perfect for bulk operations on log files or data exports.
UTF-8 Support
Correctly encodes international characters from any language—Chinese, Arabic, emoji, accents. Handles UTF-8 encoding to percent-encoded format automatically.
Real-Time Conversion
See results instantly as you type. No need to click buttons—encoding and decoding happens automatically. Immediate feedback helps you learn what gets encoded.
One-Click Copy
Copy results to clipboard with single click. No manual selection needed. Fast and convenient for using results immediately in your work.
Understanding URL Encoding (Percent Encoding)
URL encoding, also called percent encoding, is the process of converting characters into a format that can be safely transmitted in URLs. URLs can only contain a limited set of characters, so other characters must be encoded.
How URL Encoding Works
Characters are encoded as a percent sign (%) followed by two hexadecimal digits representing the character's ASCII or UTF-8 code. For example:
- Space: Encoded as %20 (or + in query strings)
- Ampersand (&): Encoded as %26
- Equals (=): Encoded as %3D
- Question mark (?): Encoded as %3F
- Hash (#): Encoded as %23
Safe vs Unsafe Characters
| Character Type | Characters | Encoding Needed? |
|---|---|---|
| Letters | A-Z, a-z | No (safe) |
| Numbers | 0-9 | No (safe) |
| Unreserved Symbols | - _ . ~ | No (safe) |
| Reserved Characters | : / ? # [ ] @ ! $ & ' ( ) * + , ; = | Yes (must encode) |
| Spaces | (space character) | Yes (becomes %20 or +) |
| Special/International | %, <, >, {, }, |, \, ^, `, ", accents, non-Latin | Yes (must encode) |
Common Use Cases for URL Encoding
Web Development
- Building URLs with query parameters programmatically
- Passing URLs as parameters to other URLs
- Creating safe redirect URLs
- Handling user input in URLs
- API endpoint construction with parameters
Analytics & SEO
- Reading Google Analytics URL reports
- Understanding encoded UTM parameters
- Decoding search query parameters
- Analyzing log files with encoded URLs
- Processing referrer data with special characters
Link Sharing
- Creating shareable links with search queries
- Encoding URLs for email marketing
- Building social media share links
- Creating QR codes with URL parameters
- Generating affiliate links with tracking
Debugging
- Understanding why URLs break
- Identifying double-encoding issues
- Debugging API request failures
- Fixing broken redirect chains
- Troubleshooting form submissions
Common URL Encoding Examples
Here are real-world examples showing what characters look like before and after encoding:
Basic Special Characters
| Original | Encoded | Use Case |
|---|---|---|
| hello world | hello%20world | Spaces in search queries |
| coffee & tea | coffee%20%26%20tea | Ampersands in text |
| price=$50 | price%3D%2450 | Dollar signs and equals |
| 100% cotton | 100%25%20cotton | Percent signs (% becomes %25) |
| red+blue | red%2Bblue | Plus signs |
URLs as Parameters
Original: Passing a URL as a parameter
Encoded: The inner URL gets encoded
Search Queries
Original: Search for "how to encode URLs?"
Encoded: Spaces and question mark encoded
International Characters
| Original | Encoded | Language |
|---|---|---|
| café | caf%C3%A9 | French (é) |
| niño | ni%C3%B1o | Spanish (ñ) |
| 你好 | %E4%BD%A0%E5%A5%BD | Chinese |
| Москва | %D0%9C%D0%BE%D1%81%D0%BA%D0%B2%D0%B0 | Russian |
| 😀 | %F0%9F%98%80 | Emoji |
When to Encode vs When to Decode
When to Encode URLs
- Building URLs Programmatically: When constructing URLs in code with user input or dynamic data
- Passing URLs as Parameters: When one URL contains another URL as a query parameter
- Form Submissions: When form data with special characters is submitted via GET request
- API Requests: When sending data to APIs that require URL-encoded parameters
- Email Links: When creating links to include in emails (email clients may break unencoded URLs)
- QR Codes: When generating QR codes containing URLs with parameters
- Tracking Links: When adding UTM parameters or tracking codes to URLs
When to Decode URLs
- Reading Analytics: When viewing Google Analytics or other analytics tools showing encoded URLs
- Log File Analysis: When processing server logs with percent-encoded URLs
- Debugging: When you need to understand what an encoded URL actually represents
- Data Export Processing: When working with exported data containing encoded URLs
- User Display: When showing URLs to users in a readable format
- Database Queries: When searching databases for URLs in their readable form
- Understanding Errors: When error messages contain encoded URLs you need to interpret
URL Encoding Best Practices
Encode Only What Needs Encoding
Don't encode entire URLs—preserve the structure (protocol, domain, path separators). Only encode the values that contain special characters. For example, encode query parameter values, not the entire URL including https:// and domain.
Avoid Double Encoding
Never encode an already-encoded URL. Double encoding breaks URLs by encoding the % signs themselves (%20 becomes %2520). Always check if a URL is already encoded before encoding it again. When in doubt, decode first, then re-encode if needed.
Use Proper Encoding for Context
Different parts of URLs have different encoding rules. The path, query string, and fragment each have slightly different safe characters. Use proper encoding functions for each context rather than blanket encoding everything.
Handle UTF-8 Correctly
Always use UTF-8 encoding for international characters. Don't use other encodings like ISO-8859-1 or Windows-1252. UTF-8 is the web standard and ensures characters from all languages work correctly in URLs.
Test Encoded URLs
After encoding, test the URL to verify it works correctly. Click it, pass it to the API, or submit the form to ensure encoding didn't break functionality. Some systems are sensitive to encoding differences.
Document Encoding Expectations
When building APIs or systems, clearly document whether parameters should be URL-encoded or not. This prevents confusion when integrating systems and helps developers use your API correctly.
Common URL Encoding Mistakes
Mistake 1: Encoding the Entire URL
Wrong: Encoding the complete URL including protocol and domain
Correct: Only encode the parameter values
Why: Encoding the protocol and domain breaks the URL structure. Web browsers and servers can't interpret fully-encoded URLs.
Mistake 2: Double Encoding
Problem: Encoding an already-encoded URL
First encoding: hello%20world
Double encoded: hello%2520world (% becomes %25)
Result: The space never gets decoded properly. Server sees "%20" as literal text instead of space.
Mistake 3: Using + for Space in Paths
Wrong: Using + to encode spaces in URL paths
Correct: Use %20 in paths (+ only works in query strings)
Mistake 4: Forgetting to Encode Ampersands
Problem: Using & in parameter values without encoding
Why It Breaks: The & is interpreted as separating parameters, so "tea" becomes a new parameter instead of part of the search query.
Correct: Encode the ampersand
Mistake 5: Mixing Encoding Types
Problem: Confusing URL encoding with HTML encoding
- URL Encoding: Space = %20, & = %26
- HTML Encoding: Space = , & = &
Don't use HTML entities in URLs. They don't work and will appear as literal text like "&" instead of "&".
URL Encoding in Different Programming Languages
JavaScript
encodeURIComponent("hello world & more");
// Returns: "hello%20world%20%26%20more"
// Encode URL (preserves / : ?)
encodeURI("https://example.com/hello world");
// Returns: "https://example.com/hello%20world"
// Decode
decodeURIComponent("hello%20world%20%26%20more");
// Returns: "hello world & more"
PHP
urlencode("hello world & more");
// Returns: "hello+world+%26+more" (+ for space)
// Encode preserving / (RFC 3986)
rawurlencode("hello world & more");
// Returns: "hello%20world%20%26%20more"
// Decode
urldecode("hello+world+%26+more");
// Returns: "hello world & more"
Python
# Encode
quote("hello world & more")
# Returns: 'hello%20world%20%26%20more'
# Decode
unquote("hello%20world%20%26%20more")
# Returns: 'hello world & more'
Java
import java.net.URLDecoder;
// Encode
URLEncoder.encode("hello world & more", "UTF-8");
// Returns: "hello+world+%26+more"
// Decode
URLDecoder.decode("hello+world+%26+more", "UTF-8");
// Returns: "hello world & more"
Troubleshooting URL Encoding Issues
Issue: URL Not Working After Encoding
Symptoms: Encoded URL returns 404, broken link, or doesn't load
Common Causes:
- Encoded the entire URL including protocol and domain
- Double encoding occurred
- Used wrong encoding for the context
- Server doesn't properly decode URLs
Solutions: Decode and re-encode properly, verify server configuration accepts encoded URLs, test step-by-step.
Issue: Special Characters Breaking Queries
Problem: Search queries or form submissions with & or = break
Solution: These characters have special meaning in URLs (parameter separators). Always encode them in parameter values: & becomes %26, = becomes %3D.
Issue: International Characters Display Wrong
Problem: Non-English characters show as �� or garbage
Solution: Use UTF-8 encoding consistently. Ensure your pages declare UTF-8 charset, and URL encoding uses UTF-8. Mixing encodings causes character corruption.