URL Encoder
Percent-encode a value, a whole URL or form data. Pick the rules your code uses and see exactly which characters change.
Each encoded run is split into characters. Multi-byte UTF-8 sequences are grouped, so %C3%A9 shows as one character.
What URL encoding does
URL encoding (percent-encoding) converts text to UTF-8 bytes and writes every byte that is not allowed as-is as % followed by two hex digits. A space becomes %20, & becomes %26, and é becomes the two bytes %C3%A9.
Which characters count as “not allowed” depends on where the text goes. That is what the Scope setting controls. Read the full explanation in What is URL encoding?
Which characters each scope keeps
| Scope | Left as-is | Space |
|---|---|---|
| Component | A–Z a–z 0–9 - _ . ! ~ * ' ( ) | %20 |
| Component, strict | A–Z a–z 0–9 - _ . ~ | %20 |
| Full URL | Component set + ; , / ? : @ & = + $ # | %20 |
| Form data | A–Z a–z 0–9 * - . _ | + |
Verified against the browser's own encodeURIComponent, encodeURI and URLSearchParams. See every character.
Encode a URL in code
encodeURIComponent("café au lait & more");
// "caf%C3%A9%20au%20lait%20%26%20more"
const url = new URL("https://example.com/search");
url.searchParams.set("q", "café & more");
url.toString(); // "https://example.com/search?q=caf%C3%A9+%26+more"URLSearchParams uses form encoding, so spaces become +.
from urllib.parse import quote, urlencode
quote("café au lait", safe="") # 'caf%C3%A9%20au%20lait'
urlencode({"q": "café & more"}) # 'q=caf%C3%A9+%26+more'quote keeps / unless you pass safe=""; urlencode uses quote_plus by default.
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
URLEncoder.encode("café au lait", StandardCharsets.UTF_8);
// "caf%C3%A9+au+lait"URLEncoder writes spaces as +. Replace + with %20 if the value goes into a path.
rawurlencode("café au lait"); // "caf%C3%A9%20au%20lait"
urlencode("café au lait"); // "caf%C3%A9+au+lait"rawurlencode follows RFC 3986; urlencode follows form encoding.
import "net/url"
url.PathEscape("café au lait") // "caf%C3%A9%20au%20lait"
url.QueryEscape("café au lait") // "caf%C3%A9+au+lait"PathEscape keeps some reserved characters such as : @ & = +; QueryEscape encodes them.
using System;
Uri.EscapeDataString("café au lait");
// "caf%C3%A9%20au%20lait"Microsoft recommends EscapeDataString for RFC 3986 output; WebUtility.UrlEncode writes spaces as +.
Questions
Which characters need URL encoding?
Letters, digits and - . _ ~ never need encoding. Reserved characters such as : / ? # & = + need encoding when they are part of a value rather than the URL's structure. Spaces, quotes, < > { } | \ ^ ` and every non-ASCII character always need encoding.
Should I use encodeURIComponent or encodeURI?
Use encodeURIComponent for a single value, such as a query parameter or path segment. Use encodeURI only for a complete URL that is already correctly built, because it leaves & = ? / # alone and would let a value break the URL around it.
What does Strict RFC 3986 change?
encodeURIComponent leaves ! ' ( ) * unencoded because they were unreserved in the older RFC 2396. RFC 3986 made them reserved. Strict mode encodes them too, which some OAuth signing and AWS signature schemes require.
Why does my encoded text use + instead of %20?
Form encoding (application/x-www-form-urlencoded), used by HTML forms, URLSearchParams, Java's URLEncoder and PHP's urlencode, writes spaces as +. Generic percent-encoding writes %20. Both are valid in a query string; only %20 is correct in a path.
Is my text sent to a server?
No. Encoding runs in your browser with JavaScript. Nothing you type is uploaded or logged.
Behaviour checked against RFC 3986, the WHATWG URL Standard and MDN. Updated October 3, 2026
Related tools
URL Decoder
Decode percent-encoded URLs and text, detect double encoding and inspect every %XX sequence.
URL Parser
Split a URL into scheme, host, port, path, query and fragment, with checks for common problems.
Query String Parser
Edit query parameters as a table, rebuild the string, or export it as JSON.
Base64 Encode/Decode
Convert text to Base64 and back, including the URL-safe Base64URL alphabet.
HTML Encode/Decode
Escape text to HTML entities and decode entities back to text.
JWT Decoder
Read a JSON Web Token's header and payload and check its expiry.