URL Encoder & Decoder

Encode and decode URLs and query strings to and from UTF-8 percent-encoding. Supports encodeURIComponent, encodeURI, and RFC 3986.

Samples:
Encoding Standard:
Space Format:
Result:
</> Embed this tool on your website / blog No code required · Copy and paste
HTML Embed Code (iframe):
<iframe src="https://lucentool.com/url-encoder-decoder" width="100%" height="650" style="border:1px solid #e5e0d8;border-radius:12px;max-width:850px;width:100%;" frameborder="0"></iframe>
<div style="font-size:12px;color:#78716c;margin-top:6px;font-family:sans-serif;">Powered by <a href="https://lucentool.com/url-encoder-decoder" target="_blank" style="color:#c85a32;text-decoration:none;">Lucentool - URL Encoder & Decoder Online</a></div>

encodeURI vs encodeURIComponent Explained

The URL specification (RFC 3986) mandates that only certain ASCII characters are valid. Non-ASCII characters (like Chinese or accents) and reserved delimiters must be converted to hexadecimal percent-encoding:

What happens in the page

rfc3986Encode() starts from encodeURIComponent and then escapes the five characters that function leaves alone — the exclamation mark, apostrophe, round brackets and asterisk — because RFC 3986 does not list them as unreserved. That difference matters when a signature is computed over the encoded string: a stray apostrophe changes the hash. transform() applies the chosen mode, which decides whether structural characters such as slash, colon, question mark and ampersand survive, so encoding a whole URL does not destroy the scheme and path.

Where it breaks down

The tool cannot infer which mode you meant; a value already encoded once will be encoded again, producing double escapes. Space is the other trap: %20 is correct in a path while + is the form convention, and guessing wrong silently changes the value. Text that was encoded with a legacy single-byte charset decodes to mojibake, because the page assumes UTF-8 throughout.

Privacy: no data leaves this tab

The string is transformed with built-in browser functions; the page makes no request and keeps no history, so a URL containing a token is not stored anywhere after you close the tab.

Frequently asked questions

Why does my encoded link 404?

Most likely the whole URL was encoded, so the scheme and slashes became percent sequences. Switch to the component mode, or encode only the value.

What is the difference between %20 and +?

+ means space only in form-encoded bodies; in a path it is a literal plus. Use %20 when in doubt.

Why do Chinese characters become three escapes?

UTF-8 encodes a CJK character in three bytes, and each byte becomes its own percent sequence. That is correct, not a bug.