Skip to content
Free tool · runs in your browser

HTML URL encoder & decoder

Turn text into a safe URL component (a b&c → a%20b%26c), decode percent-encoded links back to readable text, and escape characters for HTML — all in one place.

Which mode to use

ModeEncodesUse it forExample
URL componentEverything except A–Z a–z 0–9 - _ . ! ~ * ' ( )One query value or path segmentZoë & co → Zo%C3%AB%20%26%20co
Whole URLSpaces and non-ASCII, but keeps : / ? # & =A full link that contains spaces or accentshttps://x.dev/my page → https://x.dev/my%20page
FormLike component, spaces as +Bodies of application/x-www-form-urlencoded formsa b → a+b
HTML entities& < > " 'Showing code or user text inside HTML<b> → &lt;b&gt;

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 &amp; — 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.

Related guides

Frequently asked questions

What is %20 in a URL?

An encoded space. Spaces are not allowed in URLs, so they are written as %20 (or + in form data).

What is the difference between encodeURI and encodeURIComponent?

encodeURI keeps characters that structure a URL (: / ? # & =); encodeURIComponent encodes them too, which is what you want for a single value. They are the Whole URL and URL component modes above.

How do I decode a URL?

Paste it into Input and press Decode. If you get an error, the text contains a % that is not followed by two hex digits — encode that % as %25.

Is HTML encoding the same as URL encoding?

No. HTML encoding (&lt;) makes text safe inside HTML; URL encoding (%3C) makes it safe inside a URL.

More free tools

Paste HTML. Get a URL.

Code, an .html file, a ZIP or a whole folder becomes a live HTTPS URL with your own address, an optional password and a QR code. Free to start with Google sign-in; paid plans keep URLs online for good.

Convert HTML to URL