encodeURIComponent Online

Run encodeURIComponent in the browser. Encode query values, JSON snippets and reserved characters exactly as JavaScript does.

Part of the free URL Encoder. Runs in your browser — nothing is uploaded.

encodeURIComponent Online

encodeURIComponent encodes every character except A–Z a–z 0–9 and - _ . ! ~ * ' ( ). That is the right function for a single query parameter or path segment.

Worked example: Reserved characters

Text

name=Ada & city=Pune?

Encoded

name%3DAda%20%26%20city%3DPune%3F

Practical tip

Do not encode a parameter you have already encoded. Double-encoding turns %20 into %2520 and breaks the receiver.

How to use this URL Encoder

  1. 1Use the live tool above — it runs entirely in your browser and never uploads your data.
  2. 2Paste the sample from the worked example, or use your own input.
  3. 3Copy the result, then adapt the same steps in your editor, script, or pipeline.

encodeURIComponent Online FAQs

When should I use encodeURI instead?

Use encodeURI on a complete URL when you only want to escape spaces and unsafe characters, not :, /, ?, # or &.

Does encodeURIComponent encode slashes?

Yes. / becomes %2F, so it is safe inside a query value but wrong for a full path.