Skip to content
MixTool

URL encoder

Safely encode text for use in URLs — pick the right mode for query values, full URLs or form data.

  • Runs entirely in your browser
  • Free · no sign-up
  • Works on phone and desktop
Loading tool…

The right encoding for every part of a URL

Characters like spaces, &, ?, # and non-English letters have special meanings in URLs or aren't allowed at all, so they must be percent-encoded (a space becomes %20, ₹ becomes %E2%82%B9). Choosing the wrong mode is a classic bug, so the encoder offers three:

Query value / component (encodeURIComponent) encodes everything that could break a parameter — use it for search terms and values. Whole URL (encodeURI) keeps :/?#&= so the link still works. Form data uses + for spaces, matching how HTML forms submit. You can also encode each line separately to prepare lists of values.

How to URL-encode text

  1. 1

    Pick what you're encoding

    A value, a whole URL or form data.

  2. 2

    Paste the text

    Encoding happens as you type.

  3. 3

    Copy the result

    Or swap to decode it again.

Key features

  • Three encoding modes

    Component, full URL and form data.

  • UTF-8 correct

    Matches what browsers send.

  • Line-by-line option

    Encode many values at once.

  • Private

    Runs in your browser.

Common uses

  • Building API requests: Encode search terms and filter values.
  • Tracking links: Encode UTM values and redirect URLs.
  • Sharing links: Make URLs with spaces or special characters work everywhere.

Tips and good to know

  • Encoding a URL that goes inside another URL (like a redirect parameter)? Use the component mode on the inner URL.
  • To see a URL's parts and parameters clearly, use the URL Parser.

Frequently asked questions

What's the difference between encodeURI and encodeURIComponent?

encodeURI keeps characters that structure a URL (: / ? # & =), so it's for complete URLs. encodeURIComponent encodes those too, so it's for individual values inside a URL.

Should spaces be %20 or +?

%20 works everywhere in a URL. + means a space only in query strings and form data (application/x-www-form-urlencoded).

Why do some characters stay unencoded?

Letters, digits and - _ . ! ~ * ' ( ) are always safe in URLs, so they're left as they are.