Encode Query String Parameters

Percent-encode query parameter values before building a URL. Avoid broken requests caused by spaces, ampersands and Unicode.

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

Encode Query String Parameters

Build query strings by encoding each value, then concatenating key=value pairs. Encoding the whole string at once will also encode the & and = that hold it together.

Worked example: A search query value

Raw value

q=css grid & flexbox

Safe query pair

q=css%20grid%20%26%20flexbox

Practical tip

In JavaScript, URLSearchParams encodes values for you. In other languages, use the equivalent of encodeURIComponent on each value.

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.

Encode Query String Parameters FAQs

Should I encode the parameter name too?

Yes if the name can contain reserved characters. Most names are plain tokens and do not need it.

How do I encode an array of values?

Repeat the key (colors=red&colors=blue) or use a convention such as colors[]=red. Encode each value either way.