Stand-alone photovoltaic systems (SAPV) are often used in remote areas where access to grid electricity is limited. This system depends on solar energy. However, Photovoltaic (PV) systems need a greater initial investment than conventional sources of energy, and their effectiveness is reliant on a number of environmental conditions such as the unpredictable solar radiation. One step in reducing the investment cost of a PV system is determining the optimal size of solar PV components that minimize costs. This paper presents a Particle Swarm based optimization tool for sizing Stand-alone PV systems. The optimization tool selects the optimal Levelized Cost of Energy (LCOE) of the PV system during its entire lifespan while maintaining its reliability. The Particle Swarm Algorithm was implemented in order to solve the optimization problem. The Loss of Power Supply Probability (LSPS) is considered as the reliability index for this optimization. A design example in Serengeti, Tanzania is used to validate the proposed method. With an average daily load consumption of 94.3kWh, an optimal size of 30kW of Solar PV, 82kWh of Li-ion battery and 13kW of inverter was obtained at a LCOE of 0.22114 $/kWh. The Power simulation for this system was also carried out based on the mathematical models. The proposed method is investigated by simulation with several meteorological data, and the effectiveness is validated by using a similar tool which utilizes the mixed integer linear programming method.