URL Encode & Decode
Percent-encode text for safe use in URLs, or decode an encoded URL back to readable text. Component and full-URI modes.
How to use it
- Component mode encodes everything unsafe — use it for query string values.
- URI mode leaves structural characters like : / ? & alone — use it for whole URLs.
- Both boxes are live and work in either direction.
URLs can only safely contain a limited set of characters. Percent-encoding replaces anything outside that set with a % followed by its hex byte value — a space becomes %20, an ampersand becomes %26 — so the character survives being transmitted inside a URL without being misread as part of the URL's own structure.
Component mode vs URI mode
Component encoding (encodeURIComponent-equivalent) escapes everything that isn't safe in one single piece of a URL, including characters like & ? / and # that would otherwise be read as URL structure — the correct mode for a value going into a query string parameter, like a search term or a piece of user input, e.g. encoding 'hello world & more' into hello%20world%20%26%20more for use as ?q=hello%20world%20%26%20more.
URI encoding (encodeURI-equivalent) deliberately leaves structural characters like : / ? & # alone, since it's meant for encoding an entire URL rather than one value inside it — using component mode on a whole URL would wrongly escape the slashes and colons that make it a URL in the first place.
Why unencoded characters break things
A raw space or & inside a query parameter value gets misread by the server as ending the value or starting a new parameter, silently truncating or corrupting the data. This is the most common cause of a URL that 'mostly works' but drops part of a search term or form value — the fix is encoding the value before it goes into the URL, not after something breaks.
Last updated 17 August 2026