Real-time forecasting of anomalies in the Ionosphere TEC is attempted using machine learning models such as Autoregressive Integrated Moving Average (ARIMA) and Long Short-Term Memory (LSTM). The Performances of both models were demonstrated on three Earthquakes (EQs), i.e. Mw 6.8, 2020 Indonesia, Mw 8.0, 2019 Peru and Mw 7.8, 2015 Nepal EQs. In this study, GNSS-derived TEC values from the CODE server have been utilized and the statistical boundary limits have been defined with 95% confidence level for anomaly detection in daily TEC variations. The training and test TEC dataset was divided into 8:2 ratio. After the data processing the hyper model parameters were optimized for the training dataset following which the TEC anomalies were validated by comparing the forecasted and actual TEC values on the test dataset. For ARIMA analysis, we start with the ADF test to check for stationarity of TEC data and after observing the test-statistics critical values and p-value we reject the null hypothesis. On calculating the ACF and PACF plots we select model parameters values in accordance with the lowest AIC value. While, for the LSTM model, we start with standardizing the training data to have zero mean and unit variance. The model is fit using the ‘Adam’ version of stochastic gradient descent, optimized using the ‘mse’ loss-function and run through 250 epochs using the rectified linear activation-function (ReLU) for better performance. Both the models were successfully able to detect and predict significant evidence for pre-seismic ionospheric TEC anomalies on 01 May 2020, 20 May 2019 and 11 April 2015 respectively before the occurrences of Indonesia, Peru and Nepal EQs. The time series analysis of forecasted TEC data revealed that the RMSE and MAPE error on the anomalous day was found to be significantly higher than the preceding non-anomalous day error and the overall forecasted error. Both ARIMA and LSTM models performed well for Indonesia and Peru EQs, forecasting TEC anomalies accurately within the 5-6 day window before the EQ, but the LSTM model outshined the former in long term TEC forecasting for the Nepal EQ performing well in the 11 day window before the EQ. Overall, the LSTM model was found to be more precise especially in long term forecasting and was also able to detect the weaker TEC anomalies which went unnoticed in the ARIMA model.