This paper proposes an optimal power flow (OPF) formulation for bipolar DC microgrids. The bipolar DC microgrid can integrate distributed generations (DGs) and supply power to end-users with high effectiveness and reliability. In comparison with the existing power flow methods for DC grids, which are based on power injection, the current injection power flow method should be adopted for bipolar DC microgrids to entirely consider the bipolar structure. In this regard, the OPF established herein is based on the current injection power flow method. The output current of DGs as well as pole voltages should be adopted as decision variables to utilize the linearity of the power flow equation. The optimal set point of the output power and balanced voltage level of the DGs are determined with respect to three objective functions: generation cost, voltage unbalance, and network loss. Depending on the existence of the constant power load and the generation cost function that cause bilinear equality constraints, the proposed OPF model is classified as a convex quadratic programming (QP) or a nonconvex quadratically constrained QP problem, which can be solved using commercial solvers. The case study validates that the proposed OPF formulation can find the optimal operating point with low computational burden at various grid conditions and operational priority.