Skip to content

URL encode and decode

Percent-encode and decode text for URLs, path segments and form data, following RFC 3986. Both directions update as you type.

UTF-8 text

About this tool

URLs may only contain a small set of characters. Anything else, such as a space, an ampersand or a non-English letter, is written as a percent sign followed by the byte value in hex. This is percent encoding, defined in RFC 3986, and it is what urlencode and encodeURIComponent do.

Type text on the left to encode it, or paste an encoded string on the right to decode it. There are three styles: strict RFC 3986, the encodeURIComponent style that also keeps ! ' ( ) *, and form data, where a space becomes +.

Questions

Should a space be %20 or +?
In a URL path, always %20. In a query string sent by an HTML form (application/x-www-form-urlencoded), a space is written as +. Most servers accept %20 in a query string too.
Why is é encoded as %C3%A9?
Text is first turned into UTF-8 bytes, and é is two bytes in UTF-8, C3 and A9. Each byte gets its own percent escape.
What is the difference between encodeURI and encodeURIComponent?
encodeURI leaves characters that have a meaning in a full URL, such as / ? & and =, untouched. encodeURIComponent escapes them, which is what you want for a single query value or path segment. This page encodes like encodeURIComponent or stricter.
Is my input sent to a server?
No. The page loads a compiled Dart engine into a Web Worker and does all the work in your browser tab. Nothing you type or drop in is uploaded, and the tools keep working offline once the page has loaded.

More tools