URL encoder & decoder
Encode or decode a URL component, such as the value of a search parameter, using the rules of encodeURIComponent and decodeURIComponent.
Colors cover the first 20,000 characters. The full content is preserved for copying and downloading.
Colors cover the first 20,000 characters. The full content is preserved for copying and downloading.
Use a component, such as a parameter value. Encoding also transforms : / ? & in a full URL. A plus sign is preserved when decoding.
How to use
- Paste only the component you want to convert, such as a search parameter value, keeping the URL structure separate.
- Choose Encode to apply encodeURIComponent or Decode to apply decodeURIComponent.
- Review the separate output and use Copy. When building a URL, insert the encoded value in the appropriate place without encoding it again.
How it works
The tool handles a component, not an entire URL. Encoding a complete address also converts its separators, such as colons, slashes, and question marks. Decoding rejects malformed percent sequences or invalid UTF-8.
The value “café & chá” becomes caf%C3%A9%20%26%20ch%C3%A1. You can use that output as the value of the q parameter in ?q=caf%C3%A9%20%26%20ch%C3%A1.
Common questions
Should I paste the entire address?
When building a URL, encode each value that will be inserted into it and keep the address structure separate. For example, encode a search phrase before adding it after ?q=.
Why does a space become %20 instead of +?
encodeURIComponent uses %20 for spaces. A plus sign is a convention used by forms and some query parameters; decodeURIComponent keeps a literal + instead of turning it into a space.
Can I encode twice for more protection?
That does not add protection. A second encoding turns each % into %25 and changes the received value. Encode and decode according to the steps required by the system that will consume the component.