URL Encoder & Decoder Home/Guides & Research
Developer Tools
November 27, 2026•3 min read•Prinju Prasad

URL Encoding Explained: Percent-Encoding, Query Strings and Common Mistakes

URLs can only contain a limited set of characters. Everything else must be percent-encoded, and getting it wrong breaks links, forms and APIs.

100% Client-Side Privacy: All calculators, converters, and processing run in your browser with zero data uploads.

Put this guide into practice with URL Encoder & Decoder

Instant calculations with full formula breakdowns. No registration required.

How percent-encoding works

RFC 3986 defines a small set of unreserved characters that never need encoding: A–Z a–z 0–9 - . _ ~. Other characters are converted to UTF-8 bytes and each byte is written as % followed by two hexadecimal digits:

space -> %20 é -> %C3%A9 ₹ -> %E2%82%B9

Reserved characters such as / ? # & = : have structural meaning. They must be encoded when they appear inside a value, otherwise they split the URL in the wrong place.

encodeURIComponent vs encodeURI

encodeURI("https://x.com/a b?q=1&r=2") // "https://x.com/a%20b?q=1&r=2" keeps : / ? & = encodeURIComponent("rock & roll") // "rock%20%26%20roll" encodes & and =

Use encodeURIComponent for each value you insert into a URL. Use encodeURI only for a complete URL that is already correctly structured.

+ or %20?

In application/x-www-form-urlencoded data (HTML form submissions and many query strings), a space may be written as +. Elsewhere, such as in the path, + is a literal plus sign. Encoding spaces as %20 is always safe.

Build query strings with URLSearchParams

const params = new URLSearchParams({ q: "café & co", page: "2" }); const url = `https://example.com/search?${params}`; // q=caf%C3%A9+%26+co&page=2 new URL(url).searchParams.get("q"); // "café & co"

Common mistakes

  • Double encoding: encoding an already-encoded value turns %20 into %2520.
  • Forgetting to encode user input, which breaks links or lets values inject extra parameters.
  • Putting secrets in URLs. URLs end up in browser history, server logs and analytics; send sensitive data in the request body instead.

Experience Lightning-Fast, Private In-Browser Computing

Use URL Encoder & Decoder directly in your browser. All algorithms adhere to verified mathematical formulas and industry-standard protocols.