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…

What is a URL made of, and what does URL encoding do?

A URL has a scheme, an authority (host and port), a path, an optional query string of key=value pairs and an optional fragment (RFC 3986). Characters that have a meaning inside a URL — spaces, &, =, /, ? and anything outside ASCII — must be percent-encoded (a space becomes %20) so the receiver can tell data from structure. Browsers follow the WHATWG URL Standard when they parse and serialize URLs.

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.
The same characters in the four main modes: a dash means the mode leaves the character as it is.
Charactercomponenturiformrfc3986
space%20%20+%20
&%26not encoded%26%26
=%3Dnot encoded%3D%3D
/%2Fnot encoded%2F%2F
?%3Fnot encoded%3F%3F
é%C3%A9%C3%A9%C3%A9%C3%A9
! ' ( )not encodednot encoded%21 %27 %28 %29%21 %27 %28 %29
*not encodednot encodednot encoded%2A
~not encodednot encoded%7Enot encoded
- . _not encodednot encodednot encodednot encoded
  • componentencodeURIComponent (query values)
  • uriencodeURI (whole URL, keeps / ? & =)
  • formapplication/x-www-form-urlencoded (space → +)
  • rfc3986RFC 3986 strict (also encodes ! * ' ( ))

“Encode every character” escapes every byte, letters included. Each cell is produced by the tool’s own encoder.

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. Which characters stay literal depends on the mode: encodeURIComponent keeps letters, digits and - _ . ! ~ * ' ( ); encodeURI also keeps the URL delimiters ; , / ? : @ & = + $ #; form mode follows the WHATWG application/x-www-form-urlencoded serializer, keeping only letters, digits and * - . _ and writing spaces as "+" (so ~ ! ' ( ) become %7E %21 %27 %28 %29); strict mode keeps only the RFC 3986 unreserved characters (letters, digits, - . _ ~); and "Encode every character" escapes every byte, letters included. Lone surrogates, which would make encodeURIComponent throw, are replaced with U+FFFD in every mode.

References