URL Encode
Encode and decode URL components
What is URL / percent encoding?
URLs can only contain a small set of ASCII characters. Anything else — spaces, accented letters, emoji, reserved characters like `&`, `=`, `?` — must be percent-encoded as `%` followed by two hex digits representing the UTF-8 bytes. A space becomes `%20`, `é` becomes `%C3%A9`, the question mark becomes `%3F`.
Use 'component' encoding when escaping a single piece (a query parameter value, a path segment) — equivalent to JavaScript's `encodeURIComponent`. Use 'full URL' encoding when escaping a whole URL that already has structural delimiters you want to preserve — equivalent to `encodeURI`.
Examples
| Input | Result |
|---|---|
| hello world & friends | hello%20world%20%26%20friends |
| café/menu?id=123 | caf%C3%A9%2Fmenu%3Fid%3D123 (component) or caf%C3%A9/menu?id=123 (full URL) |
Frequently asked questions
What's the difference between encodeURI and encodeURIComponent?
`encodeURI` leaves URL structural characters (`:`, `/`, `?`, `#`, `&`, `=`) untouched — for encoding a whole URL. `encodeURIComponent` escapes those too — for encoding a single piece that goes into a URL.
Can it handle non-ASCII characters?
Yes. Characters outside ASCII are encoded as their UTF-8 bytes (1–4 bytes), each represented as `%XX`.
Is `+` interpreted as a space when decoding?
Optional. The classic `application/x-www-form-urlencoded` interpretation treats `+` as space; standard URL decoding leaves `+` alone. Toggle the option for form-style decoding.
Why does my URL break after encoding?
You probably encoded the structural characters (`:`, `/`) by accident. Use 'full URL' encoding mode to preserve them.
Is anything uploaded?
No — encoding and decoding run entirely in your browser.
