Resource optimization is a major factor in the assessment of the effectiveness of renewable energy systems. Various methods have been utilized by different researchers in planning and sizing the grid-connected PV systems. This paper analyzes the optimal photovoltaic (PV) array and inverter sizes for a grid-connected PV system. Unmet load, excess electricity, fraction of renewable electricity, net present cost (NPC) and carbon dioxide (CO2) emissions percentage are considered in order to obtain optimal sizing of the grid-connected PV system. An optimum result, with unmet load and excess electricity of 0%, for serving electricity in Makkah, Saudi Arabia is achieved with the PV inverter size ratio of R = 1 with minimized CO2 emissions. However, inverter size can be downsized to 68% of the PV nominal power to reduce the inverter cost, and hence decrease the total NPC of the system.