The thermal unit commitment (UC) problem often can be formulated as a mixed integer quadratic programming (MIQP), which is difficult to solve efficiently, especially for large-scale instances. In this paper, with projecting unit generation level onto [0,1] and reformulation techniques, a novel two binary (2-bin) variables MIQP formulation for UC problem is presented. We show that 2-bin formulation is more compact than the state-of-the-art one binary (1-bin) variable formulation and three binary (3-bin) variables formulation. Moreover, 2-bin formulation is tighter than 1-bin and 3-bin formulations in quadratic cost function, and it is tighter than 1-bin formulation in linear constraints. Three mixed integer linear programming (MILP) formulations can be obtained from three UC MIQPs by replacing the quadratic terms in the objective functions by a sequence of piece-wise perspective-cuts. 2-bin MILP is also the best one due to the similar reasons of MIQP. The simulation results for realistic instances that range in size from 10 to 200 units over a scheduling period of 24 hours show that the proposed 2-bin formulations are competitive with currently state-of-the-art formulations and promising for large-scale UC problems.