%url-decoder.net

URL Encoder

Percent-encode a value, a whole URL or form data. Pick the rules your code uses and see exactly which characters change.

Runs in your browser. Nothing is uploaded.
Direction
Try
29 chars · 32 bytes
Encoded output
price%3D10%E2%82%AC%20%26%20tax%2Ffees%3F%20caf%C3%A9%20%231
60 chars · 60 bytes

Each encoded run is split into characters. Multi-byte UTF-8 sequences are grouped, so %C3%A9 shows as one character.

price=%3DU+003D10€%E2%82%ACU+20AC␠%20U+0020&%26U+0026␠%20U+0020tax/%2FU+002Ffees?%3FU+003F␠%20U+0020café%C3%A9U+00E9␠%20U+0020#%23U+00231
Share links keep your text after the #, which browsers never send to a server.

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

ScopeLeft as-isSpace
ComponentA–Z a–z 0–9 - _ . ! ~ * ' ( )%20
Component, strictA–Z a–z 0–9 - _ . ~%20
Full URLComponent set + ; , / ? : @ & = + $ #%20
Form dataA–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 +.

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