A Transformer model to predict the remaining useful life of a fuel cell, which has demonstrated superior performance in analyzing time series data. The dataset was created from long-term performance evaluation experiments conducted in rated power mode, with measurements taken every 10 hours. We preprocessed the raw data using a moving average, allocating 70% for training and 30% for evaluation. The model's performance, evaluated through MAE, MSE, and MAPE, was excellent. The fuel cell's critical voltage, defined as 94.5% of its initial voltage, was measured at 0.719 V. During the experimental run, the actual critical time was 106.6 hours, while the model predicted 106.8 hours, resulting in a 0.19% error. Since the predictions were based on data collected up to 93 hours, the estimated remaining life was 13.8 hours.