URL Encode / Decode
Convert URL String
How to Use This URL Encode / Decode Tool
Building a query string with spaces, ampersands, or non-English characters means fighting percent-encoding rules—or your link breaks in production. I reach for a URL encoder whenever I assemble API requests, fix broken bookmark links, or decode a messy address bar string.
- Select Action. Choose Encode or Decode.
- Paste Input Data into the text area.
- Press Encode or Decode. Review the result in the output field.
- Copy Result when ready to paste into your URL or code.
This tool uses encodeURIComponent / decodeURIComponent semantics—appropriate for query parameter values. For binary-safe text encoding in APIs, use Base64 Encode / Decode instead.
URL Encoding and Practical Applications
Percent-encoding replaces characters that are not URL-safe with a percent sign plus two hex digits—like %20 for a space. Think of it as escaping special characters so the browser parser does not confuse query data with URL structure.
Unsafe Character → %XX (hex byte value)
Encode individual parameter values, not entire URLs. A search for "hello world" becomes hello%20world inside ?q=hello%20world—but leave :// and path slashes untouched or the link stops working.
Frequently Asked Questions
What characters get encoded?
encodeURIComponent escapes all characters except A–Z, a–z, 0–9, and - _ . ! ~ * ' ( ). Spaces, unicode, slashes, ampersands, and equals signs in parameter values become %XX sequences.
Why did decode fail on my string?
Malformed percent sequences (a lone % or invalid hex digits) throw errors. Ensure the string uses valid %XX pairs and was encoded with the same rules you expect to decode.
Should I encode the entire URL or just parameters?
Encode individual query parameter values, not the full URL structure. Encoding :// or ? breaks the URL scheme. Encode the value for q=hello world as q=hello%20world.
How is this different from Base64 encoding?
URL encoding (percent-encoding) replaces unsafe ASCII characters with %XX hex for web addresses. Base64 converts binary data to a larger ASCII alphabet—use each for its intended context.
Is my input uploaded when I encode or decode?
No. Processing stays local in your browser. Copy results when done, especially on shared machines.