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-09Try it right now — free, no sign-up
Use the embedded tool directly in your browser. Your data never leaves your device.
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
- Open the tool — Visit the URL Encoder/Decoder. No login needed.
- 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.
- Click Encode — Instantly see the percent-encoded result in the Output area.
- Copy and use — Copy the result to use in your application, API call, or browser address bar.
- 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,
%20becomes%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
- Base64 Encoder — Encode binary data or credentials for HTTP headers
- HTML Entity Encoder — Encode special characters for safe HTML output
- JSON Formatter — Format JSON payloads in your API requests
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
How to Encode Base64 Online: A Complete Guide
Learn how to encode and decode Base64 strings online in seconds. Step-by-step tutorial with real-world use cases for APIs, images, and email attachments.
How-To GuideHow to Format JSON Online: Step-by-Step Tutorial
Format, validate, and minify JSON online for free. Step-by-step guide with real-world examples for APIs, configs, and debugging.
How-To GuideHow to Decode JWT Online in 3 Steps
Decode and inspect JSON Web Tokens online in seconds. Learn what's inside a JWT — header, payload, and signature — with real examples.
How-To GuideHow to Minify CSS Online: Save File Size Fast
Minify your CSS online for free to reduce file size and speed up page load times. Step-by-step guide with before/after size comparisons.