How to use the URL Encode / Decode
- 1
Paste text or a URL
Put a link, a query value or encoded text in the box.
- 2
Choose an action
Encode component for a single value, Encode full URL for a whole link, or Decode.
- 3
Read the parts table
If the box holds a valid URL, its protocol, host, port, path, hash and query parameters appear below.
- 4
Copy
The box is updated in place; use Copy to take the result.
Features
Component encoding
Uses encodeURIComponent, escaping / ? & = # and every other reserved character.
Full-URL encoding
Uses encodeURI, keeping the URLโs structure while fixing spaces and non-ASCII text.
Forgiving decode
Turns + into a space and decodes every %XX sequence, including multi-byte UTF-8.
Parameter table
Each query parameter is listed separately, already decoded.
Unicode-ready
Hindi, emoji and accented text are encoded as UTF-8 bytes, as browsers and servers expect.
Clear errors
A % not followed by two hex digits is reported instead of producing garbage.
Who uses it โ and for what
Marketers
Build and check UTM links with campaign names that contain spaces or symbols.
Developers
Encode a redirect URL or search term before adding it to a query string.
Support teams
Decode long, unreadable links from logs or customer reports.
SEO specialists
Read encoded non-English URLs and check their parameters.
Component vs full URL encoding
Encode component (encodeURIComponent) escapes every reserved character including / ? & =. Use it for a single value you are putting into a query string, such as a search term or a redirect URL.
Encode full URL (encodeURI) leaves the URL structure intact and only escapes spaces and characters that are not allowed, which is right for cleaning up a complete link that contains spaces or non-English text.
Reading the parts of a URL
Whenever the input is a valid URL, the table shows the protocol, host, port, path, hash and each decoded query parameter. This is handy for checking UTM tags on marketing links, debugging redirect URLs or reading tracking parameters. A space can appear as %20 or + in query strings; decoding handles both.
How percent-encoding works
A URL may only contain a limited set of ASCII characters. Everything else โ spaces, Hindi or Tamil letters, emoji, and reserved characters used as data โ is written as UTF-8 bytes, each shown as % plus two hex digits. A space is one byte (%20), โน is three (%E2%82%B9), and many emoji are four.
Characters fall into three groups:
| Group | Examples | encodeURI | encodeURIComponent |
|---|---|---|---|
| Unreserved | AโZ aโz 0โ9 - _ . ~ | Kept | Kept |
| Reserved (structure) | : / ? # @ ! $ & ' ( ) * + , ; = | Kept | Escaped, except ! ' ( ) * |
| Everything else | space, %, <, >, ", non-ASCII | Escaped | Escaped |
The + sign has a history: in HTML form submissions (application/x-www-form-urlencoded) a space is sent as +, so decoders for query strings treat + as a space. In a path, + is just a plus. That is why a literal plus in a value should always be sent as %2B.
Habits that avoid broken links
- Encode values, not whole URLs. Build the link from parts and encode each parameter value as a component.
- Encode exactly once. Encoding an already-encoded value turns
%20into%2520. If you see%25followed by two hex digits, something was encoded twice. - Decode only for reading. Paste the decoded form into a browser and it will usually re-encode correctly, but systems that store or sign URLs (payment callbacks, OAuth redirects, signed download links) need the exact encoded string.
- Check UTM tags in the parts table. A missing
&or an extra?shows up immediately as a wrong parameter list.
For a closer look at a linkโs structure โ origin, user info, and each parameter with its raw and decoded form โ use the URL Parser. For binary data in URLs, URL-safe Base64 is often used; see Base64 Encode / Decode.
Worked examples
Component vs full URL
Input: https://shop.example.com/search?q=steel bottle & cup&city=เคจเค เคฆเคฟเคฒเฅเคฒเฅ
Encode full URL:
https://shop.example.com/search?q=steel%20bottle%20&%20cup&city=%E0%A4%A8%E0%A4%88%20%E0%A4%A6%E0%A4%BF%E0%A4%B2%E0%A5%8D%E0%A4%B2%E0%A5%80Spaces and Hindi letters are encoded, but the & inside โbottle & cupโ is not โ so a server would read q as โsteel bottle โ and see a stray parameter. Encode full URL cannot know which & is data. The correct approach is to encode each value as a component and build the URL from the pieces: steel bottle & cup as a component is steel%20bottle%20%26%20cup.
Encode component on the whole link escapes everything, including https%3A%2F%2F โ right only when the entire URL is itself a parameter value, such as ?redirect=โฆ.
Decoding pitfalls
%E0%A4%A8%E0%A4%88decodes toเคจเคโ each Hindi letter takes three bytes.C%2B%2Bdecodes toC++, but plainC++decodes toCfollowed by two spaces, because the decoder treats + as an encoded space.100%on its own cannot be decoded (a bare %); encoded as a component it is100%25.
Pro tips
- If decoding fails with โMalformed percent-encodingโ, look for a lone % (for example โ50% offโ) and replace it with %25 first.
- Encode a redirect or callback URL with Encode component before putting it inside another URLโs query string.
- The parts table updates as you type, so you can paste a link and read its parameters without pressing any button.
Glossary
- Percent-encoding
- Writing a byte as % followed by two hexadecimal digits, for example %20 for a space.
- Reserved character
- A character with a structural meaning in URLs, such as ?, & or /.
- Query string
- The part of a URL after ?, made of name=value pairs separated by &.
- UTM parameters
- Standard query parameters such as utm_source and utm_campaign used to track marketing links.
Frequently asked questions
What does %20 mean in a URL?
It is an encoded space. Characters that are not allowed in URLs are replaced with % followed by their hex byte value.
Should I use encodeURI or encodeURIComponent?
Use encodeURIComponent for individual parameter values and encodeURI for a complete URL.
Why is + turned into a space?
In query strings, + traditionally means a space, so the decoder treats it that way.
Why does my encoded Hindi URL look so long?
Each Devanagari letter is three UTF-8 bytes, and each byte becomes three characters (%XX), so one letter takes nine characters. Browsers usually display the readable version in the address bar.
Is %20 or + correct for spaces?
Both are understood in query strings. %20 is correct everywhere, including paths, so it is the safer choice; this toolโs encoders always produce %20.
Does encoding make a URL secure?
No. Encoding only makes characters valid in a URL; anyone can decode it. Never put passwords or secrets in URLs.
Last updated 2026-11-28 ยท Built by Vinayak Agarwal ยท Part of Developer & Web (77 tools)