In San Francisco, where startups dream of populating the world with self-driving cars and robots, another breed of company is aiming for riches this week: Levi Strauss & Co.

The maker of denim and Dockers, which traces its roots to the California Gold Rush, Levi’s is expected to start trading on the public markets Thursday for the second time in its 165-year history. The listing is a milestone for Levi’s, which has experienced a resurgence in the past decade, overhauling its image, operations and the stretch in its jeans to resonate with today’s shoppers who are increasingly disposed to athleisure wear.

Levi’s, some say, might even be cool again.

“It took them time but they’ve been able to restore a lot of brand equity,” said Marie Driscoll, a managing director who covers fashion and luxury at Coresight Research. “They have their authentic product that they’ve been making forever but adapted to what consumers want today.”

This week’s stock offering, which the company anticipates will raise more than $100 million, is an accomplishment for the chief executive, Charles V. Bergh, and highlights Levi’s ambitions to expand its apparel lines both in the United States and worldwide. Shares of the company are expected to sell for $14 to $16, which would value Levi’s between $5.4 billion and $6.2 billion.

Levi’s, which invented the blue jean in 1873, is woven into America’s history. Once the uniform of cowboys and miners in the American West, the company’s denim went on to be worn by Hollywood stars like Marlon Brando, concertgoers at Woodstock and the young nationwide. But the company hit a series of challenges starting in the 1990s beyond the usual fluctuations in consumer tastes.

New teenage retailers, street-wear companies and low-cost private labels started to eat into its market share. Designer jeans gained appeal on the high end. Then came stumbles from some of the department stores selling its goods. More recently, Levi’s has faced fresh competition from athleisure brands.

Advertising

While the company was bumping along, it began a full-fledged makeover in 2011 with the appointment of Bergh, who is known as Chip and joined Levi’s after nearly three decades at Procter & Gamble. Under him, sales have risen and the brand has been imbued with new energy. Its name is now on a sports stadium, it introduced lasers to distress its jeans and it opened a giant flagship store in Times Square.

Now Levi’s — which falls between the Gap brand and Ralph Lauren in terms of sales — is looking to regain the sales it attained in the ‘90s, when its revenue exceeded $7 billion.

The company declined to comment for this article, citing restrictions before its stock offering.

Levi’s has a long history. Levi Strauss, who immigrated to the United States from Bavaria, set up shop in San Francisco in 1853 with a wholesale dry-goods business. Twenty years later, he and a business partner received a patent for “waist overalls” with metal rivets at points of strain — a garment now known as the blue jean.

“The reason they were patenting this, and a huge part of advertisements around that time, was that they made the pants more durable,” said Emma McClendon, associate curator of costume at the Museum at Fashion Institute of Technology. “So you could put tons of tools or things in your pockets while digging for gold, working on farms, all these things, and the pockets wouldn’t come apart from the jeans.”

Jeans started to become mainstream garments in the 1920s and ‘30s with the rise of Hollywood Westerns, dude-ranch vacations and romanticized images of cowboys. In the ‘60s, Levi’s became, in the words of McClendon, “the de facto uniform of the hippie,” increasing its broader popularity.

Advertising

Strauss died without children in 1902 and he left the company to his nephews. Family members have controlled the business ever since.

The company first listed its shares in the 1970s, but was taken private in 1985 through a leveraged buyout led by descendants of Levi Strauss, the Haas family. They wanted to take a longer-term view of the business rather than focus on short-term results.

Levi’s expects to sell $500 million to $675 million of stock in its return to the public markets. Much of the proceeds from the offering will go to the Haas family. The family will hold about 80 percent of the voting shares after the offering.

Levi’s brought in $5.6 billion in sales last year with a net profit of $285 million. That’s an increase from the start of Bergh’s tenure — the year he joined the company, it had $4.8 billion in sales — but still well below its ‘90s peak.

Bergh, 61, was involved with the integration of Gillette after Procter & Gamble’s $57 billion acquisition of the brand in 2005 and has viewed the turnaround of Levi’s as his opportunity to leave a legacy.

When he joined the business, he set out to address “very fundamental issues,” he said on a podcast last year, pointing to a stalled brand and debt-burdened balance sheet.

“There wasn’t a clear strategy,” he said. “We hadn’t been investing in building the brand, we hadn’t been investing in innovation, we were really disconnected with the consumer, our advertising was not working.”

The company has since introduced a new tagline, “Live in Levi’s,” increased its ad spending and bought the naming rights to the San Francisco 49ers stadium, the site of the Super Bowl in 2016.

It has also made big reductions to its staff, cut its debt and invested in a local facility called the Eureka Innovation Lab. The company credits the lab with “cutting-edge advancements for our company and the industry” in its regulatory filings, including the “four-way stretch fabric” that was part of its women’s jeans relaunch in 2015. Levi’s also hired a chief strategy and artificial intelligence officer this year.

Crucially, the company, which still makes most of its revenue through wholesale channels like department stores, has sought to lift sales through its own shops and websites in recent years. Last year, direct sales accounted for 35 percent of its revenue.

Levi’s has also been expanding in tops — which accounted for 20 percent of sales last year — and women’s apparel, which increased to 29 percent of its sales last year. The company has been generating buzz around its women’s denim, including its so-called Wedgie jean.

While Levi’s has benefited from the work Bergh has done, it has also been helped by “a tide back to denim,” Driscoll said. Other companies have seen those results as well, particularly companies selling lower-cost denim in the post-recession era. (One forecast said the average price of a pair of jeans would fall to around $32 last year.)

Advertising

“Since the economic collapse in 2008 to 2010, that whole period, using expensive apparel to communicate who you are just isn’t as cool as it was,” Driscoll said.

One of the biggest challenges that Bergh and Levi’s have faced in recent years has been the boom in the all-mighty yoga pant. Coresight Research said in a recent report that U.S. imports of women’s elastic knit pants surpassed imports of women’s blue denim pants in 2017. Levi’s has mitigated some of that issue with the stretch it added to its jeans.

“It drives me crazy that women wear yoga pants to nice restaurants — denim would look so much better,” Bergh wrote in an essay for Harvard Business Review last year. “But they’re choosing athleisure because it’s more comfortable. I told our designers that we had to fix this problem.”

The company sought to convey its trendiness in its regulatory filings this month. It described how Beyoncé wore Levi’s cutoff shorts while performing at Coachella in April 2017 as well as its collaborations with Justin Timberlake and the Air Jordan brand from Nike.

This week’s offering gives the company and its owners some new flexibility, said Mike Zuccaro, a Moody’s analyst. Zuccaro said he was impressed with how the company has been able to withstand difficult trends within the retail industry and focus on areas where it can grow.

He added, “The challenges are still there in U.S. retail and everywhere, really, but it says a lot about what Levi’s has been able to do in that environment.”