In this paper, an optimal power flow for combined AC and DC grids is proposed. Several suggested projects to increase the transmission capacity are based on multi-terminal HVDC grids (MTDC). The construction of MTDC leads to major changes in the power flow of the existing grids. The problem description given in this paper considers the main points for power flow in a combined AC and MTDC grid. The AC side is calculated with the full power flow equations. The voltage source converter (VSC) are represented with a model based on two generators, an additional AC node and one connecting line. The VSC losses are calculated with a simple model and the DC line losses are also considered. The optimization could focus on several different goals. The resulting optimal power flow is shown in two different grids. Three different scenarios are presented in a small grid with 10 AC nodes and 5 converter stations. In addition, a combined AC and DC grid based on the IEEE118 test system is used to show a large scale example.