While the estimate of hospital costs concerns the past, its planning focus on the future. However, many public hospitals in low and middle-income countries don’t have robust accounting health systems to evaluate and project their expenses. In Brazil, public hospitals are funded based on government estimates of available hospital infrastructure, historical expenditures and population needs. However, these pieces of information are not always readily available for all hospitals. To solve this challenge, we propose a flexible simulation-based optimisation algorithm that integrates this dual task: estimating and planning hospital costs. The method was applied to a network of 17 public hospitals in Brazil to produce the estimates. Setting the model parameters for population needs and future hospital infrastructure can be used as a cost-projection tool for divestment, maintenance, or investment. Results show that the method can aid health managers in hospitals’ global budgeting and policymakers in improving fairness in hospitals’ financing.