Skip to main content
~/makemydev/url-encoder

$url-encoder

Encoders

Encode or decode URL strings. Compare encodeURIComponent vs encodeURI output side by side. Everything runs in your browser.

Mode:

Encodes all special characters. Use for query parameter values.

Output will appear here

Preserves :, /, ?, #, &, =. Use for full URLs.

Output will appear here

When to use which?

encodeURIComponent
Encodes everything except A-Z a-z 0-9 - _ . ! ~ * ' ( ). Use this when encoding a value inside a query string, path segment, or fragment.
encodeURI
Leaves structural characters intact: : / ? # [ ] @ ! $ & ' ( ) * + , ; =. Use this when encoding an entire URL that may contain non-ASCII characters but already has valid structure.

// how-to

How to URL encode and decode

Percent-encode URL components for safe use in query strings, or decode URLs that contain %XX sequences.

  1. Choose the variant

    encodeURIComponent escapes everything that is not alphanumeric — pick it for query-string values. encodeURI keeps reserved characters like / and ? for full URLs.

  2. Paste the text

    Type or paste the raw string you want to encode or the encoded string you want to decode.

  3. Toggle encode or decode

    Flip between directions. The tool converts instantly without sending data anywhere.

  4. Copy the result

    Use Copy to push the result to your clipboard and paste it into your URL, form, or code.

// faq

? When should I use encodeURIComponent vs encodeURI?
Use encodeURIComponent for query-string values and path segments. Use encodeURI only for an entire URL where you want to preserve the structure characters.
? Does it decode + as space?
URL components technically encode spaces as %20, but application/x-www-form-urlencoded encodes them as +. The decoder handles both.
? Is encoding the same as escaping for HTML?
No. HTML escaping (&, <) is different from URL encoding (%26, %3C). Use the HTML Entity Encoder for markup.