Accurately predicting medical charges is crucial for healthcare providers, insurance companies, and policymakers to manage costs and allocate resources efficiently. This study conducts a comparative analysis of five machine learning algorithms—Linear Regression, Decision Tree Regressor, Random Forest Regressor, XGBoost Regressor, and Gradient Boosting Regressor—to evaluate their performance in predicting medical insurance charges. Utilizing a dataset of patient demographics, health indicators, and lifestyle factors, we identify the key variables that most significantly influence medical expenses. Our findings reveal that certain algorithms outperform others in predictive accuracy, with XGBoost Regressor showing the highest accuracy (R² = 0.94). Additionally, the study highlights the most critical factors contributing to medical charges, are Smoking status, BMI, and Age. The analysis of feature importance across different models provides valuable insights into the underlying drivers of healthcare costs. This research contributes to the growing body of literature on healthcare analytics by offering a dual focus on predictive modeling and variable importance. The results underscore the potential of machine learning to enhance decision-making in the healthcare industry, particularly in optimizing resource allocation and cost management.