URL Encoder / Decoder

Encode or decode URLs and query values safely, see exactly which sequences are malformed, and break any link into its protocol, host, path, parameters and fragment.

Runs entirely in your browser. Nothing you add is sent to us.

Create a free account to use the URL Encoder / Decoder

Free forever for this tool. Takes a few seconds — then you come straight back here.

  • All 150 free tools, one login
  • Free website audit with fixes
  • Search Console dashboard
  • Free keyword rank tracker

Already have an account? Sign in

URL Encoder / Decoder — url encoder decoder

A URL encoder converts characters that are not allowed in a web address, such as spaces, accents, ampersands and emoji, into percent-encoded sequences like %20 and %C3%A9, and a decoder turns them back into readable text. Our free tool does both. Choose between encodeURIComponent for a single value, encodeURI for a whole URL, or form mode where spaces become plus signs. When decoding, malformed sequences are pointed out one by one instead of making the whole thing fail. A built-in URL parser also splits any link into its protocol, host, path, query parameters and fragment, lets you edit the parameters in a table, and rebuilds a correctly encoded URL. It all runs in your browser.

How to use the URL encoder

  1. 1 Pick encode or decodeChoose Encode to make text safe for a URL, or Decode to turn percent-encoded text back into readable characters.
  2. 2 Choose the encoding modeUse Component for a single query value or path segment, Full URL for a complete address, or Form when spaces should become + as HTML forms send them.
  3. 3 Paste your textThe result appears instantly. When decoding, any malformed sequences are listed with their position while the valid parts are still decoded.
  4. 4 Parse a full URLPaste a link into the URL parser to see its protocol, host, port, path, query parameters and fragment, with path segments shown decoded.
  5. 5 Edit and rebuildChange, add or remove query parameters and other parts, then copy the rebuilt URL. Values are re-encoded for you.

What URL encoding is

URLs can only contain a limited set of characters: letters, digits and a handful of symbols. Some of those symbols, such as ?, &, = , / and #, have special jobs, separating the path from the query string, one parameter from another, or the page from a fragment. Anything outside the safe set, including spaces, accented letters, non-Latin scripts and emoji, has to be written in a different way.

That way is percent-encoding. Each character is converted to its UTF-8 bytes, and each byte is written as a percent sign followed by two hexadecimal digits. A space becomes %20, an ampersand becomes %26, and é, which is two bytes in UTF-8, becomes %C3%A9. Browsers often show the friendly version in the address bar, but the encoded form is what is actually sent to the server.

encodeURIComponent, encodeURI and form encoding

The three modes differ in which characters they leave alone, and choosing the wrong one is the most common cause of broken links.

  • Component (encodeURIComponent) encodes everything except letters, digits and - _ . ! ~ * ' ( ). Use it for any single piece you are inserting into a URL: a search term, a query value, a redirect address passed as a parameter, or one path segment.
  • Full URL (encodeURI) leaves the structural characters : / ? # @ & = + $ , ; alone and encodes the rest. Use it only on a complete URL that is already assembled, for example to clean up spaces or accents in a link someone has typed.
  • Form encoding (application/x-www-form-urlencoded) works like Component but writes spaces as +. It is what browsers use when a form is submitted with the GET method, and what many server frameworks expect in query strings.
  • Strict RFC 3986 adds encoding of ! ' ( ) and *, which encodeURIComponent leaves alone for historical reasons. Some signing schemes, such as OAuth 1.0 and certain cloud storage APIs, require it.

Why decoding sometimes fails

A percent-encoded string is only valid if every % is followed by two hexadecimal digits and the bytes together form valid UTF-8. When either rule is broken, the browser's decodeURIComponent function stops with a URIError and gives you nothing. That is unhelpful when a URL from a log file or analytics report contains just one bad sequence among many good ones.

This tool decodes what it can and reports each problem separately, with its position. A lone percent sign, such as in 50% off, should have been written as %25. A single byte such as %E9 usually means the text was encoded with the old Latin-1 or Windows-1252 character set rather than UTF-8, and the tool shows what that byte would mean in Windows-1252 to help you identify it. An incomplete sequence, such as %C3 on its own, usually means a URL was cut off part way through a character.

If the decoded result still contains sequences such as %20 or %2F, the text was probably encoded twice. This often happens when a URL is passed through several systems, each adding its own layer of encoding. Use Decode again to remove the next layer, and fix the system that encodes twice if you can.

Plus signs and %20

Spaces cause more confusion than any other character. In the query string, the part after the question mark, a plus sign has traditionally meant a space, because that is how HTML forms encode them. In the path, a plus sign is just a plus sign, and a space must be written as %20. So /garden+chairs and /garden%20chairs are different paths, but ?q=garden+chairs and ?q=garden%20chairs usually mean the same search.

