URL Encoder and Decoder
NewEncode text for URLs, or decode percent-encoded URLs and parameters back to readable text. Choose the right encoding for query values, form data, strict RFC 3986 or full URLs. When decoding, paste a whole URL to see its parts and every query parameter decoded. Everything is converted as you type, locally in your browser.
How to URL-encode text
- Select Encode and type or paste your text.
- Choose the encoding. The default, for query values and path segments, is right in most cases.
- Copy the encoded text from Encoded text.
For example, name=Jane Doe & city=São Paulo encoded as a query value becomes name%3DJane%20Doe%20%26%20city%3DS%C3%A3o%20Paulo. Characters outside ASCII, such as ã or emoji, are encoded as their UTF-8 bytes.
How to decode a URL
- Select Decode and paste the URL or the encoded text.
- Keep Decode + as a space selected for query strings and form data. Clear it for URL paths, where
+is a literal plus sign. - Read the result in Decoded text.
If you paste a whole URL, such as https://example.com/search?q=hello+world&lang=en, the tool also shows its parts and a table of its query parameters, each decoded. If the result still contains escapes like %20, the text was probably encoded twice: select Decode again.
Which encoding should I use?
| Encoding | Use it for | Space | Keeps unencoded |
|---|---|---|---|
| Query value or path segment | Values in ?name=value, path segments | %20 | A–Z a–z 0–9 - _ . ! ~ * ' ( ) |
| RFC 3986 strict | OAuth signatures, AWS signing, strict APIs | %20 | A–Z a–z 0–9 - _ . ~ |
| Form data | HTML form submissions, application/x-www-form-urlencoded bodies | + | A–Z a–z 0–9 * - . _ |
| Full URL | A complete URL that only needs spaces and non-ASCII characters fixed | %20 | Also : / ? # [ ] @ & = + $ , ; |
Encode each value, not the whole URL. If you encode a full URL as a query value, characters like / and ? become %2F and %3F and the URL no longer works as a link. Use Full URL only for a URL that already has the right structure.
URL encoding in code
// JavaScript
encodeURIComponent('Jane Doe & co'); // "Jane%20Doe%20%26%20co"
decodeURIComponent('Jane%20Doe%20%26%20co'); // "Jane Doe & co"
new URLSearchParams({ q: 'Jane Doe' }).toString(); // "q=Jane+Doe"
# Python
from urllib.parse import quote, unquote, urlencode
quote('Jane Doe & co', safe='') # 'Jane%20Doe%20%26%20co'
unquote('Jane%20Doe%20%26%20co') # 'Jane Doe & co'
urlencode({'q': 'Jane Doe'}) # 'q=Jane+Doe'
// PHP
rawurlencode('Jane Doe & co'); // "Jane%20Doe%20%26%20co" (RFC 3986)
urlencode('Jane Doe & co'); // "Jane+Doe+%26+co" (form encoding)
Common decoding errors
- Invalid escape, such as
100%or%zz: every%must be followed by two hex digits. A literal percent sign is written%25. - Not valid UTF-8, such as
caf%E9: the text was encoded with an older encoding like Latin-1, whereéis%E9. In UTF-8 it is%C3%A9.
The tool shows the position of the problem, and Go to error selects it in the input.
Frequently asked questions
Is my text sent to a server?
No. Encoding and decoding run in your browser as you type. Nothing is uploaded or saved, which matters for URLs that contain tokens or personal data.
What is URL encoding?
URL encoding, also called percent-encoding, replaces characters that are not allowed or have a special meaning in URLs with % followed by two hex digits. For example, a space becomes %20 and & becomes %26, so they can be sent safely as data.
Should a space be encoded as %20 or +?
Both are common. + means a space only in query strings and form data (application/x-www-form-urlencoded). %20 works everywhere, including paths, so it is the safer choice when you are not sure.
What is the difference between encodeURI and encodeURIComponent?
encodeURI encodes a complete URL and keeps characters that give it structure, such as / ? & =. encodeURIComponent encodes a single value and encodes those characters too, so the value cannot break the URL. Use encodeURIComponent for query parameter values.
Why does my decoded text still contain %20 or %2F?
The text was probably encoded twice, so % itself became %25. Decoding once turns %2520 into %20. Select Decode again to decode the next layer.
Related tools
- Base64 encoder and decoder — Encode and decode Base64 text.
- JSON formatter and validator — Format and validate JSON from API responses.
- JWT encoder and decoder — Decode JSON Web Tokens from URLs and headers.
Further reading
- RFC 3986 — Uniform Resource Identifier (URI): Generic Syntax
- WHATWG URL Standard — application/x-www-form-urlencoded
- MDN — encodeURIComponent()
Last updated: