ChessPuzzlePrint Free chess puzzles, tools and printables

Random Chess Opening Generator

One click picks a named opening line at random; filters keep it to the openings you want to practise.

What the random chess opening generator does

The random chess opening generator draws one line at random from a catalogue of 3,800 named opening lines and shows its name, its ECO code, the moves and the position they lead to.

Each pick is a real line from chess theory. You can use it to learn opening names or to set up a starting position for a practice game. Filters let you narrow the choice by ECO group, first move, maximum length and main lines only. Every pick comes with a link that shows the same opening to anyone who opens it.

The generator suits beginners who want to see how openings are named, and players who want a fresh position to practise from each time.

Random chess opening generator example

How to use the random chess opening generator

  1. Leave the filters as they are to choose from every named line, or untick any ECO groups (A to E) you do not want.
  2. Choose a first move, such as 1. e4, 1. d4, 1. c4, 1. Nf3, or anything else.
  3. Set a maximum length in moves.
  4. Tick "Main lines only" if you want just the main opening name, such as "Sicilian Defense" or "Ruy Lopez", without named variations.
  5. Press "Another opening" for a new pick. The status line shows how many lines matched your filters.
  6. Click any move to see the board at that point, or step through the line with the arrow buttons.
  7. Press "Explore this line in the opening finder" to open the opening finder with the moves already entered, where the named next moves and longer lines are listed.
  8. Copy the link to share the pick.

The five ECO groups are A (flank openings), B (semi-open games other than the French), C (open games and the French), D (closed and semi-closed games) and E (Indian defences). Untick a group to leave its openings out of the pick.

The link stores the seed and your filter settings together. Anyone who opens it sees the same line with the same filters. Changing the filters after that gives a different pick from the same seed.

What is random chess?

In this tool, random chess means the opening is chosen by chance rather than by a player. The generator picks one named line from a fixed catalogue, and every line that matches your filters has the same chance of being drawn.

The chess itself is played the normal way. Randomness only decides which opening you study or start from. Each line is a real sequence of moves, so the final position is one that chess players have named and analysed.

How do I pick a random opening to practise?

If you are new to chess, start with a short line of three or four moves. You can then remember its name and its main idea without too many moves to hold in your head. Longer lines show a whole variation and suit players who already know the basics.

Play the moves out on a real board rather than only reading them. Moving the pieces helps you remember the ideas behind the names. For a training game, continue from the final position against a friend or the computer, and keep playing good moves rather than repeating the line.

What is the seed number?

Every pick has a seed number, and the link carries it. Each press of "Another opening" makes a new seed, and the seed chooses one line from the lines that match your filters, each with the same chance. The same link always reproduces the same pick, so you can send a line to someone and they will see exactly what you saw.

Can I limit it to openings for White or Black?

Not directly. The filters have no colour setting. The first move filter fixes White's opening move, which sets the kind of game you will see.

Black's side is shaped by the ECO group. Group B covers 1. e4 openings in which Black answers with a move other than 1... e5 or 1... e6, such as the Sicilian and the Caro-Kann. Group E covers the Indian defences after 1. d4 Nf6 2. c4, such as the Nimzo-Indian and the King's Indian. To study Black's side, choose a line from these groups and play it from Black's point of view on a real board.

Examples

♜8♞♝♛♚♝♜♟7♟♟♟♟♟♟6♞54♟♟3♞♞♟2♟♟♟♟♟♜1ab♝c♛d♚e♝fg♜h
All openings, seed 2024: D24 Queen's Gambit Accepted: Showalter Variation — 1. d4 d5 2. c4 dxc4 3. Nf3 Nf6 4. Nc3 (one of 3,815 matching lines).
♜8♞♝♛♚♝♞♜♟7♟♟♟♟♟♟6♟54♟3♟2♟♟♟♟♟♟♜1a♞b♝c♛d♚e♝f♞g♜h
C group (open games and the French Defence), 1. e4, up to 4 moves, main lines only, seed 7: C00 French Defense — 1. e4 e6 (one of 40 matching lines).
♜8♞♝♛♚♝♜♟7♟♟♟♟♟6♞♟54♟♟3♟♞♟2♟♟♟♟♜1a♞b♝c♛d♚e♝fg♜h
D group, 1. d4, up to 6 moves, seed 42: D25 Queen's Gambit Accepted: Smyslov Variation — 1. d4 d5 2. c4 dxc4 3. Nf3 Nf6 4. e3 g6 (one of 382 matching lines).

Questions and answers

What does an ECO code mean?

ECO stands for Encyclopaedia of Chess Openings. The letter from A to E shows the group, and each group comes from one of the five volumes of that work. The code is a short label for an opening family.

Why does the same seed give a different line with different filters?

The seed chooses one line from the filtered list, so changing the filters changes the list the seed picks from. The link stores both the seed and your filters, so reopening it gives the same pick with the same settings.

Why does a filter combination show no lines?

Some combinations are empty or very small. For example, 1. e4 with only the E group finds nothing, because every E line starts with 1. d4, 1. c4 or 1. Nf3. Allow more ECO groups or a longer maximum length to find lines.

What does "up to 4 moves" count?

A move count is a full move, which is one move for White and one for Black. "Up to 4 moves" allows lines such as 1. e4 e5 2. Ba4, which has seven half-moves.

How many lines are in the pick when "Main lines only" is on?

With this filter on, the pick is made from 228 lines. Each of them has the same chance of being chosen by the seed.

Open-source components used by this tool: chess.js (BSD-2-Clause); chess-openings catalogue (CC0-1.0).

Updated