The critical point of a topological phase transition is described by a conformal field theory, where finite-size corrections to energy are uniquely related to its central charge. We investigate the finite-size scaling away from criticality and find a scaling function, which discriminates between phases with different topological indexes. This function appears to be universal for all five Altland-Zirnbauer symmetry classes with non-trivial topology in one spatial dimension. We obtain an analytic form of the scaling function and compare it with numerical results.