Background. Nowadays, matrix barcodes in general and QR codes in particular are widely used in multiple applications, when it is important to input data into a computer system in a fast and secure way (both error-free and protected from third parties). Their popularity was significantly increased since the era of smartphones had begun, and so consequently, new use cases and new problems have arisen. Specifically, one of the important issues is representing more information as a barcode symbol. Objective. The objective of the research is to develop a data barcoding method based on grayscale tricolor 2D barcode which enables representing more amounts of information with preservation of the area of a graphical symbol. Methods. The research is based on both the coding theory and the multicolor barcode concept, which allow to increase amounts of data that can be encoded and represented by one matrix barcode symbol. The proposed BGW barcoding method uses a combination of data transformations between several notation systems with the purpose of data compression.Results. The method of data encoding based on tricolor matrix barcodes is proposed and described. This method allows to compress input alphanumeric data and transform it into a 2D barcode symbol composed of BGW (black, gray, white) barcode patterns. Two use cases for the proposed method application are considered in the paper. The first use case concerns enhanced information input. The second one addresses the data protection issue. Conclusions. The proposed BGW barcoding method enables compact representation of a textual data. One of the benefits of the proposed method lies in a possibility to not only encode data but to compress it. Due to data compression, more information can be represented keeping the same dimensions of the graphically coded symbol. Depending on the parameters, especially barcode symbol digital capacity, compression can be up to 20-25%.