Skip to content

URL Encoder

URL-encode any string so it can live safely in a URL. Spaces, Arabic letters, emoji and reserved characters are converted to percent-encoded form that browsers and APIs accept.

What this means

URLs allow only a small set of characters. Encoding replaces everything else with %XX sequences, so a space becomes %20 and an Arabic letter becomes its UTF-8 bytes.

How we calculate it

Formula

encodeURIComponent(text): every character outside A–Z a–z 0–9 - _ . ! ~ * ' ( ) becomes %XX.

Worked example

Encode 'hello world':

  1. 1Type the text.
  2. 2The encoded string updates live.
  3. 3Paste it into your URL.

Important assumptions

  • Encoding is applied to the whole input, suitable for a query value.

Frequently asked questions

encodeURI vs encodeURIComponent?

encodeURI leaves reserved URL characters intact, while encodeURIComponent encodes almost everything — use it for query values.

Does it support Arabic and emoji?

Yes. Both are encoded to their UTF-8 percent-encoded form automatically.

Related tools