URL Encoder / Decoder
Encode text for safe use in URLs, or decode percent-encoded strings back to plain text.
Mode
Scope
What is URL encoding?
URL encoding (also called percent-encoding) converts characters that aren't allowed or have special meaning in a URL — like spaces, &, or accented letters — into a %XX representation. This keeps URLs valid when they contain arbitrary text, such as a search query or a form value.
Component
Equivalent to encodeURIComponent(). Escapes every reserved character, so it's safe to drop the result into a single query parameter or path segment.
Full URI
Equivalent to encodeURI(). Leaves characters like : / ? & # untouched, so it's safe to use on a complete URL without breaking its structure.
How to encode or decode a URL
- Choose Encode or Decode.
- Pick the scope: Component for a single value (a search term, a parameter, a path segment), Full URI for a complete address.
- Type or paste your text. The output updates instantly.
- Copy the result, or download it as a text file.
A worked example
Say you're building a link to a search page and the user typed shoes & socks, size 42/43. Dropped into a URL as is, it breaks: the & starts a new parameter, the / looks like a path separator, and the spaces aren't allowed at all. Encoded as a component, it becomes:
shoes%20%26%20socks%2C%20size%2042%2F43And the safe link is https://shop.example/search?q=shoes%20%26%20socks%2C%20size%2042%2F43. This is the one rule that prevents most URL bugs: encode each value separately, then assemble the URL. Encoding the finished URL as a whole can't tell which & was meant as a separator and which was part of the data.
Which characters get encoded?
| Character | Encoded | Why it matters |
|---|---|---|
| space | %20 | Not allowed in URLs |
& | %26 | Separates query parameters |
= | %3D | Separates a key from its value |
? | %3F | Starts the query string |
# | %23 | Starts the fragment; everything after it is never sent to the server |
/ | %2F | Separates path segments |
+ | %2B | Read as a space in form-encoded query strings |
% | %25 | Starts an escape sequence itself |
The + row is behind a classic bug: a phone number like +33 6 12… or an email alias like me+news@example.com sent in a query string without encoding arrives on the server with the plus replaced by a space.
In code
- JavaScript:
encodeURIComponent(value), or better,new URLSearchParams({ q: value }), which handles it for you (using+for spaces). - Python:
urllib.parse.quote(value, safe='')for a component,urlencode()for a dict of parameters. - PHP:
rawurlencode()(gives%20) rather thanurlencode()(gives+). - curl:
curl -G --data-urlencode "q=shoes & socks" https://…
URL encoding is often confused with Base64, which serves a different purpose: turning binary data into text. If you're putting binary data in a URL, you'll want URL-safe Base64 instead.
Frequently asked questions
Should a space be %20 or +?+
Both appear in the wild. %20 is the standard percent-encoding and is valid everywhere in a URL. The + sign only means a space inside query strings submitted by HTML forms (application/x-www-form-urlencoded). In a path, + is a literal plus sign. When in doubt, use %20, which is what this tool produces.
What's the difference between encodeURI and encodeURIComponent?+
encodeURIComponent escapes everything except letters, digits and - _ . ! ~ * ' ( ), so it's safe for a single value such as one query parameter. encodeURI leaves URL syntax characters like : / ? & = # alone, so it can be applied to a full URL without breaking it, but it won't protect a value that contains & or =.
Why do I get "Invalid percent-encoded string" when decoding?+
The input has a % that isn't followed by two hexadecimal digits, like '100% free', or a sequence of bytes that isn't valid UTF-8. If the text was never encoded in the first place, there's nothing to decode.
My URL got encoded twice. How do I fix it?+
Double encoding turns %20 into %2520 (the % itself becomes %25). Decode once and check the result; if you still see %XX sequences, decode again. Then find the place in your code where an already-encoded value is being encoded a second time.
How are accented letters and emoji encoded?+
They're converted to UTF-8 bytes and each byte is percent-encoded. 'é' becomes %C3%A9 and '☕' becomes %E2%98%95. Browsers display the readable version in the address bar, but this encoded form is what's actually sent.
Further reading
Last updated October 16, 2026