Amazon.com Inc., the largest online retailer, will offer digital copies of CDs bought on its site, as it competes with Apple Inc. and Google Inc. to attract music lovers choosing to store their music on the Web.

The new service, called Amazon AutoRip, gives access to free MP3 versions of tracks from an initial batch of 50,000 albums, including “Overexposed” by Maroon 5 and Pink Floyd’s “The Dark Side of the Moon,” Amazon said today in a statement. The service is retroactive, so anyone who has bought CDs from Amazon since it started selling music in 1998 can claim a copy.

While Amazon was the first company to move music to the cloud — storing content on the Internet for access on any device — its Cloud Player is still trailing Apple’s iTunes and has new rivals in Google and Spotify Inc. In the second quarter, Apple had 64 percent of the market for digital music, compared with 16 percent for Amazon and 5 percent for Google, according to research firm NPD Group Inc.

“We’ve known for a while that there is kind of a hole in the customer experience,” Steve Boom, vice president of digital music at Amazon, said in an interview. “A lot of the music people are putting in the cloud is music that they ripped from CDs. We’re providing a service that’s reducing friction.”

Amazon has spent much of the past year making sure Cloud Player users can access music from more devices — phones and tablets — and more platforms, including Google’s Android and Apple’s iOS. The online retailer also made it possible to listen to music on Roku Inc. boxes and Samsung Electronics Co.’s televisions, and for customers to import music into their Amazon libraries from iTunes and Microsoft Corp.’s Windows Media Player.

Crowded Space

Still, there’s plenty of competition. Spotify, which lets users access music without owning it for a monthly fee, is taking share away from Apple, and the model is something Amazon and Google should emulate, said Brian Blair, an analyst at Wedge Partners Corp. in New York.

“Amazon has done a decent job, but Spotify is disrupting iTunes a little bit everyday,” Blair said. “Amazon Cloud Player, Google Play — I’ve seen no evidence that suggests you’re seeing a migration of users away from iTunes to those services.”

The online retailer worked with “major” record labels to create AutoRip, Boom said. By giving users digital content they didn’t previously have, there’s less incentive to download illegal music, and it gives labels a reason to join, he said. Amazon will focus mostly on new releases and popular albums as more titles are added going forward, Boom said.

The digital copies of CDs are stored for free in users’ Amazon Cloud Player libraries and don’t count toward storage limits, the company said. While customers can legally make a copy of any CD they’ve bought, Amazon’s developers worked to match the digital music available in its MP3 store to physical CDs for sale to make it easier, Boom said.