A query string is a part of a URL that contains data to be sent to a web server as part of an HTTP request. It typically follows the question mark (?) in the URL and consists of key-value pairs separated by ampersands (&). Each key represents a parameter, and the corresponding value provides data for that parameter. For example, in the URL https://example.com/search?q=python&lang=en, q=python and lang=en are query parameters, with q being the search term and lang specifying the language. Query strings are commonly used for passing user input, filtering results, or tracking sessions.