Machine learning approaches in diagnosis and prognosis of multiple sclerosis (MS) were analysed using retinal nerve fiber layer (RNFL) thickness, measured by optical coherence tomography (OCT). A cross-sectional study (72 MS patients and 30 healthy controls) was used for diagnosis. These 72 MS patients were involved in a 10-year longitudinal follow-up study for prognostic purposes. Structural measurements of RNFL thickness were performed using different Spectralis OCT protocols: fast macular thickness protocol to measure macular RNFL, and fast RNFL thickness protocol and fast RNFL-N thickness protocol to measure peripapillary RNFL. Binary classifiers such as multiple linear regression (MLR), support vector machines (SVM), decision tree (DT), k-nearest neighbours (k-NN), Naïve Bayes (NB), ensemble classifier (EC) and long short-term memory (LSTM) recurrent neural network were tested. For MS diagnosis, the best acquisition protocol was fast macular thickness protocol using k-NN (accuracy: 95.8%; sensitivity: 94.4%; specificity: 97.2%; precision: 97.1%; AUC: 0.958). For MS prognosis, our model with a 3-year follow up to predict disability progression 8 years later was the best predictive model. DT performed best for fast macular thickness protocol (accuracy: 91.3%; sensitivity: 90.0%; specificity: 92.5%; precision: 92.3%; AUC: 0.913) and SVM for fast RNFL-N thickness protocol (accuracy: 91.3%; sensitivity: 87.5%; specificity: 95.0%; precision: 94.6%; AUC: 0.913). This work concludes that measurements of RNFL thickness obtained with Spectralis OCT have a good ability to diagnose MS and to predict disability progression in MS patients. This machine learning approach would help clinicians to have valuable information.