The flanker task, also known as the Eriksen flanker task, was designed in the early 1970s by Eriksen and Eriksen. Like most of the paradigms in this library, it is popular and there are many variants of the original.

The basic effect is that when you need to respond to stimuli "flanked" by irrelevant stimuli, the irrelevant stimuli can still affect your response. There is a similarity between other paradigms in which this type of interference from an irrelevant stimulus or stimulus feature occurs (like the Stroop task or the Simon task).

About this implementation

The flanker task here is slightly different from the original flanker task from Eriksen and Eriksen (1974) for various practical reasons (this version is just a bit easier). For example, in the original study, the spacing between the letters was varied, and in addition to compatible an incompatible letters, there were neutral letters. Of course, you can extent the code to add those features of the original study.

In this task, you need to respond with the A or L key of your keyboard. This matches the original task’s left or right lever press (A and L are left and right on the keyboard, respectively).

Run the demo

In this example, you will see 5 letters appear above the fixation point, but you must only respond to the central letter (which is above the fixation point). The letters X and C need to be responded to with the A button of your keyboard. The letters V and B need to be responded to with the L button of your keyboard. If there is a mismatch between the flanking letters their response and the response required by the central letter, we speak of a "incongruent" or "incompatible" condition.

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


stimulus text


1 = congruent ; 0 = incongruent


status (1=correct, 2=error, 3=too slow)


the response time (ms)


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

  • Eriksen, B. A. & Eriksen, C. W. (1974). Effects of noise letters upon identification of a target letter in a non-search task. Perception and Psychophysics, 16, 143-149.