Skip to main content
ToolSmartly

Online URL Encoder & Decoder: Fast & Secure Tool

Instantly encode or decode your URLs and query strings. Three encoding modes (encodeURIComponent, encodeURI, form-urlencoded), URL analyzer with parameter editor, batch processing. No data sent to the server.

Options:
Text to encode
Common special characters

URL encoding: everything developers need to know

L'encodage URL (or percent-encoding) is a mechanism that converts non-ASCII or reserved characters into a sequence of the form %XX where XX is the hexadecimal value of the UTF-8 byte. It is essential for passing data in a URL without corrupting it.

When should you encode a URL?

  • GET parameters containing spaces, accents or special characters
  • File paths with spaces or non-ASCII characters
  • Data in links (href, src, action)
  • API calls : parameter values sent in the query string

encodeURIComponent vs encodeURI

FonctionDoes NOT encodeUsage typique
encodeURIComponent() A-Z a-z 0-9 - _ . ! ~ * ' ( ) Parameter values, slugs
encodeURI() All of the above + ; , / ? : @ & = + $ # Full URL (preserves the structure)
form-urlencoded Idem component, mais espace → + Formulaires HTML, POST data

Using the URL encoder

The tool relies on JavaScript’s built-in functions (encodeURIComponent, encodeURI, decodeURIComponent and the URL object), so you get exactly what your code would produce in a browser or Node.js. Everything is processed locally.

How to use it

  1. Pick a mode: Encode, Decode, Analyse URL or Batch.
  2. To encode, use encodeURIComponent for a parameter value, encodeURI for a complete, well-formed URL, form-urlencoded for form data (space → +).
  3. Paste the text and run it. “Reuse” sends the result back to the input field, for example to decode a second time.
  4. “Analyse URL” splits an address (protocol, host, path, parameters, anchor); you can edit the parameters and rebuild the URL.
  5. “Batch” processes one value per line with encodeURIComponent and exports the result as a TXT file.

Frequently asked questions

Is a space encoded as %20 or +?

Both exist. %20 is standard URL encoding (RFC 3986), produced by encodeURIComponent and encodeURI. The + comes from the HTML form format (application/x-www-form-urlencoded). When decoding, the tool therefore reads + as a space: a literal plus sign must be written %2B.

Should I encode the whole URL or just the parameters?

Encode each value separately with encodeURIComponent, then build the URL. encodeURI leaves &, =, ? and # untouched, so a value like “fish & chips” would break the query string. Encoded properly, it becomes q=fish%20%26%20chips.

How can I spot a double-encoded URL?

%25 is the usual giveaway: %2520 is a %20 whose % was encoded again. Decode once, click “Reuse” and decode again. Upstream, fix the code that encodes twice.

How are accents and emoji encoded?

Each character is first converted to UTF-8 bytes, then each byte to %XX: “é” gives %C3%A9 (2 bytes), “€” gives %E2%82%AC (3 bytes).

Why do some % signs stay as they are after decoding?

They are not a valid UTF-8 sequence: a stray “100%”, or %E9 produced by legacy Latin-1 encoding. The tool decodes every valid sequence and leaves the others intact instead of failing on the whole string.