A copied value like summer%20shoes is easy to read once you know that %20 means a space. But a longer string containing %26, %2B and %25 needs more care. When I explain how to decode URL encoded text, I start by separating two jobs: reading the text and preserving the working link. I built URL Decoder and tried the steps below as part of my testing on a budget Android phone and a laptop. Here's the process I'd use with you.
How do I decode URL encoded text online?
I start with the smallest piece of text that answers my question. If I only need a search phrase, I copy its encoded value rather than the entire address. My URL Decoder is the direct option for turning percent-encoded text into something you can read.
My step-by-step decoding check
- Keep a copy of the original text before changing anything.
- For a full address, preserve the original URL separately.
- For one query value, copy only that value after identifying its boundaries.
- Open URL Decoder and paste summer%20shoes into the input.
- Use Decode and check that the result reads summer shoes.
- Replace the sample with your encoded component and decode it once.
- Compare the output with the original, paying attention to spaces, plus signs and punctuation.
For example, I can read spring%20promo as spring promo without changing the campaign link that carried it. That distinction matters. The decoded phrase is useful in a report, but it isn't automatically the right replacement inside a URL. If the result contains an ampersand, inserting it unencoded could change how a query is split into parameters.
Tip from me: I use a harmless sample first when checking a decoding workflow. summer%20shoes gives me an obvious expected result without exposing a private query or token.
What do percent codes such as %20 and %26 mean?
I read percent-encoding as a way to write bytes. Each escape has a percent sign followed by two hexadecimal digits. %20 represents the byte for a space. The letters in an escape aren't case-sensitive, so %3a and %3A both represent a colon. I don't treat that difference in letter case as a decoding error.
| Encoded text | Decoded text | What I watch for |
|---|---|---|
| %20 | Space | A space within the value |
| %2F | / | Data that could look like a path separator |
| %3A | : | A colon within the value |
| %26 | & | Data that could look like a query separator |
| %3D | = | Data that could look like a name/value separator |
| %3F | ? | Data that could look like a query marker |
| %23 | Hash sign | Data that could look like a fragment marker |
| %2B | + | A literal plus after one decoding pass |
| %25 | % | A literal percent sign after one pass |
Why one character can need several escapes
I don't assume one escape equals one visible character. With UTF-8, non-ASCII text can use several bytes. For example, caf%C3%A9 decodes to café: the é uses the byte sequence %C3%A9. Decoding those bytes together matters. Replacing escapes individually with guessed characters can produce broken text instead of the intended word.
For the underlying rules, I use RFC 3986, sections 2.1 to 2.4. It also explains why some punctuation has a structural role. A slash that belongs inside a value and a slash that separates path segments may look identical after decoding, even though their jobs were different.
Can I decode just one part of a URL?
Yes, and that's usually my preference. I separate the URL into its parts before decoding their contents. My URL Parser helps with that inspection. I want to know which text is the hostname, which is the path, and which belongs to a query parameter before reserved characters become visible.
Keep an encoded ampersand inside its value
Take https://example.com/search?q=red%26blue&source=email. I identify q as one parameter and source as another. Then I decode the q value, red%26blue, into red&blue. That ampersand belongs to the search phrase. It wasn't a separator between parameters in the original query.
If I decode the whole string first and then split it at every ampersand, I could mistake blue for another parameter. That's the practical reason behind the parse-first advice in RFC 3986. I don't need complicated input to trigger the problem. One encoded punctuation mark is enough.
- For a search term, I decode the parameter value after parsing the query.
- For a filename, I identify its path segment before decoding it.
- For an encoded destination inside a parameter, I extract that value before inspecting the inner URL.
- For a working link I plan to share, I preserve the original encoding unless I have a clear reason to rebuild it.
What is the difference between %20 and +?
I treat %20 as a percent-encoded space. A plus sign needs more context. In application/x-www-form-urlencoded data, a space is written as +. That form rule doesn't make every plus sign in every URL a space. A literal plus can belong in other components, so replacing all plus signs across an address is a bad shortcut.
My check for form-style query values
For a form-style value, summer+shoes means summer shoes. But decodeURIComponent('summer+shoes') returns summer+shoes because that function handles percent escapes, not the form convention for plus signs. I choose the rule based on where the text came from, rather than deciding that whichever output looks nicer must be correct.
The order matters too. In form-style input, %2B represents a literal plus. I convert raw plus signs to spaces before percent-decoding, not after. Otherwise, decoding %2B into + and then replacing that plus would destroy the distinction between a real plus sign and an encoded space.
Tip from me: When I don't know whether a value is form-encoded, I keep the original and check its source. I don't silently turn + into a space just to make a phrase read better.
How do I decode URL text in JavaScript?
For a single encoded component, I use decodeURIComponent(). The expression decodeURIComponent('summer%20shoes') returns summer shoes. It doesn't parse parameter names and values for me. I also expect it to reject malformed escapes or invalid UTF-8, so I handle URIError instead of assuming every copied string will decode.
Use URLSearchParams for a query string
For query parameters, I prefer URLSearchParams. The expression new URLSearchParams('q=summer+shoes&tag=red%26blue').get('q') returns summer shoes. Calling get('tag') on those same parameters returns red&blue. The parser identifies the parameter boundaries and decodes the values, including the form-style treatment of plus signs.
For a complete address, I use new URL('https://example.com/search?q=summer%20shoes').searchParams.get('q'). That returns summer shoes. I don't pass the entire address to URLSearchParams as though it were just a query string. And I don't run decodeURIComponent() again on the returned value, because the query parser has already decoded it.
If I have an isolated value that I know came from form-style data, I replace its raw plus signs with spaces before passing it to decodeURIComponent(). I reserve that extra step for known form-style input. MDN's decodeURIComponent reference explains this pattern and the errors the function can throw.
Which decoding method should I choose, including Python?
I choose a decoder by the input and the job, not by the language alone. Reading one copied value doesn't need the same workflow as parsing query parameters in an application. I also want to know what happens to bad bytes, because a visible result isn't always evidence that the input was valid.
| Method | When I choose it | Main caution |
|---|---|---|
| URL Decoder | Reading a copied encoded component | Keep the original and check plus-sign context |
| JavaScript decodeURIComponent() | Decoding one component in code | Doesn't parse queries or convert raw + to spaces |
| JavaScript URLSearchParams | Reading query names and values | Uses form-style rules and already decodes values |
| Python unquote() | Decoding percent escapes in a string | Replaces invalid sequences by default |
| Python unquote_plus() | Decoding a form-style value | Also converts raw + to spaces |
My Python choice: unquote or unquote_plus
In Python, I import unquote and unquote_plus from urllib.parse. Then unquote('summer%20shoes') returns summer shoes, while unquote_plus('summer+shoes') also returns summer shoes. Plain unquote('summer+shoes') leaves the plus sign intact. I use the plus variant only when the input follows form-style rules.
Python's unquote() uses UTF-8 and replacement for invalid sequences by default. When I want invalid UTF-8 to stop the operation instead, I can specify errors='strict', as in unquote('%C3', errors='strict'). That difference helps explain why Python might show replacement text while JavaScript throws an error for the same broken byte sequence.
Why does decoding fail or leave percent codes behind?
I check the exact input before blaming the decoder. A percent sign needs two hexadecimal digits to form an escape. An input ending in % or %2 is incomplete, and %GG isn't a valid escape. With decodeURIComponent(), those cases can produce URIError. So can escaped bytes that don't form valid UTF-8.
Separate broken escapes from broken UTF-8
- For an incomplete escape, I check whether copying cut off the end of the value.
- For an invalid pair such as %GG, I go back to the source instead of guessing replacement digits.
- For valid-looking escapes that still fail, I check whether the bytes form valid UTF-8.
- For replacement characters in the result, I check the decoder's error handling before treating the output as recovered text.
Remaining escapes need a different check. Decoding %2520 once produces %20 because %25 represents a literal percent sign. The result could be intended text, or it could come from another documented encoding layer. Its appearance alone doesn't tell me which. I don't keep pressing Decode until every percent sign disappears.
RFC 3986 warns against decoding the same string repeatedly because literal data can become another escape. If a system deliberately wraps an already encoded value, I handle each known layer at its proper boundary. Without that context, I preserve the one-pass result and ask where the value came from.
What URL decoding mistakes should I avoid?
My main rule is read first, rebuild separately. Decoding is useful for inspection, but readable text isn't automatically a ready-to-use address. If I need to put a changed value back into a URL, I use the correct encoding step for that component. My URL Encoder handles the opposite task from URL Decoder.
- I don't replace %26 across a whole URL and then split the result into parameters.
- I don't convert every plus sign to a space without checking the input format.
- I don't decode values again after URLSearchParams has returned them.
- I don't delete a troublesome percent sign just to make an error disappear.
- I don't overwrite the original link with a display-only decoded version.
I also check that I've chosen the right kind of decoding. Percent-encoding isn't encryption, Base64, HTML entity encoding or URL shortening. If the input is Base64, I use Base64 Encoder and Decoder instead. A URL decoder won't reverse an unrelated format just because the string looks unreadable.
For campaign reviews, I keep the encoded URL alongside the readable parameter values. That lets me inspect a campaign name without losing the address I actually received. I prefer this to cleaning everything in place, because it makes accidental changes much easier to spot.
Is a decoded URL safe to open?
I don't treat successful decoding as a safety check. It tells me what the encoded text says, not who controls the destination. A readable address can still be misleading, and decoding doesn't remove redirects. If the source is unfamiliar, I inspect the address before deciding whether to open anything.
- I preserve the original and inspect the hostname using URL Parser.
- I decode only the components needed to understand the link, including any encoded destination value.
- I check redirect behavior with Redirect Checker when the destination needs further inspection.
- If I'm still unsure, I visit the known main site directly rather than following the unfamiliar link.
My Redirect Checker serves a different purpose from URL Decoder. Decoding reveals encoded text. Checking redirects examines where a request is sent next. Neither operation, by itself, gives me a reason to trust an unknown destination or proves that a page is harmless.
I apply the same care to private data. A query can contain information I shouldn't share, so I remove sensitive material from examples and avoid pasting it into an environment I haven't checked. For debugging, I often only need a harmless sample that preserves the troublesome escape or plus-sign pattern.
Questions people ask
What does %20 mean in a URL?
I read %20 as a percent-encoded space. For example, red%20shoes decodes to red shoes. That helps me understand a value, but I don't automatically replace the encoded version in a working link. In form-style query data, a space can also be represented by a plus sign.
Why does decodeURIComponent not convert + to a space?
I use decodeURIComponent() for percent escapes, and a raw plus sign isn't one. The plus-to-space rule belongs to form-style encoding. For query parameters, I normally choose URLSearchParams. For an isolated value known to use form rules, I replace raw plus signs with spaces before percent-decoding.
How do I decode a query string in JavaScript?
I use URLSearchParams for a query string, such as new URLSearchParams('q=red%20shoes').get('q'). That returns red shoes. For a full address, I use new URL(address).searchParams. I don't decode the returned value again because the parser has already applied decoding and handled form-style plus signs.
How do I decode URL-encoded Unicode characters or emoji?
I use a decoder that interprets the escaped bytes as UTF-8, rather than replacing each escape by hand. Non-ASCII characters can span several escaped bytes. JavaScript decodeURIComponent() rejects invalid UTF-8, while Python unquote() replaces invalid sequences by default. I check those differences when the output looks damaged.
Should I decode a URL more than once?
I don't repeatedly decode the same string just because percent codes remain. After one pass, %2520 becomes %20, which may be literal intended text. If the source documents separate encoding layers, I handle each layer at its boundary. Otherwise, I preserve the result and investigate before changing it further.
What causes a malformed URI sequence error?
I check for incomplete escapes, non-hexadecimal digits and invalid UTF-8 byte sequences. JavaScript decodeURIComponent() can throw URIError for those inputs. I compare the value with its original source instead of deleting characters until it works. A decoder that substitutes replacement characters may hide the same underlying damage.
What to do next
I start by keeping the original URL, then identifying the exact component I need to read. You can do the same now: open URL Decoder, paste a non-sensitive encoded value, and decode it once. Check spaces, plus signs and any punctuation that appears. If the result still contains escapes, investigate the source rather than repeating the operation blindly. For queries in code, use a query parser instead of splitting a fully decoded string. And before opening an unfamiliar destination, inspect its hostname and redirects. Readable text is the goal of decoding, not a guarantee of a safe or repaired link.