Skip to content
Utilgrove

URL Encode / Decode

Percent-encode text for URLs and query strings, or decode encoded URLs back to readable text. Handles UTF-8 and the component vs full-URL distinction.

How to use this tool

Encode: paste text and choose Component (for a value you’ll put into a query string) or Full URL (for a complete address that just needs spaces and special characters escaped).

Decode: paste an encoded URL or value to see it readable. + is treated as a space, as in form data.

The rules

A URL may only contain ASCII letters, digits and a small set of symbols. Everything else must be percent-encoded as the UTF-8 bytes of the character:

Character Encoded
space %20 (or + in form data)
& %26
= %3D
? %3F
/ %2F
# %23
é %C3%A9
%E2%82%AC
%E6%97%A5

Characters that never need encoding: A–Z a–z 0–9 - _ . ~.

Why it matters

Special characters in a URL have jobs: ? starts the query string, & separates parameters, = separates a name from its value, # starts a fragment. If a value contains one of those characters unencoded, the URL is misread. The classic example: a search for fish & chips sent as ?q=fish & chips turns into a parameter q=fish plus a nameless parameter chips. Encoded as ?q=fish%20%26%20chips, it works.

In code

Language Component encode Decode
JavaScript encodeURIComponent(s) decodeURIComponent(s)
Python urllib.parse.quote(s, safe='') urllib.parse.unquote(s)
PHP rawurlencode($s) rawurldecode($s)
Java URLEncoder.encode(s, "UTF-8") (uses +) URLDecoder.decode(s, "UTF-8")
Go url.QueryEscape(s) url.QueryUnescape(s)

Common mistakes

  • Double encoding%20 becomes %2520. Encode once, at the point where you build the URL.
  • Encoding the whole URL — turns https:// into https%3A%2F%2F. Use full-URL mode or encode only values.
  • Wrong charset — old systems encoded with Latin-1, producing %E9 for é instead of %C3%A9. Modern standards mandate UTF-8.
  • Trusting decoded input — decoded values may contain anything; validate before using them in HTML or SQL.

Frequently asked questions

What is URL encoding?

Replacing characters that aren't allowed in a URL with a % followed by their byte value in hex — a space becomes %20, an ampersand %26, é becomes %C3%A9. It's also called percent-encoding.

What's the difference between "component" and "full URL" encoding?

Component encoding escapes everything that has meaning in a URL, including / ? & = and :, so the result is safe as a single value. Full-URL encoding leaves those structural characters alone and only escapes spaces and non-ASCII, so a complete address stays valid.

Why does a space sometimes become + instead of %20?

Historical form encoding (application/x-www-form-urlencoded) uses + for spaces in query strings. %20 is the general standard. The decoder here accepts both.

Should I encode the whole URL?

Usually not. Encode each query-string value with component encoding and assemble the URL yourself; encoding an entire URL that's already correct will double-encode the % signs.

Last updated August 26, 2026.