URL Encoder & Decoder

Encode special characters in URLs for safe web transmission. Essential for query parameters, redirects, and tracking links.

What is URL Encoding and Why Do You Need It?

Let me share a story from a digital marketing agency owner who almost lost a โ‚น5 lakh campaign because of a simple URL encoding issue.

She was running Google Ads for a client selling "premium silk sarees" and "wedding collections." The tracking URLs had spaces, ampersands (&), and question marks (?) โ€” all characters that break URLs. Her analytics showed zero conversions for three days because the tracking parameters were corrupted.

URL encoding would have fixed this in 10 seconds.

๐Ÿ’ก What is URL Encoding (Percent-Encoding)?

URL encoding converts special characters into a safe format using percent signs (%) followed by two hexadecimal digits. Think of it as a universal translator for web addresses.

Why URLs break without encoding:

  • ๐Ÿ”— Spaces โ€” Browsers may cut off URLs at spaces
  • ๐Ÿ“Š Ampersands (&) โ€” Separate query parameters, can't be in values
  • โ“ Question marks (?) โ€” Mark the start of query string, can't be in paths
  • ๐Ÿ” Hash symbols (#) โ€” Indicate page sections, break parameter values
  • ๐ŸŒ Non-English characters โ€” Only ASCII is allowed in URLs

How encoding works: Each unsafe character becomes a percent sign followed by its ASCII/UTF-8 code. A space becomes %20. An ampersand (&) becomes %26. This ensures your URL works everywhere, every time.

How to Use the URL Encoder/Decoder (Step by Step)

  1. Enter your URL or text โ€” Paste any web address, query string, or form data.
  2. Choose your operation:
    • Encode Full URL โ€” Encodes the entire string (safe for complete URLs)
    • Encode Component Only โ€” Only encodes query parameter values (preserves URL structure)
    • Decode URL โ€” Converts encoded URLs back to readable format
    • Encode Form Data โ€” Encodes form field names and values for POST submissions
  3. Copy and use โ€” Click the copy button and paste into your HTML, JavaScript, or marketing platform.

8 Practical Examples (Real-World Scenarios)

๐Ÿ“Š Example 1: Google Ads Tracking URL with Spaces

The problem: A marketer created a tracking URL: https://shop.com/products?category=wedding sarees&color=red

The issue: The space in "wedding sarees" breaks the URL.

After URL encoding: https://shop.com/products?category=wedding%20sarees&color=red

โœ… Result: The URL works perfectly in Google Ads, Facebook, and email campaigns.

๐Ÿ›๏ธ Example 2: Ecommerce Product URL with Special Characters

The problem: A product named "Premium Cotton Kurti (50% off) - New!" needs a clean URL.

Unsafe URL: /product/Premium Cotton Kurti (50% off) - New!

After encoding: /product/Premium%20Cotton%20Kurti%20(50%25%20off)%20-%20New!

๐Ÿ’ก Pro tip: For SEO-friendly URLs, use slugs instead of encoding. But for query parameters, encoding is essential.

๐Ÿ“ Example 3: Form Data Submission with Special Characters

The problem: A user submits a review with text: "Great product! 100% satisfied. Would buy again."

Raw form data: review=Great product! 100% satisfied. Would buy again.

After encoding: review=Great%20product%21%20100%25%20satisfied.%20Would%20buy%20again.

โœ… Result: The review data transmits safely from browser to server.

๐Ÿ” Example 4: SEO Keyword Tracking in Analytics

The problem: An SEO specialist wants to track multiple keywords in a single parameter.

UTM parameter with spaces: utm_term=best silk sarees coimbatore

After encoding: utm_term=best%20silk%20sarees%20coimbatore

Full tracking URL: https://tyzo.in/tool?utm_source=google&utm_medium=cpc&utm_campaign=sarees&utm_term=best%20silk%20sarees%20coimbatore

๐Ÿ“ง Example 5: Email Link with Dynamic Content

The problem: An email marketer needs to include customer-specific data in a link.

Customer data: name=Rajesh Kumar&city=Coimbatore&product=Premium Silk Saree

After encoding the parameter value: https://shop.com/landing?customer=Rajesh%20Kumar&city=Coimbatore&product=Premium%20Silk%20Saree

โœ… Result: The email client doesn't break the link at spaces.

๐ŸŒ Example 6: International Characters in URLs (Non-English)

The problem: A Tamil ecommerce site wants to use Tamil words in URLs.

Tamil text: เฎชเฏเฎŸเฎตเฏˆ (saree)

After UTF-8 encoding: %E0%AE%AA%E0%AF%81%E0%AE%9F%E0%AE%B5%E0%AF%88

Note: Most browsers now display UTF-8 characters natively, but encoding ensures compatibility with older systems.

๐Ÿ”„ Example 7: Redirect URLs with Multiple Parameters

The problem: A website migration requires redirecting old URLs with complex parameters.

Old URL: /products?category=Women's Clothing & Accessories (Premium Collection)

After encoding the parameter: /products?category=Women%27s%20Clothing%20%26%20Accessories%20(Premium%20Collection)

๐Ÿ’ก Note: Apostrophe becomes %27, ampersand becomes %26, parentheses become %28 and %29.

๐ŸŽฏ Example 8: Facebook Ad Custom Parameters

The problem: A social media manager needs to pass custom data to Facebook Pixel.

Custom data: content_name=Silk Saree - Wedding Collection (Limited Edition)

After encoding: content_name=Silk%20Saree%20-%20Wedding%20Collection%20(Limited%20Edition)

Facebook Pixel URL: https://shop.com/thank-you?content_name=Silk%20Saree%20-%20Wedding%20Collection%20(Limited%20Edition)&content_id=12345

Common URL Encoding Reference Table

Common Characters

  • Space โ†’ %20
  • ! โ†’ %21
  • " โ†’ %22
  • # โ†’ %23
  • $ โ†’ %24
  • % โ†’ %25
  • & โ†’ %26
  • ' โ†’ %27
  • ( โ†’ %28
  • ) โ†’ %29

More Characters

  • * โ†’ %2A
  • + โ†’ %2B
  • , โ†’ %2C
  • - โ†’ %2D
  • . โ†’ %2E
  • / โ†’ %2F
  • : โ†’ %3A
  • ; โ†’ %3B
  • < โ†’ %3C
  • = โ†’ %3D

Reserved Characters

  • > โ†’ %3E
  • ? โ†’ %3F
  • @ โ†’ %40
  • [ โ†’ %5B
  • \ โ†’ %5C
  • ] โ†’ %5D
  • ^ โ†’ %5E
  • ` โ†’ %60
  • { โ†’ %7B
  • | โ†’ %7C

5 Common URL Encoding Mistakes (And How to Avoid Them)

โŒ Mistake #1: Encoding the entire URL including protocol

The problem: Encoding the "://" after http breaks the URL completely.

Wrong: https%3A%2F%2Fexample.com (browser doesn't recognize it as a URL)

Correct: Encode only the query parameter values, not the base URL.

Fix: Use "Encode Component Only" instead of "Encode Full URL" when you need to preserve URL structure.

โŒ Mistake #2: Double encoding

The problem: Encoding a string that's already encoded creates %2520 (where %25 is the percent sign).

Example: Space โ†’ %20 โ†’ %2520 (incorrect)

Fix: Only encode once. Our tool shows you the result โ€” if you see %25, you've double-encoded.

โŒ Mistake #3: Not encoding spaces in query parameters

The problem: Some browsers convert spaces to +, others cut off the URL at the space.

Wrong: ?q=best silk sarees

Correct: ?q=best%20silk%20sarees or ?q=best+silk+sarees

Fix: Always encode spaces as %20 for consistency across all browsers.

โŒ Mistake #4: Forgetting to encode ampersands in parameter values

The problem: An ampersand in a parameter value gets interpreted as a parameter separator.

Wrong: ?company=Johnson & Johnson&product=shampoo (breaks at the &)

Correct: ?company=Johnson%20%26%20Johnson&product=shampoo

โŒ Mistake #5: Not encoding non-ASCII characters

The problem: Hindi, Tamil, Chinese, and emojis may not work in all browsers/servers.

Example: ?q=เคจเคฎเคธเฅเคคเฅ‡ may fail on older systems.

Fix: Encode non-ASCII characters: ?q=%E0%A4%A8%E0%A4%AE%E0%A4%B8%E0%A5%8D%E0%A4%A4%E0%A5%87

5 Best Practices for URL Encoding

1. Encode only what needs encoding

Preserve the URL structure (https://, /, ?, =, &). Only encode parameter names and values.

2. Use %20 for spaces, not +

While + works in query strings, %20 is the standard and works everywhere.

3. Decode only once

Decoding multiple times can corrupt the data. Our tool decodes completely in one click.

4. Test after encoding

Always paste the encoded URL in a browser to verify it works before sending to customers.

5. Use consistent encoding across teams

Document your encoding standards so all marketers and developers follow the same rules.

URL Encoding vs HTML Encoding vs Base64

URL Encoding

Purpose: Safe URLs

Example: Space โ†’ %20

Use for: Web addresses, query strings

HTML Encoding

Purpose: Safe HTML display

Example: < โ†’ &lt;

Use for: Preventing XSS, displaying code

Base64

Purpose: Binary to text

Example: Hello โ†’ SGVsbG8=

Use for: Email attachments, API auth

When NOT to Use URL Encoding

Industry-Specific URL Encoding Use Cases

๐Ÿ“ˆ Digital Marketing

UTM parameters, Google Ads tracking, Facebook Pixel, email campaign links

๐ŸŒ Web Development

REST APIs, redirect URLs, form submissions, routing parameters

๐Ÿ›๏ธ Ecommerce

Product filters, search queries, affiliate links, tracking pixels

๐Ÿ“ง Email Marketing

Personalized links, unsubscribe parameters, click tracking

๐Ÿ” SEO

Canonical URLs, hreflang tags, sitemap generation, redirect chains

๐Ÿ“ฑ Mobile Apps

Deep links, app-to-web navigation, push notification URLs

Frequently Asked Questions

Why does %20 represent a space in URLs?

The percent sign (%) indicates the start of an encoded character. 20 is the hexadecimal ASCII code for a space. So %20 = space. Similarly, %2F = forward slash (/), %3F = question mark (?).

What's the difference between encodeURI() and encodeURIComponent() in JavaScript?

encodeURI() preserves URL structure (keeps :// ? & = intact). encodeURIComponent() encodes everything, including those special characters. Use encodeURIComponent() for query parameter values, encodeURI() for full URLs.

Does this tool save my data?

No. Everything runs in your browser. Your URLs, tracking parameters, and sensitive data never leave your device. We don't store, log, or save any of your inputs.

What's the maximum URL length this tool can handle?

The tool can handle up to ~50,000 characters efficiently. Most browsers support up to 2000-8000 characters for URLs. For longer data, use POST requests instead of GET.

Do I need to encode every special character in a URL?

No. Only encode characters that have special meaning in URLs or are outside the ASCII range. Our "Encode Component Only" option handles this automatically.

Can I use this tool for API development?

Yes! Many APIs require URL-encoded parameters in GET requests. Encode your parameter values before adding them to the URL.

What's the difference between encoding and escaping?

They're often used interchangeably. URL encoding = percent-encoding = escaping special characters. All mean the same thing for web addresses.

Is this tool free?

Yes, completely free. No sign-up, no credit card, no hidden fees. Forever.

Related Tools You May Find Useful