URL Encode & Decode
Encode and decode URL components. Includes a URL parser that breaks URLs into protocol, host, path, query parameters, and fragment.
How to Use This Tool
- 1
Choose Encode or Decode mode using the toggle at the top.
- 2
Paste the text or URL you want to process into the input field.
- 3
For component encoding (e.g., a query parameter value), enable the 'Encode component' option to also encode structural characters like / and ?.
- 4
Use the URL Parser tab to paste a full URL and see it broken down into scheme, host, path, query parameters, and fragment.
What is URL Encode?
Percent-encoding (commonly called URL encoding) is the mechanism by which reserved or non-ASCII characters are represented safely inside a Uniform Resource Locator. A URL may only contain a defined set of characters from the ASCII range. Any character outside that set — spaces, accented letters, symbols like &, =, or # — must be converted to a % followed by two hexadecimal digits representing the character's UTF-8 byte value. For example, a space becomes %20 and an ampersand becomes %26.
The distinction between encodeURI and encodeURIComponent (the underlying JavaScript functions) matters in practice. encodeURI encodes a complete URL, leaving structural characters like /, ?, and # intact. encodeURIComponent encodes a value intended to be placed inside a URL — for example, a query parameter value — so it also encodes those structural characters. Using the wrong function is a common source of broken URLs and API errors.
A URL parser complements the encoder by decomposing a full URL into its constituent parts: scheme, username, password, hostname, port, pathname, search (query string), and hash (fragment). This makes it easy to inspect what a URL actually contains, debug misconfigured API requests, and understand how search parameters are structured before passing them to your application.
Frequently Asked Questions
helpWhen should I use encodeURI vs encodeURIComponent?
Use encodeURI when encoding a complete URL — it leaves structural characters like /, ?, #, and & intact. Use encodeURIComponent when encoding a single value that will be placed inside a URL, such as a query parameter value — it encodes those structural characters so they don't interfere with the URL structure.
helpWhy does a space sometimes appear as + and sometimes as %20?
Both are valid representations of a space depending on context. %20 is the standard percent-encoding used in URL paths. The + notation is used in application/x-www-form-urlencoded data (HTML form submissions). In query strings you may encounter either, but %20 is safer for general use.
helpIs my data sent to a server?
No. All encoding, decoding, and URL parsing runs entirely in your browser. Nothing is transmitted to any server.
helpWhat characters must be percent-encoded in a URL?
Characters that must be encoded include spaces, non-ASCII characters, and reserved characters when they appear outside their structural role: ! ' ( ) * @ : , ; = + $ # [ ] % and control characters. Safe characters that do not need encoding are A–Z, a–z, 0–9, -, _, ., and ~.