Free URL Encoder and Decoder - A Developer Guide to Percent-Encoding
1. What is URL Encoding and Why Does It Exist?
URLs were designed in the early 1990s around a limited alphabet of safe characters. Spaces, symbols, punctuation and non-English characters can all break a link or, worse, change its meaning, because characters like ?, & and = have structural jobs inside a URL. Percent-encoding solves this by representing unsafe characters as a percent sign followed by their hexadecimal byte value: a space becomes %20, an ampersand becomes %26.
Without encoding, a search query containing an ampersand would silently truncate, a filename with a space would 404, and an Arabic or Japanese product name would corrupt in transit. Every time you share a link with parameters, redirect through a tracking URL, or pass user input into a query string, encoding is the invisible machinery keeping the web coherent.
2. How to Encode or Decode with This Tool
Paste your text or URL into the input field and choose encode or decode. The result appears instantly, ready to copy back into your code, browser bar or marketing platform. The tool handles full UTF-8 input correctly, so emoji, accented characters and non-Latin scripts encode to their proper multi-byte sequences rather than garbage.
Because conversion happens entirely in your browser, you can safely encode URLs containing internal parameters, unreleased product names or staging environment paths. Nothing is transmitted anywhere, which is more than most online encoders can honestly claim.
3. encodeURI vs encodeURIComponent - The Distinction That Matters
JavaScript gives developers two encoding functions and confusing them causes real bugs. encodeURI encodes a complete URL while preserving its structural characters, so https://example.com/search?q=a b becomes ...?q=a%20b with the slashes and question mark intact. encodeURIComponent encodes a single value aggressively, escaping everything reserved, which is what you want when inserting a value into a query parameter.
The rule of thumb: encoding a whole address, use encodeURI; encoding a value that travels inside an address, use encodeURIComponent. Double-encoding is the related trap, where an already-encoded %20 becomes %2520 and the server decodes it back to a literal %20 string instead of a space. When a parameter looks wrong on the server, count the percent signs first.
4. Real-World Scenarios Where Encoding Saves You
Email marketers encoding UTM parameters discover quickly that an unencoded ampersand splits their tracking data in half. Developers building redirect chains learn that a destination URL passed as a parameter must itself be fully encoded. Anyone sharing a WhatsApp or mailto link with prefilled text needs spaces and line breaks encoded or the message truncates.
API consumers meet encoding daily: OAuth callbacks, signed URLs, search endpoints and pagination tokens all ride in query strings. When an API call fails with a mysterious 400 error, decoding the request URL with this tool often reveals the culprit in seconds, whether it is a stray space, an unescaped plus sign or a mangled unicode character.
Frequently Asked Questions
Q: What is the difference between %20 and + for spaces?
Both represent a space, but in different contexts. Within the path of a URL only %20 is valid. Inside a query string, the older application/x-www-form-urlencoded convention also allows the plus sign. Modern practice is to use %20 everywhere, because a literal plus sign in a path means an actual plus character.
Q: Why does my URL contain %25 after encoding?
That is double-encoding. The percent sign itself encodes as %25, so if you encode an already-encoded string, %20 turns into %2520. Decode the string once with this tool to check, then re-encode only the raw value. Double-encoding is one of the most common causes of broken tracking links.
Q: Can this tool encode non-English characters like Arabic or Chinese?
Yes. The encoder is fully UTF-8 aware, converting each character into its correct multi-byte percent sequence. An Arabic product name or Chinese search term encodes into standards-compliant output that works across browsers, email clients and social platforms.
Q: Is it safe to paste private URLs here?
Yes. Encoding and decoding run locally in your browser with JavaScript. The URLs you paste never leave your device, are never logged and never touch a server, so staging links, internal tools and unreleased campaign URLs stay private.
Q: Which characters never need encoding?
The unreserved set defined by the URL standard: uppercase and lowercase letters, digits, and the four characters hyphen, period, underscore and tilde. Everything else is either reserved with a structural meaning (like / ? # &) or unsafe, and should be encoded when it appears as data rather than structure.