Kate Lambert recalls using her library card just once or twice throughout her childhood. Now, she uses it several times a month.

The lure? Electronic books she can download to her laptop. Beginning earlier this year, Ms. Lambert, a 19-year-old community college student in New Port Richey, Fla., borrowed volumes in the “Hitchhiker’s Guide to the Galaxy” series, “The Lovely Bones” by Alice Sebold and a vampire novel by Laurell K. Hamilton, without ever visiting an actual branch.

“I can just go online and type my library card number in and look through all the books that they have,” said Ms. Lambert, who usually downloads from the comfort of her bedroom. And, she added, “It’s all for free.”

Eager to attract digitally savvy patrons and capitalize on the growing popularity of electronic readers, public libraries across the country are expanding collections of books that reside on servers rather than shelves.