This paper presents a MATLAB GUI based software tool to solve the optimal power flow (OPF) problem in power systems. The computer program, called optimal power flow graphical user interface (opfgui), has been developed to present the efficiency of different metaheuristic optimization methods in solving the OPF problem. The opfgui program offers a choice of seven standard IEEE test systems, six objective functions, and ten optimization methods. The program generates not only optimal solution, that is, optimum control variables and objective function, but also important results such as, convergence profile, bus voltages and bus powers, brunch power flows and losses, violating constraints (if exist), and statistical evaluation of the results. The software aims to support students in the course of power system analysis that includes studies of the OPF. Using opfgui, the students can compare the performances of different optimization methods in solving the OPF problem.