What is a URL Encoder and Decoder?
URL encoding — formally percent-encoding — rewrites characters that a URL cannot carry as a percent sign followed by two hex digits. A space becomes `%20`, an ampersand inside a query value becomes `%26`, and a Bengali letter becomes three such triples because UTF-8 needs three bytes for it.
The rule comes from RFC 3986. A small set — A–Z, a–z, 0–9 and `-._~` — is always safe. Everything else is escaped, and the distinction that trips people up is scope: `encodeURIComponent` escapes `:` `/` `?` `&` `=` as well, which is right for a single query value and wrong for a whole link; `encodeURI` leaves those structural characters alone and only escapes what would genuinely break the URL.
This tool exposes both scopes. Choose “a query value” when the text is going after `?q=`, and “a whole URL” when you are cleaning up a link that contains a space or an accented character but should keep its slashes and question mark.
How to encode or decode a URL
- Pick Encode or Decode at the top.
- When encoding, choose the scope: a query value, or a whole URL. The hint underneath explains what stays literal.
- Paste the text or link. Encoding a full URL that is already correct changes nothing, which is a useful check.
- Press Convert. A malformed decode — a lone `%` or a truncated pair — reports an error rather than guessing.
- Press Copy to take the result, then paste it into your code, your HTML or the address bar.
URL Encoder and Decoder limits and rules
| Item | Limit |
|---|---|
| Standard | RFC 3986 percent-encoding |
| Always safe | A–Z a–z 0–9 - . _ ~ |
| Query scope | Escapes : / ? & = # and every other reserved character |
| Whole-URL scope | Keeps : / ? # & = and escapes spaces and non-ASCII |
| Non-ASCII | Encoded as UTF-8 bytes — one Bengali letter becomes nine characters |
| Spaces | Written as %20, never as +; the plus form is for form bodies, not URLs |
| Decoding | Always percent-decodes, and does not turn + into a space |
| Practical URL length | About 2,000 characters before browsers and servers start truncating |
When to use it
- Building a search link by hand: `https://example.com/search?q=` plus the encoded query, so a space or an ampersand does not split the parameter.
- Reading a tracking or redirect URL whose parameters are unreadable until decoded.
- Fixing a link copied out of a PDF or an email client, where spaces arrived as `%20` or as literal spaces that break the address bar.
- Sending a callback URL as a parameter — the inner link has to be encoded so its own `?` does not end the outer query.
- Checking why an API rejects a request: an unencoded `#` in a value truncates everything after it, and encoding shows where.
Is it private?
Everything runs inside your browser. Your text and files are never uploaded, never stored and never seen by anyone else — including me. You can use the tool with the network tab open and watch no request leave the page. Closing the tab erases the input.
Frequently asked questions
Scope. `encodeURIComponent` escapes every reserved character, including `: / ? & =`, so the result is safe to place inside a parameter but is no longer a working URL on its own. `encodeURI` keeps those structural characters and only escapes spaces and non-ASCII, so the result is still a link. The two buttons here are exactly those two functions.
Because you encoded it as a query value. `https://` contains `:` and `/`, which that scope escapes. Switch to “a whole URL” to keep the scheme and slashes intact, or decode the result to get the readable link back.
In a URL path or query, `%20`. The `+` form comes from HTML form submission (`application/x-www-form-urlencoded`) and means space only in that context, which is why a `+` in a query string is ambiguous. This tool always writes `%20` and never converts `+` on decode.
Percent-encoding works on bytes, not characters, and UTF-8 uses three bytes for most non-Latin scripts. Each byte becomes `%XX`, so one Bengali or Chinese character takes nine characters. That expansion is why long non-English query strings hit URL length limits quickly.
Yes, and it is the most common bug in this area. Encoding an already-encoded string turns `%20` into `%2520`, because the percent sign itself gets escaped. If a value looks like `%25`, decode once and check before encoding again.
No. The conversion is a single built-in JavaScript call on your device. Nothing is logged, stored or transmitted, which matters when the URL contains a token or a signed parameter.
Related tools
Written and maintained by Md. Nur Hossain Repon.