How-To Guide

How to URL Encode and Decode Strings Online: Step-by-Step Guide

Learn how to URL encode and decode strings online for free. Step-by-step guide with real-world examples for query parameters, API calls, and form submissions.

Published 2026-03-09

Try it right now — free, no sign-up

Use the embedded tool directly in your browser. Your data never leaves your device.

Open Tool →

URL encoding is a fundamental web development skill — yet it's easy to forget which characters need escaping and why. This guide shows you how to URL encode and decode strings online in seconds, with no setup required.

What is URL Encoding?

URL encoding (also called percent-encoding) converts characters that are not safe to include in a URL into a format that can be safely transmitted. Special characters like spaces, &, =, and # are replaced with a percent sign followed by their hexadecimal ASCII code.

For example, a space becomes %20, and an ampersand becomes %26.

Step-by-Step: How to URL Encode Online

  1. Open the tool — Visit the URL Encoder/Decoder. No login needed.
  2. Paste your string — Enter the URL or text you need to encode. This could be a search query, an API parameter, or a full URL.
  3. Click Encode — Instantly see the percent-encoded result in the Output area.
  4. Copy and use — Copy the result to use in your application, API call, or browser address bar.
  5. To decode — Paste any percent-encoded URL and click Decode to restore the original string.

Real-World Use Cases

1. Encoding Query Parameters in API Calls

When building search or filter APIs, query parameters often contain special characters that must be encoded:

# Search query with spaces and special chars
query = "hello world & goodbye"

# Encoded for URL
encoded = "hello%20world%20%26%20goodbye"

# Full API URL
url = f"https://api.example.com/search?q={encoded}"
# → https://api.example.com/search?q=hello%20world%20%26%20goodbye

2. Handling Email Addresses in URLs

Email addresses contain the @ symbol which must be encoded in URL parameters:

# Email address
email = "[email protected]"

# Encoded
encoded_email = "user%40example.com"

# In a URL
url = f"https://example.com/profile?email={encoded_email}"

3. Debugging Encoded URLs

When you encounter a cryptic URL in logs or browser history, decode it to understand what was actually requested:

# Encoded URL from logs
/search?q=javascript%20async%2Fawait%20tutorial&lang=en&sort=date%3Adesc

# Decoded — now readable
/search?q=javascript async/await tutorial&lang=en&sort=date:desc

Common Mistakes to Avoid

  • Double-encoding URLs — If you encode an already-encoded URL, %20 becomes %2520. Always start from the raw, unencoded string.
  • Encoding entire URLs instead of parameters — Only encode the values in query parameters, not the entire URL. The https://, slashes, and domain should stay unencoded.
  • Forgetting to encode hash (#) characters — The # character in a URL marks a fragment identifier. If your data contains #, encode it as %23.
  • Confusing URL encoding with HTML encoding — URL encoding uses %, HTML encoding uses &. They're different — use the right one for the context.

Related Tools

Ready to try it?

Free online tool — no download, no account, works in your browser.

Open URL Encode and Decode Strings Online: Step-by-Step Guide Tool →

Related Articles