URL Encode & Decode
Encode text so it is safe to put in a URL, or decode percent-encoded links back into readable text.
🔒 Runs entirely in your browser. Nothing you enter is sent to a server.
URLs can only safely contain a limited set of characters. Spaces, accented letters, ampersands and many symbols must be percent-encoded: each byte is written as % followed by two hexadecimal digits. Otherwise a browser or server might misread where a value ends. This tool encodes text for safe use in links and query strings, and decodes encoded URLs back into something readable.
How to use the URL encoder and decoder
- Choose Encode or Decode.
- Pick what you are working with:
- Component: a single query parameter value or path segment. This is the safest choice for most cases.
- Full URL: a complete address that should keep its
:/?&=#structure. - Form data: like Component, but spaces become
+, as in HTML form submissions.
- Paste your text and copy the result.
Examples
| Original | Encoded (component) |
|---|---|
hello world |
hello%20world |
café & bakery |
caf%C3%A9%20%26%20bakery |
a/b?c=d |
a%2Fb%3Fc%3Dd |
50% off! |
50%25%20off%21 |
Which characters get encoded?
Letters A–Z and a–z, digits 0–9 and - _ . ~ never need encoding. They are called unreserved characters. Everything else is encoded in component mode. In full-URL mode, the reserved characters that give a URL its structure (: / ? # [ ] @ ! $ & ' ( ) * + , ; =) are left as they are.
Common problems this fixes
- Broken query strings. A value containing
&or=, such as a company name like “Smith & Sons”, splits into extra parameters unless it is encoded. - Double encoding. If you see
%2520in a URL, it was encoded twice:%became%25. Decode it once to recover%20, then fix the code that encodes twice. - Unreadable tracking links. Marketing and redirect links often hide the real destination inside an encoded parameter. Decode the URL to see where it really leads before you click.
- API debugging. Decode request URLs from server logs to read the parameters a client actually sent.
Encoding in code
JavaScript has encodeURIComponent() and encodeURI(). Python has urllib.parse.quote() and quote_plus(), and PHP has rawurlencode() and urlencode(). Component mode here matches encodeURIComponent but also encodes ! ' ( ) *, for strict RFC 3986 compliance.
Frequently asked questions
What is the difference between encoding a component and a full URL?
Component mode, like JavaScript's encodeURIComponent, escapes everything that has a special meaning in a URL, including / ? & = and
Should a space be %20 or +?
Both appear in practice. %20 is correct anywhere in a URL. The + sign means a space only in form-encoded query strings (application/x-www-form-urlencoded). Use Form data mode when you need + for spaces.
Why are non-English characters turned into several % codes?
URLs are encoded as UTF-8 bytes, and characters outside basic ASCII take two to four bytes each. For example, "é" becomes %C3%A9 and an emoji becomes four percent-encoded bytes.