How to use
- Choose Encode and type your text to get the percent-encoded version. To read something like
caf%C3%A9, choose Decode. - Pick the function:
encodeURIComponentfor a single query value or path segment,encodeURIfor a complete URL. - For HTML form data (
a=1&q=coffee+shop), where spaces arrive as+, keep Treat + as space on. - 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’sURLSearchParams.- Malformed sequences: a
%not followed by two hex digits (as in100%), or bytes that don’t form valid UTF-8, can’t be decoded. The tool highlights where the problem starts. - Double encoding: if
%20shows 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.