URL Encode and Decode

Turn text into a form that is safe inside a URL, or decode a percent-encoded string back to readable text. Three modes cover query values, whole URLs and HTML form submissions.

How to use the URL Encode and Decode

  1. Choose Encode or Decode, then the mode that matches where the text will be used.
  2. Type or paste into the input box. The output updates as you type.
  3. Use Component mode for a single query value or path segment, Full URL mode for a complete address you want to keep intact, and Form data mode for application/x-www-form-urlencoded bodies.
  4. To read the parameters of a link, paste it into the query string parser below. Each parameter is shown with its decoded value.

How percent-encoding works

URLs may only contain a limited set of ASCII characters (RFC 3986). Every other byte is written as a percent sign followed by two hex digits. Text is first converted to UTF-8 bytes, so "é" becomes %C3%A9 and a space becomes %20.

The unreserved characters A-Z, a-z, 0-9, hyphen, period, underscore and tilde are never changed. Characters such as ? & = # / have a job in the URL syntax, so they must be encoded when they appear inside a value.

Component, full URL and form modes

Component mode encodes everything except letters, digits and - _ . ! ~ * ' ( ), which is what the JavaScript function encodeURIComponent does. Use it for a value that you will place after "q=" or inside a path segment.

Full URL mode (encodeURI) leaves the characters that structure a URL, such as : / ? # & = and +, untouched, so an entire address keeps working. Form mode follows the application/x-www-form-urlencoded rules used by HTML forms, where a space is written as + instead of %20.

Frequently asked questions

When do I need to encode a URL?

Whenever a value contains spaces, non-ASCII characters or characters with meaning in a URL, such as & = ? #. Without encoding, an ampersand inside a value would be read as the start of the next parameter.

What is the difference between %20 and + for a space?

%20 is valid anywhere in a URL. A plus sign means a space only in form-encoded data, typically in the query string. In a URL path a plus sign is just a plus sign.

Why does decoding fail with an error?

The text contains a percent sign that is not followed by two hex digits, or the percent-encoded bytes do not form valid UTF-8. Fix or remove the broken sequence and try again.

Should I encode an entire URL with component mode?

No. That would also encode the colon and slashes, turning "https://" into "https%3A%2F%2F", which is not a working address. Use full URL mode for whole addresses and component mode for individual values.

Is the text I enter uploaded anywhere?

No. Encoding and decoding are done by your browser, and nothing is sent to a server.