He wrote a letter to Japanese Prime Minister Shinzo Abe, expressing India's solidarity in the wake of these acts of terror.
The killing of Kenji Goto and Haruna Yukawa is "gruesome & unfortunate", Modi said in a statement.
"These murders are a stark reminder to the world of the inhuman nature of terrorism and its emergence as a major challenge to the global community," he said in his letter to Abe, a day after the terror group claimed second of the Japanese hostages had been beheaded.
He said the news of the "savage" killing of the Japanese citizens by the terrorist group IS has "deeply pained and shocked me and the people of India" and "our thoughts and prayers are with the bereaved families and the people of Japan".
Modi said India stands firmly with Japan in condemning in strongest terms these "barbaric" acts of terror.
"Let me also convey my personal good wishes to you as you lead your nation at this moment of grief with your charismatic strength and wisdom," he told Abe.