URL Encoder

Runs in browser Encoding

Encode using encodeURIComponent, encodeURI or application/x-www-form-urlencoded rules (spaces as +). See exactly which characters were escaped.

Privacy: This tool runs entirely in your browser. Your input never leaves your device.
Loading tool…

How to use URL Encoder

  1. Paste the value or URL.
  2. Choose the mode: component for query values, URI for whole URLs, form for HTML form bodies.
  3. Check the escaped-characters table.
  4. Copy the encoded output.

URL Encoder features

  • encodeURIComponent, encodeURI, form-urlencoded (+ for spaces), strict RFC 3986 and encode-everything modes
  • Table of every escaped character with its code point and encoding
  • Encode each line separately for lists of values
  • Hints when the chosen mode does not fit the input (e.g. full URL with encodeURIComponent)
  • Live results with length statistics

URL Encoder example

Encode a query value with Unicode

Input:

q=café & thé

Output:

q%3Dcaf%C3%A9%20%26%20th%C3%A9

Frequently asked questions about URL Encoder

encodeURIComponent or encodeURI — which one do I need?

Use encodeURIComponent for a single value that goes into a query string or path segment: it escapes "&", "=", "/" and "?". Use encodeURI for a complete URL so that its structure characters stay intact.

Why are spaces sometimes "+" and sometimes "%20"?

"+" is the HTML form convention (application/x-www-form-urlencoded) and is only valid in query strings and form bodies. "%20" works everywhere. Choose the "form" mode to get "+".

What is RFC 3986 strict mode?

JavaScript's encodeURIComponent leaves ! * ' ( ) unescaped, but RFC 3986 lists them as reserved. Strict mode encodes them too, matching PHP's rawurlencode and OAuth 1.0 signature rules.

How are Unicode characters encoded?

They are converted to UTF-8 bytes first and each byte becomes %XX, so "é" becomes %C3%A9 and Arabic letters become two or three escapes each.

Technical notes

Percent-encoding (RFC 3986) replaces each byte of the UTF-8 representation with %XX. Unreserved characters (letters, digits, - . _ ~) are never encoded; which reserved characters are kept depends on the mode. Lone surrogates, which would make encodeURIComponent throw, are replaced with U+FFFD.