URL Encoder / Decoder
Encode or decode URLs and special characters instantly.
What Is URL Encoding?
URL encoding (also called percent-encoding) replaces special characters in a URL with a percent sign followed by two hexadecimal digits. For example, a space becomes %20 and an ampersand becomes %26. This ensures URLs are transmitted correctly, since many characters have special meaning in URL syntax.
How Do I Encode or Decode a URL?
Paste your URL or text into the input area and click Encode to convert special characters to their percent-encoded form. Click Decode to reverse the process and reveal the original characters. The tool handles the full UTF-8 character set correctly, including non-Latin characters.
Why Is URL Encoding Necessary?
URLs can only contain a limited set of ASCII characters. Characters like spaces, ampersands, question marks, hash signs, and non-ASCII letters must be encoded to prevent them from being misinterpreted as URL delimiters. Without proper encoding, links can break, query parameters can be lost, and APIs may return unexpected results.
When Do Developers Need URL Encoding?
URL encoding is needed when building query strings programmatically, passing user input as URL parameters, encoding redirect URLs, working with OAuth callback URLs, debugging broken links, and constructing API request URLs. This tool lets you quickly test and verify encoded values.
What Characters Need URL Encoding?
Characters that must be encoded include spaces (%20), ampersands (%26), question marks (%3F), hash signs (%23), equals signs (%3D), plus signs (%2B), percent signs (%25), and all non-ASCII characters. The reserved characters that have special meaning in URL syntax — such as /, ?, #, and & — must be encoded when used as data rather than delimiters.
What Is the Difference Between encodeURI and encodeURIComponent?
In JavaScript, encodeURI encodes a complete URI but leaves reserved characters (like / and ?) intact. encodeURIComponent encodes everything except unreserved characters, making it the correct choice for encoding individual query parameter values. Using the wrong function is a common source of broken URLs in web applications. This tool uses full encoding equivalent to encodeURIComponent.