We present a general description of topological insulators from the point of view of Dirac equations. The Z2 index for the Dirac equation is always zero, and thus the Dirac equation is topologically trivial. After the quadratic term in momentum is introduced to correct the mass term m or the band gap of the Dirac equation, i.e., m → m − Bp2, the Z2 index is modified as 1 for mB > 0 and 0 for mB < 0. For a fixed B there exists a topological quantum phase transition from a topologically trivial system to a nontrivial system when the sign of mass m changes. A series of solutions near the boundary in the modified Dirac equation is obtained, which is characteristic of topological insulator. From the solutions of the bound states and the Z2 index we establish a relation between the Dirac equation and topological insulators.