How to use URL Encoder / Decoder
To URL-encode a string, paste or type your text into the Input field and click Encode. The tool converts all characters that are not safe in URLs — spaces, special characters, Unicode, reserved characters like &, =, ?, and # — into their percent-encoded equivalents (e.g., a space becomes %20, and & becomes %26). The encoded string appears in the Output field and is safe to use in URL query parameters, path segments, or HTTP headers.
To decode a percent-encoded string back to plain text, paste the encoded URL or URL component into the Input field and click Decode. The tool replaces every %XX sequence with the corresponding character. This is useful when reading logs, debugging API requests, or inspecting redirect URLs that contain encoded parameters. If the input contains invalid percent sequences (e.g., a % not followed by two hex digits), the tool will flag the error.
Why use our URL Encoder / Decoder?
- Handles full UTF-8 and Unicode encoding — accented characters, CJK, emoji, and non-ASCII are all supported
- Encode and decode in the same tool — switch modes without leaving the page
- 100% browser-based — your URLs and query strings never leave your device
- Instant results — no page reload, no button delay
- Correctly handles edge cases: reserved characters, double-encoding detection, and invalid sequences
- Works with any URL structure — query strings, path segments, or data URIs
Frequently Asked Questions
What is URL encoding and why is it needed?
URLs can only contain a limited set of characters defined by RFC 3986: letters (A–Z, a–z), digits (0–9), and a small set of special characters (-, _, ., ~). Any other character — spaces, ampersands, equals signs, Unicode characters, slashes in query values — must be percent-encoded before inclusion in a URL. Percent encoding replaces each unsafe byte with a % followed by two uppercase hexadecimal digits representing the byte value. Without encoding, browsers and servers may misinterpret special characters, breaking the URL structure.
Source: RFC 3986 — Uniform Resource Identifier (URI): Generic Syntax
What is the difference between encodeURI and encodeURIComponent?
JavaScript provides two encoding functions with different scopes. encodeURI() is designed for complete URLs and preserves characters that are valid URL structure characters (/, :, ?, &, =, #, @) — it only encodes characters that are truly unsafe in URLs. encodeURIComponent() is designed for individual URL components (a query parameter value, a path segment) and encodes all characters except letters, digits, and -, _, ., ~ — including /, ?, &, = and other structural characters. Use encodeURIComponent() when encoding values that go inside a query parameter. Use encodeURI() when encoding a full URL that already has its structure set.
Why does a space become %20 in some places and + in others?
Both %20 and + represent a space, but in different contexts. %20 is the standard RFC 3986 percent-encoding of a space and is correct everywhere in URLs. The + convention for spaces comes from HTML form encoding (application/x-www-form-urlencoded), where spaces in form field values are encoded as + for historical reasons. Most modern APIs and servers accept both, but %20 is unambiguous and should be preferred in query strings outside of form submissions to avoid confusion.
What does double-encoding mean and how do I avoid it?
Double-encoding happens when you encode an already-encoded string, turning % into %25. For example, encoding %20 produces %2520 — which decodes to the literal string '%20' rather than a space. This typically happens when a URL is encoded twice: once by your application and once by a library or framework. To avoid it, only encode user-supplied values before inserting them into a URL, and make sure you are not passing already-encoded strings through an encoder again.