What is a URL made of, and what does URL encoding do?
A URL has a scheme, an authority (host and port), a path, an optional query string of key=value pairs and an optional fragment (RFC 3986). Characters that have a meaning inside a URL — spaces, &, =, /, ? and anything outside ASCII — must be percent-encoded (a space becomes %20) so the receiver can tell data from structure. Browsers follow the WHATWG URL Standard when they parse and serialize URLs.
How to use URL Encoder
- Paste the value or URL.
- Choose the mode: component for query values, URI for whole URLs, form for HTML form bodies.
- Check the escaped-characters table.
- Copy the encoded output.
| Character | component | uri | form | rfc3986 |
|---|---|---|---|---|
| space | %20 | %20 | + | %20 |
& | %26 | not encoded | %26 | %26 |
= | %3D | not encoded | %3D | %3D |
/ | %2F | not encoded | %2F | %2F |
? | %3F | not encoded | %3F | %3F |
é | %C3%A9 | %C3%A9 | %C3%A9 | %C3%A9 |
! ' ( ) | not encoded | not encoded | %21 %27 %28 %29 | %21 %27 %28 %29 |
* | not encoded | not encoded | not encoded | %2A |
~ | not encoded | not encoded | %7E | not encoded |
- . _ | not encoded | not encoded | not encoded | not encoded |
componentencodeURIComponent (query values)uriencodeURI (whole URL, keeps / ? & =)formapplication/x-www-form-urlencoded (space → +)rfc3986RFC 3986 strict (also encodes ! * ' ( ))
“Encode every character” escapes every byte, letters included. Each cell is produced by the tool’s own encoder.
URL Encoder features
- encodeURIComponent, encodeURI, form-urlencoded (+ for spaces), strict RFC 3986 and encode-everything modes
- Table of every escaped character with its code point and encoding
- Encode each line separately for lists of values
- Hints when the chosen mode does not fit the input (e.g. full URL with encodeURIComponent)
- Live results with length statistics
URL Encoder example
Encode a query value with Unicode
Input:
q=café & théOutput:
q%3Dcaf%C3%A9%20%26%20th%C3%A9Frequently asked questions about URL Encoder
encodeURIComponent or encodeURI — which one do I need?
Use encodeURIComponent for a single value that goes into a query string or path segment: it escapes "&", "=", "/" and "?". Use encodeURI for a complete URL so that its structure characters stay intact.
Why are spaces sometimes "+" and sometimes "%20"?
"+" is the HTML form convention (application/x-www-form-urlencoded) and is only valid in query strings and form bodies. "%20" works everywhere. Choose the "form" mode to get "+".
What is RFC 3986 strict mode?
JavaScript's encodeURIComponent leaves ! * ' ( ) unescaped, but RFC 3986 lists them as reserved. Strict mode encodes them too, matching PHP's rawurlencode and OAuth 1.0 signature rules.
How are Unicode characters encoded?
They are converted to UTF-8 bytes first and each byte becomes %XX, so "é" becomes %C3%A9 and Arabic letters become two or three escapes each.
Technical notes
Percent-encoding (RFC 3986) replaces each byte of the UTF-8 representation with %XX. Which characters stay literal depends on the mode: encodeURIComponent keeps letters, digits and - _ . ! ~ * ' ( ); encodeURI also keeps the URL delimiters ; , / ? : @ & = + $ #; form mode follows the WHATWG application/x-www-form-urlencoded serializer, keeping only letters, digits and * - . _ and writing spaces as "+" (so ~ ! ' ( ) become %7E %21 %27 %28 %29); strict mode keeps only the RFC 3986 unreserved characters (letters, digits, - . _ ~); and "Encode every character" escapes every byte, letters included. Lone surrogates, which would make encodeURIComponent throw, are replaced with U+FFFD in every mode.
References
- RFC 3986: Uniform Resource Identifier (URI): Generic SyntaxThe parts of a URI (scheme, authority, path, query, fragment), reserved characters and percent-encoding.
- URL StandardHow browsers actually parse, serialize and encode URLs, including application/x-www-form-urlencoded.