URL Encoder / Decoder
Percent-encode text for URLs (spaces to %20, & to %26) or decode escaped URLs back to readable text. Paste your text, pick Encode or Decode, and copy the result. Choose encodeURIComponent for single values or encodeURI for full URLs. Everything happens in your browser. Nothing is sent to a server.
How to Use This Tool
- Paste your input. Drop text, a URL, or a percent-encoded string into the Input box. Encoding happens live as you type.
- Pick a mode. Keep Encode to turn text into percent-encoded form, or switch to Decode to turn
%XXsequences back into readable characters. - Choose the encode function. In Encode mode,
encodeURIComponentis the default and the right pick for query parameter values and path segments. SelectencodeURIwhen you are encoding a complete URL whose structure (://?#&) must stay intact. - Copy, swap, or clear. Use Copy Output to grab the result, Swap In/Out to run it through another pass, or Clear to start over.
Real-World Use Cases
cats & dogs must become ?q=cats%20%26%20dogs. Without encoding, the & would split the query into two parameters.
redirect_uri parameter carries a whole second URL inside the outer one. Its ? and & characters must be encoded so they do not corrupt the outer URL.
%3D and %26.
%2520? Hit Swap In/Out and decode twice to confirm the string was encoded more than once, then fix the code path that did it.
Frequently Asked Questions
What is URL encoding?
URL encoding (also called percent-encoding) converts special characters into a format safe for URLs. For example, a space becomes %20 and & becomes %26.
What is the difference between encodeURIComponent and encodeURI?
encodeURIComponent encodes every reserved character, making it safe for a single query parameter value. encodeURI preserves URL structure characters like :/?#&, so it is used when encoding a full URL.
Is this URL encoder safe?
Yes. All encoding and decoding happens entirely in your browser using the built-in encodeURIComponent, encodeURI, and decodeURIComponent functions. Nothing is sent anywhere.
Why does my URL show %20 instead of spaces?
%20 is the percent-encoded representation of a space. URLs cannot contain literal spaces, so they are encoded whenever the URL is transmitted.
Can I decode double-encoded URLs?
Yes. If your string contains %2520, decode once to get %20, then decode again to get a space.
What is the difference between %20 and + for spaces?
%20 is the RFC 3986 way to encode a space and is safe everywhere in a URL. The + sign means space only in query strings submitted by HTML forms (application/x-www-form-urlencoded). In a path segment, a literal + is just a plus sign, so %20 is the safer choice. This tool's Decode mode converts + to spaces, matching form behavior.
Do I need to encode non-English characters and emoji?
Yes. Non-ASCII characters are first converted to their UTF-8 byte sequence, then each byte is percent-encoded. For example, café becomes caf%C3%A9 and an emoji becomes a four-byte escape like %F0%9F%9A%80. encodeURIComponent handles this automatically, and this tool does the same.
Why is there %2520 in my URL instead of %20?
%2520 means the string was encoded twice. The space became %20, then the percent sign itself was encoded as %25, producing %2520. Decode it twice to recover the original text, then fix the code path that encoded it more than once.