URL Encode & Decode

Percent-encode or decode text and links, and read query strings.

What do you want to do?

Converted in your browser. Never uploaded, saved or put in this page’s link.

Component suits one query value or path segment.

Examples

Result

Encoded

Encoded 22 characters to 32 characters in component (encodeURIComponent) mode.

Output

Hello%20World%20%26%20Friends%3F
Input length
22 characters
Output length
32 characters

Fix the highlighted field to update the result.

How to use

  1. Choose Encode or Decode, then type or paste your text or link.
  2. When encoding, pick what it is for: a part of a URL (one query value or path segment), a whole URL, or form data.
  3. When decoding, choose whether + means a space. It does in query strings.
  4. Copy the result. Links with a query string also get a table of every parameter, decoded.

Everything runs in your browser, so links with tokens or personal details stay private.

How percent-encoding works

A URL may only contain certain characters. Anything else is turned into UTF-8 bytes, and each byte is written as % plus two hex digits (RFC 3986). A space is byte 20, so it becomes %20; é is two bytes, %C3%A9.

  • Never encoded: A–Z, a–z, 0–9 and - . _ ~.
  • Delimiters such as / ? # & = are kept in a whole URL but encoded inside one value, so they can’t break it apart.
  • % itself becomes %25.

Examples

Character Part of a URL Whole URL Form data
space %20 %20 +
& %26 & %26
/ %2F / %2F
? %3F ? %3F
+ %2B + %2B
é %C3%A9 %C3%A9 %C3%A9
~ ~ ~ %7E

“Hello World & Friends?” encoded as a part of a URL is Hello%20World%20%26%20Friends%3F. As form data it is Hello+World+%26+Friends%3F.

%2520, + signs and which mode JavaScript uses
  • %2520 means the text was encoded twice: % became %25. Decode once to get %20, then again to get the space. RFC 3986 warns never to encode a string twice.
  • Part of a URL matches JavaScript’s encodeURIComponent, and whole URL matches encodeURI. Form data matches URLSearchParams and HTML forms (the WHATWG URL Standard).
  • Bad input such as %zz or a broken byte sequence is reported with its position, instead of a bare “URI malformed”.

Want to share the finished link on paper or a screen? Turn it into a code with the QR code generator.

Frequently asked questions

What is URL encoding?

Replacing characters that aren’t safe in a URL with % and two hex digits per byte. A space becomes %20 and é becomes %C3%A9, its two UTF-8 bytes.

Should a space be %20 or +?

%20 is correct anywhere in a URL. + means a space only in form-style query strings, which HTML forms and URLSearchParams produce.

What is the difference between encodeURIComponent and encodeURI?

encodeURIComponent encodes everything except letters, digits and - _ . ! ~ * ’ ( ). encodeURI also keeps ; , / ? : @ & = + $ # so whole URLs work.

Why does my link contain %2520?

It was encoded twice: the % of %20 became %25. Decode it once to get %20, and again to get the space. RFC 3986 warns against encoding twice.

Which characters never need encoding?

The unreserved ones: A–Z, a–z, 0–9, hyphen, period, underscore and tilde (RFC 3986). Other characters are delimiters or must be percent-encoded.

Is my URL sent anywhere?

No. Encoding, decoding and the parameter table all run in your browser, and the text is never added to this page’s link or saved.