What Is URL Encoding, and When Is It Used?
URL encoding (percent-encoding) converts characters that have special meaning in an address, or aren't allowed by the URL standard (spaces, accented letters, & ? = # / and the like), into a %XX-style representation that browsers and servers can carry safely. A space becomes %20, for example, while an accented letter becomes the percent-encoded hex value of its UTF-8 bytes. Decoding does the reverse, turning an encoded address back into readable text.
The most common use is turning a piece of text — like a search query or a form value — into part of a URL: when a user types "bus times Istanbul" into a search box, that value must be encoded before it's appended to the address, otherwise the space and any accented characters would break it. The same applies when carrying an email address (which contains an @ sign) or a file path (which contains a /) as a query parameter in an API request. Developers can also quickly decode an encoded URL they spot in a log file or a browser's address bar to make it readable again.
Tip: "Component" mode is used when encoding a single piece of a URL (e.g. the value of a query parameter) and also encodes characters like / ? & = #. "Full URL" mode encodes an entire address while preserving its structure. Picking the wrong mode can produce an address where, say, the https:// prefix ends up double-encoded, or the & query separator gets needlessly encoded — the mode you choose directly affects the result.
This tool runs entirely in your browser; it uses JavaScript's built-in encodeURIComponent/decodeURIComponent functions, and no text is ever sent to a server. That means you can safely encode or decode a redirect address containing an API key, or a link carrying authentication information. The "Swap" button is a handy shortcut for using a decoded output as input again for back-and-forth experimentation — especially useful when investigating why an API request failed, letting you step through encoding and decoding the raw address that was sent to compare it.
Try This Next
Finished here? These might be your next step.
Frequently Asked Questions
/ ? & = #; use it when encoding the value of a query parameter. Full URL mode preserves the URL structure (://, ?, &); choose it when encoding an entire address.%20; but in HTML form submissions (application/x-www-form-urlencoded) a + is used historically. The "Form encoding" option turns this behavior on.encodeURIComponent/encodeURI leave characters that are already safe (letters, digits, - _ . ! ~ * ' ( )) untouched — only characters with special meaning or outside ASCII get encoded. This keeps the output from becoming unnecessarily long.% sign followed by only one digit or none), or a character was cut off while copying. Make sure you've pasted the entire text, from start to end, without anything missing.Last updated: