BANGALORE, India—In the past two days, Amazon.com Inc. and local rival Flipkart Internet Pvt. have both made billion-dollar bets that online shopping is poised to take off in India, the world's second-most-populous country.

Amazon said Wednesday that it would invest $2 billion to expand its India operations, a day after Flipkart, India's biggest homegrown e-commerce company, said it had raised $1 billion from backers to help it grow.

"We see huge potential in the Indian economy and for the growth of e-commerce in India," Amazon CEO Jeff Bezos said Wednesday. The company didn't give a time-frame for the investment.

Potential is the key word. Amazon, Flipkart, eBay Inc. -backed Snapdeal.com and others are battling for the early lead in an online market that now amounts to just about $2 billion in sales a year. By 2020, analysts forecast, annual Internet sales could hit $30 billion, but that is still relatively small.

In contrast, last year, China racked up $300 billion in online sales, according to iResearch, which tracks Internet activity in China, while in the U.S., Internet retail transactions totaled more than $260 billion.