ABSTRACT Achieving optimal energy planning in Microgrids (MGs) is pivotal for addressing complex challenges associated with cost-effective and reliable energy supplies. This paper proposes a novel hybrid metaheuristic algorithm for optimal energy planning in microgrids using an Improved Salp Swarm Algorithm with Harris Hawk Foraging (ISSAHF). This technique is based on an improved multi-leader Salp Swarm Algorithm with an elite leader following strategy combined with Harris Hawks foraging. A simulation study is conducted on a low-voltage microgrid in off-grid and grid-connected modes. The optimization algorithm resulted in a daily average cost of 28.3370€ in off-grid mode compared to 19.2676€ in grid-connected one. Furthermore, the statistical study shows that the proposed algorithm outperforms well-established metaheuristic techniques regarding search capability and robustness. It yields mean optimal cost of 623.5248€ in off-grid and 404.7475€ for the grid-connected one, compared to other optimization techniques that vary from 667.2141€ to 959.5747€ in off-grid mode, and from 424.5841€ to 813.932€ in grid-connected mode. For robustness, the proposed technique performs well with a standard deviation of 20.765€ compared to the best (17.024€) and the worst (47.2423€) cases in off-grid mode, while in grid-connected mode, it is 28.8771€ compared to the best (21.6316€) and the worst (45.3774€) values.