When drilling deep wells, it is important to regulate the formation pressure and prevent kicks. This is achieved by controlling the equivalent circulation density (ECD), which becomes crucial in high-pressure and high-temperature wells. ECD is particularly important in formations where the pore pressure and fracture pressure are close to each other (narrow windows). However, the current methods for measuring ECD using downhole sensors can be expensive and limited by operational constraints such as high pressure and temperature. Therefore, to overcome this challenge, two novel models named ECDeffc.m and MWeffc.m were developed to predict ECD and mud weight (MW) from surface-drilling parameters, including standpipe pressure, rate of penetration, drill string rotation, and mud properties. In addition, by utilizing an artificial neural network (ANN) and a support vector machine (SVM), ECD was estimated with a correlation coefficient of 0.9947 and an average absolute percentage error of 0.23%. Meanwhile, a decision tree (DT) was employed to estimate MW with a correlation coefficient of 0.9353 and an average absolute percentage error of 1.66%. The two novel models were compared with artificial intelligence (AI) techniques to evaluate the developed models. The results proved that the two novel models were more accurate with the value obtained from pressure-while-drilling (PWD) tools. These models can be utilized during well design and while drilling operations are in progress to evaluate and monitor the appropriate mud weight and equivalent circulation density to save time and money, by eliminating the need for expensive downhole equipment and commercial software.