URL Encode & Decode

Percent-encode text for a URL, decode it back, or pull a URL apart into its query parameters. Runs in your browser; nothing is uploaded.

Why URL-encode text?

A URL can only carry a limited set of characters. Spaces, ampersands, question marks, accented letters and emoji have to be written as % escapes, or they break the link, usually by silently cutting a query parameter short rather than failing outright. Encoding makes any value safe to put in a URL; decoding turns a machine-readable link back into something you can read; parsing shows exactly which parameters a link carries.

How it works

  1. Choose Encode, Decode or Parse URL, then type or paste.
  2. When encoding, pick Component for a single value, Full URL for a whole address, Form for + spaces, or strict RFC 3986.
  3. When decoding form data, tick Treat + as space. Double-encoded text is detected and can be decoded in one go.
  4. In Parse URL, edit, add or delete parameters and copy the rebuilt link. Swap feeds a result back in to check the round trip.

Which encoding should I use?

The four styles differ only in which characters they leave alone. Here is what each does to a b&c=d/é!:

URL encoding styles compared
StyleResultSpaceUse it for
Componenta%20b%26c%3Dd%2F%C3%A9!%20One value: a query parameter, a path segment, a URL inside another URL
Full URLa%20b&c=d/%C3%A9!%20A whole address with spaces or accents in it
Form (+)a+b%26c%3Dd%2F%C3%A9%21+HTML form bodies, URLSearchParams, most server frameworks' query parsing
RFC 3986a%20b%26c%3Dd%2F%C3%A9%21%20OAuth 1.0 and AWS signatures, anything that must match byte for byte

Rule of thumb: build the URL from parts, and encode each value with Component (or Form, if the server expects +) just before you join them. Use Full URL only to repair a complete address someone typed with spaces in it; it keeps & and =, so it can't protect a value that contains them.

How percent-encoding works

Each character that needs escaping is converted to its UTF-8 bytes, and each byte is written as % plus two hex digits. A space is one byte, %20. é is two bytes, %C3%A9. The euro sign is three, %E2%82%AC, and an emoji such as 😀 is four, %F0%9F%98%80. Decoding reverses it: the bytes are collected and read back as UTF-8.

