The electronic properties of zinc-blende, wurtzite, and rotationally twinned InP nanowires were studied using first-principles calculations. The results show that all the simulated nanowires exhibit a semiconducting character, and the band gap decreases with increasing the nanowire size. The band gap difference between the zinc-blende, wurtzite, and twinned InP nanowires and bulk InP can be described by ΔE(g)(wire) = 0.88/D(1.23), ΔE(g)(wire) = 0.79/D(1.22) and ΔE(g)(twin) = 1.3/D(1.19), respectively, where D is the diameter of the nanowires. The valence band maximum (VBM) and conduction band minimum (CBM) originate mainly from the p-orbitals of the P atoms and s-orbitals of the In atoms at the core regions of the nanowires, respectively. The hexagonal (2H) stacking inside the cubic (3C) stacking has no effect on the electronic properties of thin InP nanowires.