Some 4,900 legislators nationwide voted in what Modi termed a "historic" election to choose the titular head of state.
Ram Nath Kovind, the candidate of Modi's right-wing Bharatiya Janata Party (BJP) and a former lawyer and state governor from the Dalit community, is certain to win.
His main rival is Meira Kumar, the nominee of the Congress-led opposition and also a Dalit.
But the BJP, which won a landslide in a general election in 2014, has for the first time assembled enough electoral college votes across the country to push through its presidential candidate. Congress has traditionally dominated the post.
"There is no rocket science, Ram Nath Kovind will win today," Praful Patel, a leader of the small opposition Nationalist Congress Party, conceded as he cast his vote.
Modi was among the first to vote, using a specially approved violet ink pen. The election commission barred the use of personal pens to ensure clean voting.
The result will be announced Thursday.
"The presidential poll this time is historic. Probably for the first time no party has made any undignified or unwarranted comment on the rival candidate," Modi tweeted on the eve of the poll.