Percent-encode URLs, URI components, and query strings with encodeURIComponent, encodeURI, or query string (+) mode.
The most common source of URL encoding bugs is using the wrong mode. This tool offers three modes matching the three JavaScript and web standards functions. Here is exactly when to use each:
The same character encodes differently depending on the mode. This table shows the most important differences, referenced against RFC 3986:
These four mistakes account for most URL encoding bugs in production. Each shows the problem, the correct approach, and why it happens.
URL encoding converts characters that are not allowed or have special meaning in URLs into a safe representation. Each character is replaced by a percent sign (%) followed by two hexadecimal digits representing the character's UTF-8 byte value. For example, a space becomes %20 and é (U+00E9) becomes %C3%A9.
encodeURIComponent() encodes all characters except A–Z, a–z, 0–9, and - _ . ! ~ * ' ( ). Use it for individual values inside a URL. encodeURI() additionally preserves URL structural characters like : / ? # & = so it does not break the URL shape. Use it only on a fully-formed URL, never on a value.
Use + for spaces only in application/x-www-form-urlencoded data — HTML form submissions and query strings on older APIs that expect this format. Use %20 (component mode) everywhere else, especially in URL path segments. A + in a path is a literal plus sign, not a space.
RFC 3986 defines unreserved characters that never need encoding: uppercase and lowercase letters (A–Z, a–z), digits (0–9), and four symbols: hyphen (-), underscore (_), period (.), and tilde (~). All other characters must be percent-encoded when used as data values inside a URL component.
Non-ASCII characters are first converted to their UTF-8 byte sequence, then each byte is percent-encoded separately. For example, é (U+00E9) is 0xC3 0xA9 in UTF-8, which becomes %C3%A9. JavaScript's encodeURIComponent() handles this automatically.
Double-encoding converts every % character into %25. For example, hello%20world becomes hello%2520world. The status bar in the output panel shows the count of percent-encoded sequences — if you see %25 in the output from encoding a string, the input was likely already encoded.
Yes. All encoding runs in your browser using the native encodeURIComponent() and encodeURI() JavaScript APIs. No data is sent to any server. Open DevTools → Network to verify — there are zero outbound requests.