Developer tools

URL Encoder & Decoder

Percent-encode text for use in URLs and query strings, or decode an encoded URL back to readable text.

Type or paste to begin

What it is for

URLs can only contain a limited set of characters. Spaces, accents, emoji, ampersands and slashes inside a value all have to be written as percent-encoded escapes such as %20 or %C3%A9, otherwise a server reads them as part of the URL structure. This tool encodes text for a query parameter or a path segment, or encodes a whole URL while keeping its structure intact, and decodes any encoded string back to readable text so you can see what a tracking link or API call actually contains.

How to use it

  1. Choose Encode or Decode and paste into the left box. The result on the right updates as you type.
  2. When encoding, pick Component for a single value such as a search term or query parameter, or Full URL to escape only the characters that are not allowed while keeping :, / and ? as they are.
  3. Tick Spaces as + when you need the format used by HTML forms (application/x-www-form-urlencoded). Decoding treats + as a space when the same box is ticked.

Questions

What is the difference between Component and Full URL?
Component (encodeURIComponent) escapes everything except letters, digits and - _ . ! ~ * ' ( ), which is right for a value you are putting into a parameter. Full URL (encodeURI) leaves the characters that give a URL its structure, such as : / ? # & =, untouched, so it is for encoding an address you already have.
Should a space be %20 or +?
Both are valid, in different places. %20 is correct anywhere in a URL. + means a space only in the query string of a form submission. When in doubt use %20.
Why does decoding fail?
A % that is not followed by two hex digits is malformed, so the browser refuses to decode it. This usually means the text was already decoded once, or it contains a literal % sign that should have been written as %25.