1. Home
  2. Developer
  3. URL Encoder / Decoder

URL Encoder / Decoder

Percent-encode and decode text, and break any URL into its parts.

Runs in your browser · No upload Works offline

For a single query value or path segment. Encodes & = ? / # : too, so the value cannot break the URL structure.

Encoded
coffee%20%26%20tea%20%2F%2050%25%20off
Input length 22 chars → Result length 38 chars

Parse a URL

Protocol
https:
Host
shop.example.com
Port
8443
Path
/products/list
Hash (#)
#reviews
Origin
https://shop.example.com:8443
4 query parameter(s)
#KeyValue (decoded)
1categoryrunning shoes
2sortprice_asc
3tagsale
4tagnew

Everything is processed in your browser and never sent to a server.

How to use

  1. Choose Encode and type your text to get the percent-encoded version. To read something like caf%C3%A9, choose Decode.
  2. Pick the function: encodeURIComponent for a single query value or path segment, encodeURI for a complete URL.
  3. For HTML form data (a=1&q=coffee+shop), where spaces arrive as +, keep Treat + as space on.
  4. Paste any address into Parse a URL to see the protocol, host, port, path, hash and a table of decoded query parameters.

encodeURIComponent vs encodeURI

Percent-encoding (RFC 3986) converts each character to UTF-8 bytes and writes every byte as %XX. é is 2 bytes, so it becomes %C3%A9. The two functions differ in which characters they leave alone.

Characters encodeURIComponent encodeURI
A–Z a–z 0–9 - _ . ! ~ * ' ( ) kept kept
; / ? : @ & = + $ , # encoded kept
space %20 %20
é %C3%A9 %C3%A9

Say you append the search term salt&pepper after ?q=. With encodeURI, the & survives and the server sees two parameters, q=salt and pepper. With encodeURIComponent you get q=salt%26pepper, a single value — always use it for values.

Things to watch out for

  • + vs %20: a + meaning a space is a rule of HTML form encoding (application/x-www-form-urlencoded), not of percent-encoding in general, so choose the option that matches where the string came from. The parameter table below reads + as a space, just like the browser’s URLSearchParams.
  • Malformed sequences: a % not followed by two hex digits (as in 100%), or bytes that don’t form valid UTF-8, can’t be decoded. The tool highlights where the problem starts.
  • Double encoding: if %20 shows up as %2520, the value was encoded twice. Decode it twice.

FAQ

Why does a copied URL turn into % codes?

URLs may only contain ASCII characters. Browsers display the readable version in the address bar but copy the real, percent-encoded address. Decoding makes it readable again.

Is the URL sent anywhere?

No. Encoding, decoding and parsing use standard browser functions, and the tool never visits the address you enter — safe for callback URLs containing tokens. To turn binary data into text, use the Base64 Encoder.

Coming soon

Can't find the tool you need?

Tell us what you want to do. We build the most requested tools first.