URL Encoder / Decoder

Encode and decode URL strings. Handles UTF-8, query parameters, and special characters — all in your browser, no upload, instant results.

About the URL Encoder / Decoder

This URL encoder / decoder runs entirely in your browser. Type or paste a string into the input box, then click Encode to percent-encode it for safe use in a URL, or Decode to convert an encoded string back to plain text. Nothing is uploaded to a server — the conversion happens instantly with JavaScript on your device.

Why URL encoding is needed

URLs can only be sent over the internet using the ASCII character set. Many characters — such as spaces, question marks, ampersands, and non-ASCII letters like é, ñ, or Chinese, Japanese and Korean characters — are not allowed or have special meaning in a URL. URL encoding (also called percent encoding) replaces each unsafe character with a % followed by two hexadecimal digits, for example %20 for a space or %E2%82%AC for the euro sign .

Without encoding, a space in a query parameter would break the URL, and an ampersand & would be mistaken for a separator between parameters. Encoding guarantees that any text — including UTF-8 multibyte characters — can be transmitted safely.

encodeURI vs encodeURIComponent

JavaScript provides two related functions, and this tool uses encodeURIComponent for full encoding:

  • encodeURI() — Encodes a complete URL but leaves reserved characters (; , / ? : @ & = + $ #) intact, so the URL structure is preserved. Use it when you want to encode an entire URL.
  • encodeURIComponent() — Encodes every character that has special meaning in a URL, including the reserved ones. Use it for individual query parameter names and values, so they do not conflict with the URL syntax.

This tool uses encodeURIComponent because it is the safer choice for encoding query parameter values and arbitrary text fragments. The corresponding decode functions (decodeURI and decodeURIComponent) reverse the process.

How to use the converter

  1. Paste or type your text in the input box.
  2. Click Encode to percent-encode the text, or Decode to convert an encoded string back.
  3. Click Swap to move the output into the input box and clear the output, so you can run the opposite operation.
  4. Click Copy output to copy the result to your clipboard, or Clear to start over.

Frequently asked questions

Does this tool upload my text? No. All conversion happens locally in your browser. Your text never leaves your device.

What happens if I decode an invalid string? The tool will show an error toast. A malformed percent sequence (for example %ZZ) cannot be decoded and will be reported.

Does it handle UTF-8 and non-ASCII characters? Yes. encodeURIComponent encodes all UTF-8 characters correctly, including emoji, CJK characters, and accented letters.

Should I use Encode or Decode for a full URL? If you have a complete URL and only want to encode a single parameter value, paste just that value. Encoding an entire URL with this tool will also encode the :// and / separators, which is usually not what you want for a full address.