Enhanced electron concentration derived from Ta(5+) doping is responsible for the open-circuit voltage improvement due to the upward shift of the Fermi level, but the oxygen defects generated retard the negative shift of the Fermi level. By mediating the trap states, highly efficient DSSC devices could be achieved.