Which mode to use
| Mode | Encodes | Use it for | Example |
|---|---|---|---|
| URL component | Everything except A–Z a–z 0–9 - _ . ! ~ * ' ( ) | One query value or path segment | Zoë & co → Zo%C3%AB%20%26%20co |
| Whole URL | Spaces and non-ASCII, but keeps : / ? # & = | A full link that contains spaces or accents | https://x.dev/my page → https://x.dev/my%20page |
| Form | Like component, spaces as + | Bodies of application/x-www-form-urlencoded forms | a b → a+b |
| HTML entities | & < > " ' | Showing code or user text inside HTML | <b> → <b> |
Percent-encoding in one paragraph
URLs may only contain a small set of ASCII characters. Anything else — spaces, accents, emoji, and characters that have a job in URLs like &, ?, # and / — is written as % followed by the byte's hex value in UTF-8. A space becomes %20, & becomes %26, and ë (two bytes in UTF-8) becomes %C3%AB. Decoding reverses it. The classic bug is encoding a whole URL with the component mode, which turns https:// into https%3A%2F%2F; encode only the values you insert.
URL encoding inside HTML
When a URL with query parameters goes into an href, the & between parameters should itself be HTML-escaped as & — browsers forgive it, validators do not. So a link is often encoded twice: percent-encoding for the values, then HTML-escaping for the attribute. The link code generator does both for you.
Looking for something else?
"HTML to URL" usually means hosting: turning an HTML page into a link people can open. That is what the converter on the home page does. The difference is explained in HTML to URL vs URL encoding.