RFC 3986 divides characters into unreserved ones that never need escaping (letters, digits and - . _ ~) and reserved ones that separate the parts of a URL (: / ? # [ ] @ and ! $ & ' ( ) * + , ; =). Reserved characters must be escaped when they are data rather than separators: a search for R&D has to be sent as q=R%26D, or the server sees a parameter called D.

Reading and editing a query string

Long links from emails, ads and search results carry their data in the query string. Paste one into Parse URL to see each parameter decoded in a table, for example ?q=red+shoes&size=9&utm_source=newsletter becomes q = "red shoes", size = "9", utm_source = "newsletter". Delete the tracking parameters to get a clean link to share, fix a value, or add one, and copy the rebuilt URL. Parameters that appear more than once are flagged, because servers disagree on whether that means a list, the first value or the last.

URL encoding in code

Every language has both flavours; pick the column that matches what the receiving end expects.

URL encoding functions by programming language
LanguageSpaces as %20Spaces as + (form)
JavaScriptencodeURIComponent(s)new URLSearchParams({ q: s }).toString()
Pythonurllib.parse.quote(s, safe='')urllib.parse.quote_plus(s)
PHPrawurlencode($s)urlencode($s)
JavaURLEncoder.encode(s, UTF_8).replace("+", "%20")URLEncoder.encode(s, UTF_8)
C#Uri.EscapeDataString(s)WebUtility.UrlEncode(s)
Gourl.PathEscape(s)url.QueryEscape(s)

JavaScript's encodeURIComponent leaves ! ' ( ) * unescaped. That's valid, but a signature check that expects strict RFC 3986 will fail, so use the RFC 3986 style to match.

Common mistakes

  • Double encoding. %2520 or %253A in a URL means something encoded a value that was already encoded. Decode shows how many layers there are.
  • Encoding the whole URL as a component. That turns https:// into https%3A%2F%2F and the link stops working. Encode the values, not the address.
  • Plus signs that become spaces. A phone number +44 20… sent unencoded in a query string arrives as " 44 20…". Encode it, and + becomes %2B.
  • Legacy charsets. %E9 is é in Latin-1, not UTF-8, and modern decoders reject it. Re-encode the original text as UTF-8.
  • Putting Base64 in a URL as it is. Its + / = characters get mangled. Use URL-safe Base64 from the Base64 encoder, or encode the value here.

More tools for working with links and web requests: turn a URL into a scannable code with the QR code generator, assemble an API request with the cURL command builder, inspect a token from a redirect with the JWT decoder, or test a pattern against URLs in the regex tester.

Frequently asked questions

What is URL encoding?

URL encoding, or percent-encoding, replaces characters that aren't allowed or have a special meaning in a URL with a % sign and two hex digits for each byte of their UTF-8 form. A space becomes %20, & becomes %26 and é becomes %C3%A9. It lets any text travel safely inside a link.

What's the difference between Component and Full URL encoding?

Component encoding (JavaScript's encodeURIComponent) escapes every character with a special meaning, including / ? & = and :, so use it for a single value such as one query parameter. Full URL encoding (encodeURI) leaves those structural characters alone so the link still works, and only fixes spaces, accents and other unsafe characters. Encoding a whole URL as a component turns https:// into https%3A%2F%2F.

Should a space be %20 or +?

%20 is correct anywhere in a URL. + means a space only in query strings sent as HTML form data (application/x-www-form-urlencoded), which is what the Form style produces. When decoding a query string or form body, tick 'Treat + as space'. If a real plus sign must survive, as in a phone number like +44, it has to be sent as %2B.

Why did decoding fail?

Either a % isn't followed by two hex digits (a literal % must be written %25), or the escapes aren't valid UTF-8, which happens when text was encoded with an old charset such as Latin-1 (%E9 for é instead of %C3%A9). The error names the exact sequence and where it is.

How do I fix a double-encoded URL (%2520)?

%2520 is %20 encoded a second time: the % itself became %25. Decode it, and if the result still contains escapes the tool says how many times it was encoded and offers to decode every layer at once. To stop it happening, encode each value once, right before it goes into the URL, and don't encode a URL that's already encoded.

How can I see and edit the parameters in a long URL?

Switch to Parse URL and paste the link. The scheme, host, port, path and fragment are listed, and every query parameter appears decoded in an editable table. Change a value, delete tracking parameters such as utm_source, or add new ones, and the rebuilt, correctly encoded URL is ready to copy.

Which characters don't need encoding?

Letters A–Z and a–z, digits 0–9, and - . _ ~ are 'unreserved' in RFC 3986 and never need escaping. Characters such as : / ? # [ ] @ ! $ & ' ( ) * + , ; = are reserved: they're fine where they act as separators, but must be encoded when they're part of a value.

What does %25 mean?

It's an encoded percent sign. Because % starts every escape, a literal % must itself be encoded, which is also why encoding a string twice turns %20 into %2520.

Does it handle emoji and non-English characters?

Yes. Every character is converted to UTF-8 first, so é becomes %C3%A9, € becomes %E2%82%AC and 😀 becomes %F0%9F%98%80, and they decode back exactly. If text was cut off in the middle of an emoji, the tool points to the broken character instead of producing a bad link.

Is URL encoding the same as Base64 or HTML encoding?

No. URL encoding makes text safe inside a URL. Base64 turns any data, including binary files, into 64 plain characters. HTML encoding escapes characters like < and & for page markup. None of them hides anything: all three can be reversed by anyone.

Is my text uploaded anywhere?

No. Encoding, decoding and URL parsing run in your browser, so URLs with tokens or personal data in them never reach a server. Only your choice of mode and options is remembered on this device.

Advertisement