What it does
URL encoding represents reserved or non-ASCII characters as percent-encoded bytes so an address stays unambiguous. The common mistake is encoding a whole URL or a single component with the wrong function, which silently changes its meaning. This tool shows both.
How it works
encodeURIComponent escapes everything except A–Z, a–z, 0–9 and - _ . ! ~ * ' ( ). It is for a single query value or path segment, where ? & = / must not survive literally.
encodeURI leaves URL delimiters such as : / ? & = intact. It is for a complete URL whose structure you want to preserve. Using it on a value that contains & will break the query.
Decoding reverses percent escapes. A lone % or an invalid byte sequence is an error; silently replacing it hides a bug. Decode once, not repeatedly, or a literal %2520 becomes a space.
Non-ASCII characters are first converted to UTF-8 bytes, then escaped. That is why é becomes %C3%A9, two escapes for one character. The encoding must match what the server expects; legacy Latin-1 pages still exist.
A space is %20 in a path or query. In application/x-www-form-urlencoded bodies, a space may be +. The two forms are not interchangeable, and mixing them produces values with stray plus signs.
When to use it
- Encode a search term for a query parameter without breaking the URL.
- Decode a redirect target from a tracking link.
- Fix double-encoded values in an API request.
- Check why a path with a slash behaves differently after encoding.
Glossary
- Percent-encoding
- Representing a byte as % followed by two hex digits.
- encodeURIComponent
- Encodes a single component, escaping delimiters.
- encodeURI
- Encodes a full URL while preserving its structure.
- Reserved character
- A character with syntactic meaning, such as ? & = / #.
- Double encoding
- Encoding an already-encoded value, so % becomes %25.
Frequently asked questions
Should I use encodeURI or encodeURIComponent?+
Use encodeURIComponent for a query value or path segment. Use encodeURI only for a complete URL whose delimiters should remain.
Why did my URL break after encoding?+
Likely encodeURIComponent on a whole URL, which escaped the ? and &. Encode individual values, then assemble the URL.
Why does a space become + sometimes?+
Form encoding uses + for spaces. URL paths and queries use %20. The server must know which convention applies.
Can I decode a URL twice?+
Only if it was encoded twice. Decoding again can turn a literal %25 into %, changing the value. Decode exactly once per layer.
Does encoding make a value safe for HTML?+
No. URL encoding is not HTML escaping. Use the correct escaping for the context where the value is inserted.
API & MCP
No API endpoint
This tool runs entirely in your browser. It is not available over the REST API or MCP.
Shareable result
https://100www.dev/tools/url-encoder?v=https%3A%2F%2Fexample.com%2Fa%20b%3Fx%3D1%26y%3D%E4%B8%AD%E6%96%87

100www engineering
EditorialReviewed by Steve · · Report an error
Tested from the 100www probe network; results vary by location and network.


