Groupon Inc. filed to go public in a deal that could value the e-commerce company at as much as $20 billion, a hotly anticipated offering that could test the strength of a tech-investing frenzy.

The 2½-year-old company has grown at a torrid pace by pioneering a new approach to selling on the Web, offering daily deals to consumers in partnerships with local merchants. But it has been racking up huge losses, and such Internet powerhouses as Google Inc. and Facebook Inc. are moving to enter its business.

Groupon's...