CQL: The Chess Query Language (version 5.2)

Chess Query Language (CQL) searches for user-defined patterns and themes in chess games and studies.

This website discusses the latest version, 5.2. For version 5.1 documentation and downloads, go here.

CQL is designed to be compact and efficient.

In CQL, you can search for basic things like certain pieces being on certain ranges of squares; players with particular names or Elo ratings; whether a side is in check or mate; the year, event, or site of a game; and so on.

But with CQL, you can find also find studies and games that express themes that cannot be found with other tools. Some of the things you can do with CQL are:

For more examples, click the examples tab on the sidebar.

CQL may be downloaded here. Any questions or comments about CQL should be directed to costeff at the domain gmail.com .

Two references for good introductions to previous versions of CQL are:

  1. The article by Tim Krabbé in his Open Chess Diary.
  2. Gady Costeff's article in EG #151.


CQL was developed by Gady Costeff and Lewis Stiller. It is copyright (c) 2003-2017 and is free. It uses SCID code by Shane Hudson to parse the PGN files.

The world of chess studies

Chess studies are a deep and interesting area of chess, one for which CQL is particularly well suited. For more information on chess studies, see ARVES.