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.Use this in a chain
Result

How to use

  1. 1
    Pick a direction

    Encode plain text → percent-encoded, or decode percent-encoded text back.

  2. 2
    Pick a mode

    encodeURI for whole URLs. encodeURIComponent for query values, path segments, or form fields.

  3. 3
    Paste and read the result

    Live update. Copy the result or share the URL.

Examples

encodeURIComponent — query value
Input
hello world & friends
Output
hello%20world%20%26%20friends
Spaces become %20, ampersands become %26. Safe to drop into ?q=…
encodeURI — whole URL
Input
https://example.com/search?q=café latte
Output
https://example.com/search?q=caf%C3%A9%20latte
Preserves : / ? & = so the URL structure survives. Only escapes the unsafe bits.
Decode a percent-encoded blob
Input
user%40example.com%3F%22quoted%22
Output
user@example.com?"quoted"
%40 = @, %3F = ?, %22 = ". Roundtrip-clean.

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