this paper presents a two-level stochastic microgrid planning tool. The proposed tool determines the optimal location and size of different technologies through a long-term plan as well as the optimal operation strategy for technologies through a short-term plan. The proposed planning tool considers distributed generation resources, energy storage systems, and lines as candidates for the expansion. One of the key characteristics of the introduced planning is its ability to tackle load and renewable energies uncertainties through stochastic planning. Both the long-term and short-term plans are mathematically expressed as mixed integer nonlinear programming problems and solved by using a strong Metaheuristic optimization algorithm. Simulation results demonstrate that the proposed two-level planning method reduces the planning cost compared to the conventional method (i.e., only long-term planning). As well, it is indicated that considering line as an option for the expansion reduces the planning cost and increases the flexibility of the planning.