A handful of some of the largest U.S. companies including Walmart WMT , Nike NKE , Starbucks SBUX , and Salesforce CRM have committed to buying clean energy that comes from solar and wind.

The nine mostly Fortune 500 companies took a pledge on Wednesday to join what’s called the “RE100,” a campaign created by the non-profit advocacy organization The Climate Group and environmental data company CDP. The announcement coincided with Climate Week NYC, a week-long event in New York focused on climate change, organized by The Climate Group.

The companies, which also include Johnson & Johnson JNJ , Goldman Sachs GS and Procter & Gamble PG , plan to buy clean energy to reduce corporate carbon emissions, as well as align their corporate image with the environment.

In addition, many of the companies are seeking to lower company carbon emissions as a strategic business decision. The U.S. could further stiffen carbon emission regulations, which would put carbon-spewing companies at a financial disadvantage.

By publicly pledging to buy electricity from clean sources, the companies are sending a signal to utilities and clean energy project developers that they are willing to be customers. The companies are also signaling the U.S. government that they support the reduction of carbon emissions.

Rows of photovoltaic panels at a North Carolina facility affiliated with Duke Energy. Photograph by Roger Ball — Duke Energy

Technological advances have made clean energy more attractive to companies. Electricity generated by large solar panel and wind farms has become much cheaper in recent years. In some regions with ample sun and wind, electricity from clean energy is competitive in price with that from fossil fuels.

Still, it can be difficult for individual companies to buy only clean power, particularly if they consume huge quantities of energy for factories or data centers. Some of the largest tech companies including Apple AAPL and Google GOOG have data centers powered entirely with clean energy, a change that took them several years to figure out how to do.

These pledges are also voluntary and are not enforced the same way legislation would be. Many of the commitments don’t identify how the companies will reach their goals, and companies sometimes use different metrics to track their progress.

It will take many years for these companies to deliver on their clean energy pledges. Goldman Sachs plans to hit the goal by 2020, while Nike aims for 2025. Johnson & Johnson is giving itself thirty-five years to enforce its pledge; the company’s goal is to buy all clean energy by 2050.

Other large companies that have joined the RE100 in the past include European giants like IKEA Group, Swiss Re VTX , BT Group BT , H&M HM-B , Nestle NESN , Philips PHG and Unilever UN . Thirty six companies have joined the RE100.

Earlier this year Walmart, Apple, Coca-Cola and other U.S. companies committed to lower carbon emissions through a pledge to the White House.

To learn more about climate change and corporate goals watch this Fortune video: