You need one page to hand something to another page: the words a visitor searched for, the page of results they were on, a code that says where they came from. You could build a form, a cookie or a whole backend exchange, but often the simplest carrier is already sitting in the address bar. The query string is the part of a URL built for exactly this job, and a link that carries its own data works anywhere a link works: in an email, on a button, in a bookmark.

This guide explains what passing data with a query string actually means, and how to do it cleanly with the free Query String Builder on Ovatly. The tool assembles URLs with parameters from a table of names and values, so you build the string row by row instead of typing punctuation by hand and hoping you got it right.

Contents

  • Quick answer
  • What passing data means here
  • Why every value needs a name
  • Why encoding is not optional decoration
  • How to pass data with a query string, step by step
  • Worked example: handing a search to the results page
  • Limitations and honest tradeoffs
  • Common mistakes
  • FAQs
  • Conclusion

Quick answer

To pass data between pages with a query string: decide the named values the receiving page needs, then build them onto the base URL one row per value, name on the left and value on the right. On Ovatly, open the Query String Builder, enter the base URL, add a row for each value, leave encoding on so spaces and symbols travel safely, and copy the finished URL. The receiving page reads each value by its name. Keep this method for public state like search terms and page numbers, never for secrets, because the whole string is visible in the address bar and in logs.

What passing data means here

Passing data in this model is a specific, modest thing. Named values ride on the URL itself. The cargo is the kind of data a query string normally carries: search terms, page numbers, tracking codes and similar data. Nothing is hidden, nothing is stored, and no conversation happens between the pages beyond the link itself. The sending page writes the values into the URL, and whoever opens that URL hands the values to the receiving page simply by arriving.

That modesty is the strength of the method. The data travels with the link, so it survives copying, pasting, bookmarking and sharing. If a visitor sends the link to a friend, the friend lands on the same search, on the same page of results, because the values needed to rebuild that view are sitting in the address.

Why every value needs a name

A query string is not a bag of loose values. It holds name=value pairs joined by ampersands, and the receiving page reads each value by looking up its name. That is why the builder works as a table: one row per parameter, the name on the left and the value on the right. A value without a name cannot be represented, because there would be no label for the other end to look up.

The name-based design has a practical consequence worth knowing: row order does not matter for almost all websites. Parameters are read by name, not by position, so you can add rows in the order you think of them, and reorder them for your own readability, without changing what the receiving page gets. Name each value clearly and consistently, and the string stays understandable to anyone who reads the URL later.

Why encoding is not optional decoration

Real values contain spaces and symbols. A search term like red shoes has a space in it, and a raw space does not belong in a URL. With encoding on, spaces become + and characters like & and # are escaped, which is the standard behavior every website expects. The value then arrives as one piece.

This matters most for the ampersand. Ampersands are the separators between pairs, so an unescaped & inside a value would be read as the start of a new pair, and the value would arrive cut in half with a phantom parameter after it. The # character starts the fragment part of a URL, so an unescaped one truncates everything after it. Leaving encoding on is the discipline that keeps one value as one value, and the builder applies it as the default for that reason.

How to pass data with a query string, step by step

  1. Open the Query String Builder and enter the base URL, the address of the page that will receive the data. Parameters the base URL already has are kept, and new rows are appended after them.
  2. Add one row per parameter: the name on the left, the value on the right. One value per row, each with its own name.
  3. Leave encoding on. Spaces become +, and characters like & and # are escaped, so each value travels as a single piece.
  4. Copy the finished URL and use it as the link. Open it once yourself and check that the receiving page shows the state you intended.

Worked example: handing a search to the results page

Suppose a search page needs to receive two values: the term the visitor typed and the page of results to show. The base URL is https://example.com/search. Add two rows: q = red shoes and page = 2. With encoding on, the space in the term becomes +, and the builder produces https://example.com/search?q=red+shoes&page=2.

Read that URL as data being passed. The search page receives q and knows the term is red shoes. It receives page and knows to show the second page of results. Neither value needed a form submission or a stored session: the link itself carried both, and because the values are read by name, the rows could have been added in either order with the same result.

Limitations and honest tradeoffs

Everything in a query string is visible in the address bar and in logs. Anyone who sees the link sees the values, and servers record URLs as a matter of routine. That visibility is fine for public state: a search term, a page number, a tracking code. It is never acceptable for secrets. Do not put passwords, private tokens or personal details in a query string, because the URL will be copied, bookmarked, shared and logged in places you do not control.

The method also carries only what fits this simple shape: short named values. It is not a channel for files, long documents or structured records. And the receiving page has to be built to read the names you send; a query string delivers values to a page that looks for them, and a page that ignores parameters will simply ignore yours.

Common mistakes

  • Trying to pass a value without a name. The model is name=value pairs. A nameless row cannot be represented, because the receiving page reads by name.
  • Turning encoding off. A value with a space, an & or a # then breaks apart or truncates the string. Leave encoding on.
  • Putting a secret in the string. Query strings are visible in the address bar and in logs. Public state only, never secrets.
  • Retyping parameters the base already has. Existing parameters are kept and new rows are appended after them, so retyping risks duplicates.
  • Assuming order carries meaning. Almost all websites read parameters by name, so meaning lives in the names. Name values clearly instead of relying on position.

FAQs

What is a query string? A query string is the part of a URL after the question mark. It holds name=value pairs joined by ampersands, carrying search terms, page numbers, tracking codes and similar data.

Does the order of the rows matter? Row order does not matter for almost all websites. Parameters are read by name, so the receiving page finds each value by looking up its name, not by its position.

What happens to parameters already in the base URL? Parameters the base URL already has are kept, and the new rows are appended after them. You do not need to retype the existing parameters to preserve them.

Why should encoding stay on? With encoding on, spaces become + and characters like & and # are escaped, which is the standard behavior. A value then arrives as one piece instead of breaking the URL apart.

Can I pass a password or a secret in a query string? No. Everything in a query string is visible in the address bar and in logs, so it suits public state like a search term or a page number, never secrets.

Conclusion

Passing data with a query string is a small, honest mechanism: named values ride on the URL, assembled as rows on a base, and read by name at the other end. The Query String Builder enforces the two habits that keep it reliable, one named row per value and encoding left on. For the other half of working with URL lists, our guide on sorting a long list of URLs alphabetically shows how to clean and order the links you collect. For more guides in this series, see our URL and Link Tools guides.