Fog is a weather phenomenon with visibility below 1 km. Fog heavily influences ground and air traffic, leading to accidents and delays. The main goal of this study is to use two machine-learning (ML) techniques—the random forest (RF) and long short-term memory (LSTM) models—to estimate visibility using 11 meteorological parameters. Several meteorological elements related to fog are investigated, including pressure, temperature, wind speed, and direction. The seasonal cycle shows that fog in Sofia has a peak in winter, but a small secondary peak in spring was found in this study. Fog occurrence has a tendency to decrease during the studied period, with the peak of fog observations being shifted towards the higher visibility range. The input parameters in the models are day of year, hour, wind speed, wind direction, first-cloud-layer coverage, first-cloud-layer base height, temperature, dew point, dew-point deficit, pressure, and fog stability index (FSI). The FSI and dew-point deficit are evaluated as the most important input parameters by the RF model. Post-processing was performed with double linear regression for the correction of the predictions by the models, which led to a significant improvement in performance. Both models were found to describe the complexity of fog well.