ToolVaults

URL Encoder & Decoder

Percent-encode or decode URLs, query strings, and path segments. Choose between encodeURI and encodeURIComponent. Runs in your browser.

Runs 100% in your browser — nothing is uploaded.

Result

Frequently asked

What is the difference between encodeURI and encodeURIComponent?

encodeURI leaves URL syntax characters (: / ? # & = +) alone, so it is used to encode a whole URL. encodeURIComponent percent-encodes those too, so it is safe for query values, path segments, and form fields.

Which one should I use?

Use encodeURIComponent for anything you paste into a URL query, form field, or path segment. Use encodeURI only when you have an entire URL and just want to escape spaces or unicode.

Why did my decode fail with "Malformed URI sequence"?

The input contains a "%" not followed by two hex characters, which the JavaScript decoder cannot handle. Look for standalone % signs in your input.

Related tools