Developer / IT · Encoding
URL Encoder / Decoder
Encode text for safe use in a URL or decode percent-encoded text, the same way browsers do: as a single component (query value, path segment), as a whole URL, or as HTML form data where spaces become +. Paste a full URL to see its protocol, host, path and every query parameter decoded.
Your inputs
Quick start — try a typical case
Your result Live
Encoded
price%20%3C%20%E2%82%B9500%20%26%20size%3DM%2FL
23 characters in → 47 out
Encode each query value separately as a component; encoding a whole URL as a component would also escape its : / ? & = separators.
How this is calculated
Each unsafe character → its UTF-8 bytes, each written as %XX (hex) · e.g. space → %20, ₹ → %E2%82%B9
- Component
- encodeURIComponent: escapes everything except A–Z a–z 0–9 - _ . ! ~ * ' ( )
- Whole URL
- encodeURI: also leaves ; , / ? : @ & = + $ # alone
URLs can only carry a limited set of characters, so anything else — spaces, &, non-English letters, emoji — is percent-encoded as the hex values of its UTF-8 bytes. Encode a query value as a component so its own & or = can't break the URL; encode a whole URL to keep its structure. HTML forms use the same scheme but write spaces as +.
Assumptions & sources
- UTF-8 encoding, as all modern browsers use.
- 1RFC 3986 — Uniform Resource Identifier (URI): Generic Syntax, §2.1 Percent-Encoding — IETF
- 2URL Standard — application/x-www-form-urlencoded — WHATWG
Calculator ID DEV-URLENC-001 · version 1.0.0
Common questions
Why does a space become %20 or +?
In URL paths and modern APIs a space is %20; in HTML form data (and many query strings) it's written as +. Pick 'Form data' to use +.
What's the difference between encodeURI and encodeURIComponent?
encodeURI is for a whole URL and leaves separators like / ? & = intact; encodeURIComponent is for one piece (like a search term) and escapes those too.