We use Nielsen s geometric approach to quantify the circuit complexity in a one-dimensional Kitaev chain across a topological phase transition. We find that the circuit complexities of both the ground states and nonequilibrium steady states of the Kitaev model exhibit nonanalytical behaviors at the critical points, and thus can be used to detect both equilibrium and dynamical topological phase transitions. Moreover, we show that the locality property of the real-space optimal Hamiltonian connecting two different ground states depends crucially on whether the two states belong to the same or different phases. This provides a concrete example of classifying different gapped phases using Nielsen s circuit complexity. We further generalize our results to a Kitaev chain with long-range pairing, and we discuss generalizations to higher dimensions. Our result opens up an avenue for using circuit complexity as a tool to understand quantum many-body systems.