The use of a genetic algorithm (GA) for optimal sizing of an off-grid hybrid renewable energy system (HRES) is reported. As a pre-feasibility analysis and to determine the appropriate HRES type to be studied, wind energy potential and solar irradiation are first examined for the considered region (Tehran, Iran). These are inputs of the algorithm, and are assessed throughout a year utilising statistical and temperature-based approaches. After identifying the appropriate system type, three scenarios with different system constraints are defined. Applying the GA for each scenario identifies the minimum initial investment costs and net present costs as well as the optimum size of the system components. The results suggest that one scenario (3) has the lowest net present cost and includes 36% renewable energy generation, making it superior to the other optimised system scenarios.