Card sorting tests have a long tradition in psychology, going back more than a 100 years to the work of Ach. In 1948, Grant and Berg published their now very famous Wisconsin Card Sorting Test. It is a test of cognitive reasoning. Later, in the 1960s, Milner started to use this cognitive test to assess patient’s level of brain damage to the prefrontal cortex.

In short, in this task, people have to classify cards according to different criteria. People have four different ways to classify a card, and the only feedback is whether they do it correctly or not. One can classify cards according to the color of its symbols, the shape of the symbols, or the number of the shapes on each card. The classification rule changes every 10 cards, and this implies that once the participant has figured out the rule, the participant will start making one or more mistakes when the rule changes. The task measures how well people can adapt to the changing rules.

About this implementation

In the example, there are four cards on screen. Your task is to figure out the classification rule to sort the card (a grey rectangle) at the bottom left. You just click the card that matches the rule, and you will get feedback about your choice. At the end you see the count and percentage of your errors (the PsyToolkit feedback function is being used).

There are different types of error reports:

  1. Total number errors

  2. Perseveration errors (when you keep applying the old rule)

  3. Non-perseveration errors


  • The sum of perseveration and non-perseveration erros is the total number of error.

  • Everybody will by definition make some mistakes, because you need some feedback to figure out the rule. The point of the WCST is that certain patients make unually many persevertion errors

  • In the first block, there are by definition no perseveration errors (because there is no "previous task")

Run the demo

Use the mouse to click the matching "card" (detailed instruction is on screen).

Data output file

In PsyToolkit, the data output file is simply a textfile. The save line of the PsyToolkit experiment script determines what is being saved in the data output file. Typically, for each experimental trial, you would have exactly one line in your text file, and each number/word on that line gives you the information you need for your data analysis, such as the condition, response speed, and whether an error was made.

Meaning of the columns in the output datafile. You need this information for your data analysis.

Colum Meaning Values


the card shown

a number between 1 and 64 (you do not really need this for further data analysis, because the info is also below in the detailed card description)


the card that should be clicked of the top four on screen

a number between 1 and 4


the card that would be clicked if the participant is persevering

a number between 1 and 4


the trial in a sequence

number between 1 and 10. 1 is the first, thus the rule switch


name of the task

shape, number, color


detailed card description: shape

circle, start, cross,triangle


detailed card description: number of symbols on the card



detailed card description: color



Reaction time in milliseconds

between 1 and 10,000, that is max response is 10 seconds



1=correct, 2=wrong card, 3=too slow


the card that was actually clicked

a number between 1 and 4, or 0 if none clicked


If 1, this trial was an error (otherwise 0)

0 or 1


If 1, this trial was a perseveration error (otherwise 0)

0 or 1


If 1, this trial was not a perseveration error (otherwise 0)

0 or 1


If you have a PsyToolkit account, you can upload the zipfile directly to your PsyToolkit account. Watch a video on how to do that. If you want to upload the zipfile into your PsyToolkit account, make sure the file is not automatically uncompressed (some browsers, especially Mac Safari, by default uncompress zip files). Read here how to easily deal with this.

Further reading

  • Berg, E.A. (1948). Journal of Experimental Psychology, 38, 404-411. A simple objective technique for measuring flexibility in thinking. Journal of Experimental Psychology, 39, 15-22.

  • Grant, D. A., & Berg, E. (1948). A behavioral analysis of degree of reinforcement and ease of shifting to new responses in Weigl-type card-sorting problem. Journal of Experimental Psychology, 38, 404-411.

  • Milner, B. (1963). Effects of different brain lesions on card sorting: The role of the frontal lobes. Archives of Neurology, 9, 100-110.

  • Nyhus, E. & Barcelo, F. (2009). The Wisconsin Card Sorting Test and the cognitive asesment of prefrontal executive functions: A critical update. Brain and Cognition, 71, 437-451.