Ahmadinejad is not allowed to run for a third term under the terms of Iran's constitution, the BBC said.
Rafsanjani, 78, and Mashaei both turned in their paperwork within minutes of Saturday's deadline.
The Washington Post said their registration altered the field for candidates, which had previously been made up of conservative allies of supreme Ayatollah Ali Khamenei.
Rafsanjani is likely to have the support of Iranian reformists while Mashaei will be a favorite among Ahmadinejad's camp.
Video of Victoria’s Secret models trying to 'twerk' hits Instagram
Megyn Kelly: Santa Claus and Jesus are both white men