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

  1. Paste your input. Drop text, a URL, or a percent-encoded string into the Input box. Encoding happens live as you type.
  2. Pick a mode. Keep Encode to turn text into percent-encoded form, or switch to Decode to turn %XX sequences back into readable characters.
  3. Choose the encode function. In Encode mode, encodeURIComponent is the default and the right pick for query parameter values and path segments. Select encodeURI when you are encoding a complete URL whose structure (://?#&) must stay intact.
  4. 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

Building search URLs from user input A search box typed cats & dogs must become ?q=cats%20%26%20dogs. Without encoding, the & would split the query into two parameters.
Fixing OAuth and login redirect links A 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.
Decoding links from server logs and emails Paste a percent-encoded URL from a log line into Decode mode to see the real parameter values instantly, instead of eyeballing %3D and %26.
Untangling double-encoded strings Seeing %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.
Handling non-English text in URLs Accented characters and emoji must be UTF-8 encoded first, then percent-encoded byte by byte. This tool shows exactly what the encoded form looks like.

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.

Related Tools You Might Like

Base64 Encoder/Decoder Encode and decode Base64 strings for APIs and URLs. HTML Entity Encoder Escape special characters for HTML output. JWT Decoder Inspect JSON Web Tokens safely in your browser.