What is URL Query String ? Example and Explanation

Query string is string included in the url after a question mark (?)

A Query String is the string passed to the url in the form of parameters, it can contain one or more parameters, each parameter is separated using the ampersand (&)

Below is a real world use-case of query string and parameters.

Query String Example
Query String Example

Explanation – Lets look at the Query string breakdown

In the above example, we search for a keyword “mrvirk” in Google search, and the page passes 3 parameters back to the Google server that helps G Search to provide you results for the keyword

  • Parameter 1 (client=firefox-b-d): tells google what browser user is on, in my case its Firefox
  • Parameter 2 (channel=trow): tells google the channel
  • Parameter 3 (q=mrvirk): tells google what the user searched for, in this case mrvirk

Video Tutorial

You can play around and learn more about making use of Query String and Parameters in real world project in the article below –

Navjot Singh Virk
Navjot Singh Virk

Navjot is a Hobby Blogger from Ireland and loves to create content to help people. He makes time on weekends to work on this blog. And has a full time position at Workday as Technical Product Manager, which he loves and thrives at.

His Skills include in-depth knowledge of SEO, Javascript, Advertising, HTML, Java and Product Management. And his other hobbies include Investing, Gardening and playing Table Tennis.

Articles: 52