When decoding, tick Treat + as a space only if the text came from a query string or form submission. If you leave it on for a path or an email address that genuinely contains a plus, you will turn real plus signs into spaces. When the URL parser rebuilds a query string, it uses the standard form encoding, so spaces appear as +, which every mainstream server understands.

Email addresses are a good example of why this matters. Many people use addresses such as name+newsletter@example.co.uk to filter their mail. If that address is passed in a query string without encoding the plus sign as %2B, the server will read it as a space and the address will no longer match. Encoding values with Component mode before adding them to a URL avoids the problem completely.

Using the URL parser

The parser uses the same URL engine as your browser, so it splits addresses exactly as a browser would. You see the protocol, any username and password, the host and port, the path with its segments decoded, every query parameter with its decoded value, and the fragment after the hash. If you paste an address without https://, it is assumed so you can still inspect it.

Every part can be edited. This is useful for cleaning tracking parameters off a link before sharing it, changing a UTM value, checking which parameters a long affiliate or advertising link really carries, or building a test URL with awkward characters in its values. Remove a row to drop a parameter, add a row to create one, and copy the rebuilt link when you are done. International domain names are shown in their encoded punycode form, which is how they are sent over the network.

URL encoding and SEO

Search engines handle encoded URLs perfectly well, but readable addresses are easier for people to trust, share and remember. For page addresses you control, use short, lower-case words separated by hyphens and avoid spaces and special characters altogether, so encoding is never needed. Our URL Slug Generator does this for you.

Be consistent once a URL is live. To a server, /café and /caf%C3%A9 are the same page, but a link written with + instead of %20 in the path, or with different capitalisation, may lead somewhere else or create a duplicate. If you change an address, add a 301 redirect from the old version. Encoding problems in internal links are a common cause of 404 errors in crawl reports, and decoding them here is a quick way to see what the link was meant to be.

Examples you can copy

The same text in each mode

Text:                 café & crème / 50% off?
Component:            caf%C3%A9%20%26%20cr%C3%A8me%20%2F%2050%25%20off%3F
Full URL (encodeURI): caf%C3%A9%20&%20cr%C3%A8me%20/%2050%25%20off?
Form (+):             caf%C3%A9+%26+cr%C3%A8me+%2F+50%25+off%3F

A URL split into parts

https://shop.example.co.uk:8443/products/garden%20chairs?colour=sage+green&size=L#reviews

protocol   https
host       shop.example.co.uk
port       8443
path       /products/garden%20chairs   (segments: products, garden chairs)
query      colour = sage green
           size   = L
fragment   reviews

Common mistakes to avoid

Using encodeURI on a single value

encodeURI leaves & = and ? alone, so a value containing them will break the query string. Use encodeURIComponent for values.

Encoding a whole URL with encodeURIComponent

This encodes the :// and slashes too, producing something that is no longer a working link. Encode only the parts you insert.

Encoding twice

Encoding text that is already encoded turns %20 into %2520. Decode first, or check whether your framework encodes for you.

Turning real plus signs into spaces

Only treat + as a space in query strings and form data. In paths and email addresses, a plus is a literal character.

Writing a bare % in a URL

A percent sign must be encoded as %25. Otherwise it will be read as the start of an encoded sequence and may break decoding.

Frequently asked questions

Use encodeURIComponent for a single piece of a URL, such as a query value or path segment. Use encodeURI only for a complete URL that is already structured, because it leaves characters such as ? & = and / alone.

Both are valid in different places. HTML forms send spaces in query strings as +, while %20 works everywhere in a URL. In a path, + is a literal plus sign, so use %20 there.

Letters A–Z and a–z, digits 0–9 and the four characters - _ . ~ are always safe anywhere in a URL. Everything else may need encoding depending on where it appears.

URLs use UTF-8, where letters outside basic English take two, three or four bytes. Each byte is written as its own %XX code, so é becomes %C3%A9.

It is an encoded forward slash. It lets a slash appear inside a value, such as a redirect address in a query parameter, without being read as a path separator.

Yes. Paste them on separate lines in decode mode. Line breaks are kept, and each URL is decoded in place.

No. Encoding, decoding and parsing all happen in your browser, so URLs with private tokens or customer details stay on your device.

It normalises the address as a browser does: lower-casing the scheme and host, removing default ports such as 443 for https, and writing query values in standard form encoding.

Free website audit

See how your site scores, free

Speed, SEO, DNS, email (SPF/DKIM/DMARC) and security in one scan, with a prioritised fix list.