URL Encoder & Decoder
Encode or decode URLs and text instantly using encodeURIComponent or encodeURI
Common URL-Encoded Characters Reference
| Character | Encoded | Description |
|---|---|---|
| (space) | %20 | Space character |
! | %21 | Exclamation mark |
# | %23 | Hash / fragment |
$ | %24 | Dollar sign |
& | %26 | Ampersand |
+ | %2B | Plus sign |
/ | %2F | Forward slash |
: | %3A | Colon |
; | %3B | Semicolon |
= | %3D | Equals sign |
? | %3F | Question mark |
@ | %40 | At sign |
Paste any URL or text, pick encode or decode, and get the percent-encoded (or decoded) version instantly — using the same encodeURIComponent and encodeURI functions browsers use under the hood. Switch between modes, swap input and output, or turn on live encoding that updates as you type. And everything runs in your browser. Nothing gets uploaded.
How It Works
URL encoding replaces characters that aren't allowed in URLs — things like spaces, brackets, and non-Latin characters — with a percent sign followed by two hex digits. A space becomes %20, a forward slash becomes %2F. Decoding reverses that process. The tool gives you two modes: encodeURIComponent (encodes almost everything, good for query parameter values) and encodeURI (leaves structural characters like / and : alone, good for full URLs).
Examples
Encoding a search query with spaces and symbols
You are building a Google search link and need the query string encoded properly.
best coffee shops & cafés near me
best%20coffee%20shops%20%26%20caf%C3%A9s%20near%20me
Decoding a tracking URL from an email campaign
A marketing link is full of encoded parameters and you need to read what it actually says.
https%3A%2F%2Fexample.com%2Fpromo%3Futm_source%3Dnewsletter%26utm_medium%3Demail
https://example.com/promo?utm_source=newsletter&utm_medium=email
Encoding a JSON payload for a GET request
Some APIs accept JSON as a query parameter. The curly braces, quotes, and colons all need encoding.
{"name":"Jane Doe","city":"São Paulo"}
%7B%22name%22%3A%22Jane%20Doe%22%2C%22city%22%3A%22S%C3%A3o%20Paulo%22%7D
Who Uses This
Building API calls, debugging query strings, or constructing redirect URLs that pass data through parameters.
Reading UTM-tagged campaign links that look like a wall of percent signs to figure out what each parameter actually says.
Checking whether URLs with special characters — accents, CJK characters, symbols — survive the encoding round-trip correctly.
Learning how the web handles characters behind the scenes, especially for coursework on HTTP and web protocols.
Common Mistakes
You encode a string, then paste the result into another tool that encodes it again. Now %20 becomes %2520 and nothing works. Encode once. If your output already has percent signs, you probably don't need to encode it again.
encodeURI skips characters like &, =, and / because it assumes you're encoding a full URL. If you are encoding a parameter value that contains those characters, use encodeURIComponent instead — otherwise the value bleeds into the URL structure.
Feeding plain text into a decoder usually works fine — it just returns the same text. But if the text accidentally contains a % followed by two characters (like %GE), you will get a "malformed URI" error. Only decode strings that were actually percent-encoded.
Technical Details
- Processing: 100% client-side — uses JavaScript's built-in encoding functions
- Browser Support: Chrome, Firefox, Safari, Edge
- Standards: RFC 3986 (URI syntax), RFC 1738 (URL format)
- Character Sets: Full UTF-8 support, including emoji and CJK characters
Frequently Asked Questions
What is the difference between encodeURI and encodeURIComponent?
encodeURI is meant for encoding a complete URL. It leaves characters like :, /, ?, and & untouched because those are structural parts of a URL. encodeURIComponent encodes almost everything, which makes it the right choice when you're encoding a value that goes inside a query parameter. Wrong pick here is probably the most common encoding bug on the web.
Why do spaces sometimes become %20 and sometimes become +?
Two different specs. The %20 form follows RFC 3986 — that is what encodeURIComponent produces. The + form comes from the older application/x-www-form-urlencoded format used by HTML forms. Both mean "space," but they show up in different contexts. If you are building a query string by hand, %20 is the safer bet.
Is URL encoding the same as Base64 encoding?
Not at all. URL encoding replaces individual unsafe characters with percent-hex pairs — the output is still mostly readable. Base64 turns entire binary data into an ASCII string of letters, digits, +, and /. They solve different problems. URL encoding makes text safe for URLs; Base64 makes binary data safe for text-based systems like email or JSON.
Can I URL-encode an entire URL including the protocol?
You can, but you probably shouldn't — at least not with encodeURIComponent. That would turn https:// into https%3A%2F%2F, which breaks the URL structure. Use encodeURI if you want to encode a full URL while keeping the protocol and slashes intact. Use encodeURIComponent only for the individual pieces like parameter values.
Do I need to URL-encode letters and numbers?
No. Letters (A-Z, a-z), digits (0-9), and a handful of special characters (-, _, ., ~) are "unreserved" in RFC 3986 and never need encoding. Everything else — spaces, punctuation, accented letters, emoji — should be encoded when used in a URL.