URL Encoder

Percent-encode text so it can be used safely in a URL, for example in a query-string value. Non-ASCII characters are encoded as UTF-8.

Options
Encode as

Processed in your browser. Nothing you type is uploaded.

How it works

Characters that have special meaning in URLs, or that are not allowed in them, are replaced with a percent sign and two hexadecimal digits for each UTF-8 byte. A space becomes %20, “é” becomes %C3%A9 and “&” becomes %26.

Choose “a value” to encode a single piece of a URL, such as a search term, where / ? & = # must be encoded. Choose “a full URL” to encode spaces and non-ASCII characters in a complete address while keeping its structure.

Rules this tool follows

  • Value mode uses the same rules as JavaScript’s encodeURIComponent; full-URL mode matches encodeURI.
  • Letters, digits and - _ . ! ~ * ' ( ) are never encoded.
  • “Encode spaces as +” produces the form-style encoding used in HTML form submissions.
  • Text containing a broken emoji half (a lone surrogate) cannot be encoded, and you get a clear error.

Example

Input

café & crème/100%

Output

caf%C3%A9%20%26%20cr%C3%A8me%2F100%25

Common uses

  • Building links with search terms or parameters.
  • Encoding values for APIs and webhooks.
  • Making non-ASCII file names safe in links.

Limitations and notes

  • Encoding an already-encoded value encodes the % signs again (%20 becomes %2520). Decode first if you are unsure.
  • This is not encryption; anyone can decode it.

All web text tools