Processing...

πŸ”— URL Encoder / Decoder

Encode and decode URL components, query strings, and form data instantly β€” free, client‑side, and privacy‑focused.

πŸ” Percent Encoding πŸ”„ Encode / Decode πŸ“‹ Copy to Clipboard

🌐 What is URL Encoding?

URL encoding (percent encoding) converts unsafe characters into a format that can be safely transmitted over the internet. URLs can only contain ASCII characters from a limited set (A-Z, a-z, 0-9, and some special symbols like -_.~). All other characters must be encoded.

Encoded characters are represented as % followed by two hexadecimal digits. For example, a space becomes %20, and an ampersand (&) becomes %26.

βš™οΈ How to Use This Tool

  • To encode: Enter plain text (e.g., hello world & co) and click Encode. You'll get hello%20world%20%26%20co.
  • To decode: Enter an encoded string (e.g., hello%20world) and click Decode.
  • Clear resets both fields.
  • Swap copies the output back to the input for quick round‑trip testing.
  • Click Copy Result to copy the output to your clipboard.

πŸ“Š Common URL Encoding Table

CharacterEncoded ValueDescription
%20Space
!%21Exclamation mark
"%22Double quote
#%23Hash / fragment
$%24Dollar sign
%%25Percent sign
&%26Ampersand (query separator)
'%27Single quote
(%28Left parenthesis
)%29Right parenthesis
+%2BPlus sign
,%2CComma
/%2FForward slash
:%3AColon
;%3BSemicolon
=%3DEquals sign
?%3FQuestion mark
@%40At symbol

πŸ”§ When to Use encodeURI vs encodeURIComponent

This tool uses encodeURIComponent and decodeURIComponent, which are the standard JavaScript functions for encoding/decoding query parameters and form data.

  • encodeURIComponent encodes all characters except A-Z a-z 0-9 - _ . ! ~ * ' ( ). It is safe for encoding a value to be placed in a query string.
  • decodeURIComponent reverses the process.

For whole URLs (not just components), use encodeURI which leaves characters like / ? # unencoded. But for most form/API data, encodeURIComponent is correct.

❓ Frequently Asked Questions

In application/x-www-form-urlencoded (form data), spaces are encoded as +. But in standard URL encoding, spaces become %20. This tool follows the RFC 3986 standard, using %20 for spaces.

The tool will show an error message. For example, a string like %XX (invalid hex) will cause a URIError. You'll be prompted to correct your input.

Yes. JavaScript's encodeURIComponent encodes non-ASCII characters as multiple percent-encoded bytes representing their UTF-8 sequence. For example, "ΓΌ" becomes %C3%BC. Decoding restores the original character.

πŸ”§ Related Tools