In this study, a thermodynamic model and optimization of a flash-binary geothermal system are proposed for power and hydrogen production. The binary cycles contain a dual-pressure ORC cycle and proton exchange membrane electrolyzer for power and hydrogen production. The combination of dual-pressure organic Rankine cycle with zeotropic mixtures enhances the performance of the system considerably, and selection of the best kind of zeotropic mixture as the working fluids of the DORC unit is one of the important methods to improve the performance of the suggested system. Also, the Genetic algorithm is employed to optimize the net output power of the system, in which the results of optimization show that the best performance belongs to Pentane (0.467)/Butane (0.533) with first and second-law efficiencies of 16.66%, 58.03%, respectively, and hydrogen production of 0.3683 kg/hr. Besides, for the base case simulation, the energy and exergy efficiencies of the whole system are reported by about 16.66% and 58.03%, respectively, also for this condition, the derived power from the proposed model and overall exergy destruction is calculated approximately 132.41 kW, and 90.08 kW, respectively and geothermal heat source generates 0.306 kg/hr hydrogen by the proton exchange membrane electrolyzer.