Startups selling sexual-wellness drugs and treatments for baldness have upended the way medicine is sold over the internet, but customers are paying heavily marked-up prices.

Hims Inc. and Roman Health Medical, two of the most popular of those startups, sell erection and hair-loss drugs. They're following the pharmaceutical version of a common retail startup strategy: Take a pedestrian product category — sheets and mattresses, furniture or, in this case, generic drugs — and attempt to turn it into internet riches with fashionable packaging, social media-driven marketing and plenty of venture capital.

At Roman, a 20-milligram dose of sildenafil, the generic ingredient in Viagra, costs $2. Hims charges $3 a pill. The pills are sold to pharmacies for about 15 cents, according to a government survey, and a patient can find them at some drugstores through online discounts for as little as 41 cents a pill.

Some customers seem not to care. Dylan Nelson, 28, of Newport Beach, Calif., is one. His thinning hair had long bothered him, but it was an ad for Hims that convinced him to try finasteride, the generic version of prescription Propecia.

Hims charges $28.50 for a monthly supply of finasteride, plus a $5 fee for an online physician visit. The drug can be had for half the price ­elsewhere. "I know you can get it cheaper through other sources," Nelson said, "But I'm willing to pay more for convenience."

Patients who like the sites' ease may not realize they could have gotten better deals, said Michael Rea, founders of Rx Savings Solutions, which has an app that allows people to compare drug costs.

"The average consumer is not going around looking at six different websites and comparing costs," said Rea. "They might never know they could have gotten it for five bucks."

At Hims, Nelson's monthly finasteride prescription works out to 95 cents per pill, plus the cost of an initial doctor's consultation, but with coupons from online discount provider like GoodRx the pills can be bought for at less than half that, about 40 cents. Pharmacies can purchase the drug for a mere 12 cents a tablet.

Pfizer Inc., which brought Viagra to market, and Merck & Co., which sold Propecia, spent years and millions of dollars convincing men they needed the drugs. In 2017, right before generics hit the market, Viagra cost $61.54 per 100 milligram pill, while Propecia cost $2.51 per pill before it lost its patent in 2013. Once the drugs went generic, the companies' marketing and branding efforts essentially stopped. The startups have stepped into the gap, rebuilding the brand-and the price.