The usage of brain-computer interface increases more and more over the years. It is used to control external devices, wheelchairs, robots, even for gaming. One of the applications of the EEG based BCI is for spelling device, in the first place in-tended for people disabled by amyotrophic lateral sclerosis. The aim of this research was to create the P300-based BCI system for spelling in Matlab environment. For the practical part of the research, the dataset of EEG signals of 5 subjects each spelling 5-character word was used. For classifying the flashes in target and non-target groups, proposed system uses features of P300 response, its physical appearance and the time interval needed for its appearance. In the contribution we have presented several modifications of the basic algorithm and compare them with each other, and to the reference method.