⌕
Developer · free online tool

URL Encode.

Safely encode a URL component.

Your workspace◈ Processed on your device
Your result
Your result will appear here.

A little context.

Uses encodeURIComponent for a single query parameter value or path component. Do not use this to encode a whole URL that should retain its separators.

Preparing one query parameter value

Encode the value of a parameter such as a search term before joining it to a URL. An ampersand inside the term must become %26 so it is not confused with the separator between parameters.

Interpreting the result and avoiding mistakes

Do not encode an entire finished URL with this tool: that would also encode its structural colon, slashes and question mark. Encoding an already encoded component can turn % into %25. Track whether your input has already been encoded.

A reproducible workspace example

These are the starting values in the form above. The result below is calculated from these values when the page is built, using the same processing engine as the tool.

Text
hello world & friends

Calculated output

hello%20world%20%26%20friends

Quick reference

hello world → hello%20world

How to use this tool

  1. Enter text in the workspace above.
  2. Select Run tool to process your input. Invalid values produce a message next to the form.
  3. Copy the result or download it as a file. Reset example restores the original input.

Keep a good thing going.

A few related tools for your next step.