URL Encode & Decode

Percent-encode text, query values and full URLs, or decode %20-style URLs back to readable text, line by line if you like.

Runs in your browser. Nothing is uploaded.

How to use the URL Encode & Decode

  1. Choose Encode or Decode, then type or paste text into the left box, or press Load example.
  2. Choose what you're encoding. Pick A value for a single query parameter or path segment, A full URL to keep the URL's structure, or Form data if spaces should become +.
  3. The percent-encoded result appears on the right as you type.
  4. Tick Each line separately to encode a list of values at once.
  5. Copy the result into your link, code or API request.

A link with an unencoded & or # in a parameter silently loses data. Everything after the # becomes a page anchor, and an extra & starts a new parameter. Spaces and non-English letters can break links in emails, chat apps and older systems. Percent-encoding fixes all of this by turning each risky character into a safe %XX code.

Three modes for three jobs

  • A value: for a single query parameter, path segment or anything you insert into a URL. Every reserved character is encoded, so Café & bar becomes Caf%C3%A9%20%26%20bar. This matches JavaScript’s encodeURIComponent, plus encoding of ! ' ( ) * for strict compatibility.
  • A full URL: for a complete address that contains spaces or non-ASCII characters. Structural characters such as : / ? # & and = are kept, so the URL still works. This matches encodeURI.
  • Form data: the format browsers use when submitting a form, where spaces become +.

UTF-8 throughout

Characters are first converted to UTF-8 bytes and then percent-encoded, which is what every modern browser and server expects. So é becomes %C3%A9, and emoji become four %XX codes.

Decoding URLs

Switch to Decode to read percent-encoded text such as caf%C3%A9%20%26%20bar. Multi-byte UTF-8 sequences become the right characters, and Treat + as a space handles form data and many query strings. Tracking links are often encoded twice or more; Decode repeatedly keeps going until the text stops changing and tells you how many rounds it took. An invalid sequence, such as a lone %, is reported with its position. Swap sends the result back in the other direction.

Batch encoding

Tick Each line separately to encode a list of values, such as product names or search terms, one per line, keeping the lines separate in the output. Everything runs on your device. To reverse the process, switch to Decode.

Frequently asked questions

What is URL encoding?

URLs can only contain a limited set of characters. URL encoding, also called percent-encoding, replaces anything else with a % followed by two hex digits for each byte. A space becomes %20, & becomes %26, and é becomes %C3%A9 because it is two bytes in UTF-8.

What's the difference between encoding a value and a full URL?

A value, like a search term, must have every special character encoded, including & = ? / and #, otherwise they'd change the URL's meaning. A full URL keeps those characters, because they are the URL's structure, and only encodes characters that aren't allowed at all, such as spaces.

Should spaces be %20 or +?

Both are used. %20 works everywhere in a URL. + means a space only in the query string of HTML form submissions (application/x-www-form-urlencoded). Choose Form data if you're building that format, and A value otherwise.

Which characters are left unencoded?

Letters A–Z and a–z, digits 0–9, and - _ . ~ are always safe. In value mode, ! ' ( ) * are encoded too, which is the strictest and safest choice.

Is my text sent anywhere?

No. Encoding happens in your browser.

Tutorials