– At the heart of this town lies a building that is a veritable temple to the area’s most famous creation, the humble Lego brick. It is filled with complex creations, from a 50-foot tree to a collection of multicolored dinosaurs, all of them built with a product that has barely changed in more than 50 years.

A short walk away in its research lab, though, Lego is trying to refashion the product it is best known for: It wants to eliminate its dependence on petroleum-based plastics and build its toys entirely from plant-based or recycled materials by 2030.

The challenge is designing blocks that click together yet separate easily, retain bright colors and survive the rigors of being put through the laundry or the weight of an unknowing parent’s foot. In essence, the company wants to switch the ingredients but keep the product exactly the same.

“We need to learn again how to do this,” said Henrik Ostergaard Nielsen, a production supervisor at Lego’s factory in Billund.

Consumers worldwide have voiced growing alarm about the impact of plastic waste on the environment, and increasing numbers of companies are trying to use packaging materials that are recyclable or otherwise less polluting. Coca-Cola, for instance, plans to collect and recycle the equivalent of all the bottles and cans it uses by 2030. Unilever, the consumer goods giant, says all its plastic packaging will be recyclable or compostable by 2025. Others, like McDonald’s and Starbucks, are doing away with plastic straws in their franchise outlets.

Lego faces a more complex problem than other consumer businesses, though. For this Danish company, plastics are not the packaging, they are the product.

Lego traces its roots back to the early 1930s, when a carpenter named Ole Kirk Kristiansen began making and selling handsome fire engines and other wooden toys.

Today, the company sells its wares worldwide. Its heft, however, brings with it a substantial carbon footprint. Each day, its manufacturing facility in Billund churns out about 100 million “elements,” the term Lego uses for the bricks, trees and doll parts it sells.

Lego emits about 1 million tons of carbon dioxide each year, about three-quarters of which comes from the raw materials that go into its factories, according to Tim Brooks, the company’s vice president for environmental responsibility.

Lego is taking a two-pronged approach to reducing the amount of pollution it causes. For one, it wants to keep all of its packaging out of landfills by 2025 by eliminating things like plastic bags inside its cardboard packaging.

It is also pushing for the plastic in its toys to come from sources like plant fibers or recycled bottles by 2030.

Lego has begun an exhaustive search for new, sustainable materials.

It is investing around $119.2 million and hiring about 100 people to work on these changes. Technicians methodically test promising materials to see whether they can take a whack without breaking or survive a hard pull. They are checked to see if they withstand the heat of a Saudi Arabian summer, and take on the bright color palette that Lego bricks are famous for.

“We look at how does it look, and how does it feel,” said Nelleke van der Puil, Lego’s vice president for materials.