CQL: The Chess Query Language (version 6.0)

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

This website discusses the latest version of CQL: 6.0 (beta). For version 5.2 documentation and downloads, go to CQL 5.2 documentation

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:

  • Find queen staircase maneuvers, in which the queen moves in a staircase-like pattern. Sort the results by the length of the staircase.
  • Find zugzwang studies where the common move sequence between the try and the solution is at least 15 moves. Sort these studies by the length of the common move sequence.
  • Find problem themes like Turtons, Bristols, delayed clearance, or Wurzburg-Plachuttas.
  • Combine ideas in any way you want. You can search for themes shifted horizontally, vertically or in any direction. You can combine themes with logical operators like and, or, and not; with sequencing operators like line; and with various types of counting operators like find.
  • Generate statistics for single games or entire sets of games. For example, CQL can sum up the total number of moves all games; or the number of moves made by each piece types.
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. Tim Krabbé's article 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-2019 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.