Through a thorough analysis using Net Present Cost (NPC) over a 20-year period, this research presents a comprehensive and economically optimized solar panel design methodology. The study examines two different PV system configurations: On-Grid PV and Off-Grid PV, using sophisticated simulation and analytical techniques with the aid of HOMER Pro software. The simulation results offer compelling new information about these systems' economic viability. The simulation results in an NPC value of IDR 31,386,360,- for the Off-Grid PV configuration. The On-Grid PV system, in contrast, exhibits a significantly lower NPC value of IDR 8,903,329,- emphasizing its superior economic performance. This On-Grid PV system boasts a significant energy generation capacity of 5,012 kWh/year in addition to favorable cost efficiency. Notably, this is greater than the National Power Company's 1,186 kWh/year energy output. These results highlight the financial benefits of the On-Grid PV system and demonstrate its capability to provide affordable and sustainable energy solutions over a long period. The thorough analysis carried out in this study aids in the optimization of solar panel designs, offers insightful information for future sustainable energy projects, and emphasizes the crucial part that economic factors play in influencing the adoption of renewable energy technologies.