URL Encoder & Decoder
Encode a URL component or decode percent-encoded text without sending the value to a server. It helps when building query strings and debugging copied URLs.
Runs locally in your browser
Discuss a result
Write a short summary and review it before posting. Your tool inputs are never copied automatically.
What is the URL Encoder & Decoder?
Encode a URL component or decode percent-encoded text without sending the value to a server. It helps when building query strings and debugging copied URLs.
How to use it
- 1Keep URL encoding selected as the scheme.
- 2Enter the component to encode or paste encoded text below.
- 3Copy the result.
How it works
The browser’s encodeURIComponent and decodeURIComponent APIs apply and remove percent escapes for a URL component.
Space in a query value
“hello world” becomes “hello%20world” when encoded as a component.
Limitations & notes
- This mode encodes a component, not an entire URL including its separators.
- Malformed percent escapes cannot be decoded.
Frequently asked questions
Should a space be encoded as %20 or +?
Both appear in the wild. %20 is the generic percent-encoding for a space and is valid anywhere in a URL. The + sign means space only inside HTML form data (application/x-www-form-urlencoded query strings). This tool uses encodeURIComponent, so a space always becomes %20, and when decoding it leaves a literal + unchanged. If your string came from a submitted form, replace + with a space before decoding.
Which characters does URL encoding leave unchanged?
encodeURIComponent keeps letters A-Z and a-z, digits 0-9 and the marks - _ . ! ~ * ' ( ) as they are. Everything else, including / ? & = # and :, becomes a percent escape, so a=1&b=2 turns into a%3D1%26b%3D2. That is exactly what you want for a single query value, but it is why pasting a full URL here produces something a browser will no longer treat as a working link.
How are accented letters and emoji encoded in a URL?
The character is first converted to its UTF-8 bytes, and each byte is written as % followed by two hex digits. The word café becomes caf%C3%A9 because é is the two bytes C3 and A9. An emoji such as a thumbs-up uses four bytes, producing twelve characters like %F0%9F%91%8D. Decoding reverses the process, so the original characters come back exactly.
Why does decoding fail with a URI malformed error?
decodeURIComponent stops when it meets a % that is not followed by two hex digits, such as 100% or %G1, or a sequence of bytes that is not valid UTF-8, such as a lone %C3. This tool then shows that the input could not be decoded. Common causes are a literal percent sign that was never escaped (it should be %25) or a URL that was cut off mid-escape when copied.
What does double encoding look like and how do I fix it?
Double encoding happens when an already encoded value is encoded again, so %20 becomes %2520 because the % itself is escaped to %25. Links then show literal %20 text or break on the server. If you see %25 followed by two hex digits, paste the value into the decode box twice: the first pass gives %20, the second gives the real space.
No directly related discussion yet.
Start a focused thread and share the question this tool helped you explore.
Ask the community about URL Encoder & Decoder