URL Encoder/Decoder
Percent-encode and decode URLs or just components.
Component uses encodeURIComponent — safe for query values and path segments.
Full URL uses encodeURI — preserves structure like :// and ?.
Input
Output
71 characters
What is a URL Encoder / Decoder?
URL encoding — also called percent-encoding — replaces unsafe characters in a URL with a percent sign followed by a two-digit hexadecimal representation of the character's byte value. It is what turns a space into %20, a plus sign into %2B, and a space-plus-sign combination into %20%2B. Anywhere a URL touches text that was not already URL-safe — search queries, user-submitted form fields, webhook callbacks, deep links — you need this encoding in order to carry the data across the wire intact.
The URL RFC (3986) defines two sets of characters: reserved (those with special meaning inside a URL, like :, /, ?, &,=, #) and unreserved (letters, digits, and a handful of punctuation characters). When you encode, you swap any character that is not unreserved for its percent-encoded form. Anything else — whether it's a Cyrillic letter, an emoji, a whitespace character, or just an accented é — needs encoding.
This tool offers two scopes. Component mode usesencodeURIComponent, which encodes every character except unreserved ones. Use this when you're encoding a single value — a query parameter, a path segment, user-supplied content. Full URL mode uses encodeURI, which preserves the URL-structural characters like :/?#&=+. Use this when you have a whole URL and want to escape only the unsafe bits within it, without breaking the scheme, authority, path, or query structure. Mixing them up is the most common URL-encoding mistake: encodeURI("?a=1&b=2") leaves the ? and & untouched, which is fine for URLs but wrong for a single query value.
Decoding reverses the operation. %20 becomes a space; %E2%98%95 decodes to ☕ (under UTF-8, which is the modern web default). Malformed input — a stray % without two hex digits after, or a sequence that is not valid UTF-8 — throws; the tool shows a friendly error when that happens. If your input was URL-encoded under a non-UTF-8 encoding (old CP-1252 data, for example), you'll need a byte-level converter rather than this browser-level one.
Plus-sign ambiguity is a classic trap. In query strings, the plus character (+) is sometimes used to represent a space (a legacy of application/x-www-form-urlencoded, the HTML form encoding), but in URL paths a plus is just a plus. decodeURIComponent does not convert plus to space. If you're decoding query strings you got from an HTML form, replace + with space first. Our decoder leaves plus alone; you can always paste the result back through a search-and-replace.
How to use the URL Encoder / Decoder
- Pick encode or decode. Tabs at the top flip the direction.
- Choose a scope. Component for single values; Full URL for a complete URL string.
- Paste your input. Any length, any Unicode.
- Copy the result. Ready to paste into an address bar, curl command, or API call.
- Swap and verify. Click swap to feed the output back in and round-trip — a clean encode/decode should give you the exact original.
Features
- Encode and decode in one tool with a quick mode swap.
- Component vs. Full URL scope to match your exact use case.
- Graceful error on malformed input rather than a silent failure.
- Unicode-safe (UTF-8) for emoji and non-Latin scripts.
- Runs entirely in your browser — no data uploaded.
Frequently asked questions
- What's the difference between encodeURI and encodeURIComponent?
- encodeURI preserves URL-structural characters like :/?#&= so a whole URL stays valid after encoding. encodeURIComponent escapes every reserved character, which is correct for a single value being dropped into a query parameter or path segment. If you're building a URL from parts, use encodeURIComponent on each piece; if you're fixing an existing URL, use encodeURI.
- Why does my plus sign survive decoding?
- decodeURIComponent does not convert + to space. That conversion is specific to application/x-www-form-urlencoded (HTML form data). Replace + with space before decoding if your input came from a form submission; our tool leaves it intact so you don't lose real + characters in URLs.
- Can I encode emoji?
- Yes. The encoder uses UTF-8, which is what the web uses. Emoji like ☕ become multi-byte sequences (%E2%98%95 for U+2615). Decoding handles them correctly as long as the input was encoded with UTF-8.
- Does this handle the # fragment correctly?
- In Full URL mode yes — # stays as # so the fragment identifier is preserved. In Component mode, # is encoded as %23 because it's being treated as a single value, not a URL. Pick the right scope for your input.
- Why do I get a 'malformed URI' error?
- The input has a % sign not followed by two valid hex digits, or a sequence that does not form valid UTF-8. This happens when you partially encoded the input or when you try to decode something that was never URL-encoded in the first place.