URL Encode / Decode

Fix broken query strings, decode percent-encoded characters like %20, %3D, and %26, or encode plain text for safe use in URLs. Real-time output, 100% client-side.

Plain text
URL-encoded output
Try:

100% Private

All encoding and decoding happens in your browser using JavaScript's built-in encodeURIComponent and decodeURIComponent functions. Your URLs and query strings are never sent to any server.

Real-Time Output

Output updates instantly as you type — no button to click. Paste a query string and see the decoded values immediately, or type plain text and watch it get percent-encoded character by character.

Error Detection

If you paste a malformed percent-encoded string (e.g. a lone % with no following hex digits), the decoder flags the exact problem so you can fix it without guessing.

How to URL Encode a String

  1. Select the Encode → tab.
  2. Paste or type the text you want to encode in the left box.
  3. The URL-encoded output appears instantly in the right box.
  4. Click Copy to copy the result to your clipboard.

How to URL Decode a String

  1. Select the ← Decode tab.
  2. Paste your percent-encoded string (e.g. hello%20world%21) in the left box.
  3. The decoded, human-readable text appears on the right.
  4. If the input contains invalid escape sequences, an error message explains the problem.

What Is URL Encoding?

URL encoding — formally called percent encoding and defined in RFC 3986 — converts characters that cannot safely appear in a URL into an ASCII-compatible representation. Each character that needs encoding becomes a percent sign % followed by two hexadecimal digits: the UTF-8 byte value of the character.

For example, a space character (UTF-8 byte 0x20) becomes %20. An equals sign (0x3D) becomes %3D. An ampersand (0x26) becomes %26.

CharacterEncodedWhy it matters
Space%20Spaces are illegal in URLs
=%3DSeparates query parameter name from value
&%26Separates multiple query parameters
+%2BAmbiguous — sometimes decoded as a space
/%2FPath separator — must be encoded in values
?%3FStarts the query string — must be encoded in values
#%23Fragment identifier — must be encoded in values
@%40Used in userinfo and email addresses
:%3APort and scheme separator
%%25Escape character itself — must be encoded literally

encodeURIComponent vs encodeURI

JavaScript has two built-in functions for URL encoding, and choosing the wrong one is a common source of bugs:

  • encodeURIComponent — encodes everything except letters, digits, and - _ . ! ~ * ' ( ). Use this for individual query parameter values. This is what this tool uses.
  • encodeURI — leaves URL structural characters intact (: / ? # [ ] @ and others) so a complete URL is not broken. Use this only when you want to encode an entire URL that is already well-formed.

Rule of thumb: if you are encoding a value to put inside a query string (like a search term or a redirect URL), always use encodeURIComponent. If you are encoding an entire URL for use as an attribute value in HTML, use encodeURI first and then encode the result only if needed.

Frequently Asked Questions

What is URL encoding?

URL encoding replaces unsafe characters in a URL with a percent sign (%) followed by two hexadecimal digits. For example, a space becomes %20. This makes it possible to include any character in a URL without breaking the URL structure.

Why does %20 appear in my URLs?

%20 is the URL-encoded form of a space character. It appears when a URL contains a space that was encoded by a browser, form handler, or API. Paste the URL into the Decode tab to read it in plain text.

What is the difference between %20 and + for spaces?

Both represent a space, but in different contexts. %20 is the RFC 3986 standard and is safe anywhere in a URL. The + sign for spaces comes from the older application/x-www-form-urlencoded format used by HTML forms. Stick with %20 unless you are specifically working with HTML form data.

Is my data sent to a server?

No. Encoding and decoding run entirely in your browser using JavaScript's built-in encodeURIComponent() and decodeURIComponent() functions. No network requests are made — you can verify this by opening DevTools and checking the Network tab.

Why do I get an error when decoding?

A decode error means the input contains an invalid percent-escape sequence — for example, a lone % not followed by two hex digits (like %GG or a truncated %2). Fix the broken sequence or re-copy the encoded string from its source.