In urban public transportation systems, the accuracy of bus arrival time prediction is crucial to reduce passenger waiting time, increase satisfaction, and ensure efficient transportation operations. However, traditional bus information systems (BISs) rely on neural network models, which have limited prediction accuracy, and some public transportation systems have non-fixed or irregular arrival times, making it difficult to directly apply traditional prediction models. Therefore, we used a Transformer Encoder model to effectively learn the long-term dependencies of time series data, and a multi-headed attentional mechanism to reduce the root mean square error (RMSE) and lower the mean absolute percentage error (MAPE) compared to other models to improve prediction performance. The model was trained on real bus-operation data collected from a public data portal covering the Gangnam-gu area of Seoul, Korea, and data preprocessing included missing value handling, normalization and one-hot encoding, and resampling techniques. A linear projection process, learnable location-encoding technique, and a fully connected layer were applied to the transformer-encoder model to capture the time series data more precisely. Therefore, we propose BAT-Transformer, a method that applies a linear projection process, learnable location-encoding technique, and a fully connected layer using bus data. It is expected to help optimize public transportation systems and show its applicability in various urban environments.