A new Zillow® analysis shows homes with solar-energy systems sold for 4.1% more on average than others nationwide in the past year.

The sale premium varies by market – 5.4% in New York, 4.4% in San Franciscoand 3.6% in Los Angeles, for example.

Adobe Stock/Elenathewise

This Earth Day, Zillow is highlighting a green initiative that helps inform homeowners and buyers about their own solar potential by putting a Sun Number on more than 84 million homes nationwide. The Sun Number provides a sense of each home's solar-energy potential and the energy savings that comes with it.

Creating the Sun Number is more complicated than simply looking at how many sunny days a city sees each year. Sun Number, the company that produces its namesake metric that's displayed on Zillow, measures the roof of each home and calculates the pitch, orientation and size of each roof plane. It determines the amount of sun that hits every square meter of the home's roof -- taking into account factors like trees or taller buildings that might block sunlight. Finally, it adds in local factors like the cost of electricity and solar, and the local weather conditions, to compute a Sun Number somewhere between 0 and 100.

The higher the score, the more suitable for solar that house is. While certain markets' solar energy potential seems obvious -- good in Phoenix, not as good in Seattle -- the Sun Number shows far more nuance. Zillow analyzed more than 500 metro areas and, while the top 10 are largely communities in the Southwest, it doesn't take long to find potential surprises. San Jose (90) tied with Phoenix and Yuma for eighth. San Francisco checks in well ahead of sunny San Diego and Tampa at a more-than respectable 87, especially given its reputation for fog.

Nationally, the median Sun Number is 78.

"Energy conservation isn't only good for the environment, it can also translate into big savings on electricity bills as well as help to reduce the strain on the electrical grid," said Zillow senior economist Sarah Mikhitarian. "The Sun Number provides a starting point for potential energy savings, but speaking with a local expert can help homeowners decide whether it pencils out. Homes with solar-energy systems often sell for more than comparable homes without solar power. This premium is largely reflective of the future energy cost savings associated with system."

Currently there are enough solar-electricity systems installed in the U.S. to power 12.3 million homes. And that number is likely to grow as California is requiring that all new homes have solar power starting next year.

Metropolitan Area Median Sun
Las Vegas, NV 93
Phoenix, AZ 90
San Jose, CA 90
Los Angeles-Long Beach-Anaheim, CA 89
Denver, CO 89
Dallas-Fort Worth, TX 87
San Francisco, CA 87
San Antonio, TX 87
Pittsburgh, PA 85
Tampa, FL 84
Virginia Beach, VA 84
New York, NY 83
Washington, DC 82
Miami-Fort Lauderdale, FL 82
Columbus, OH 82
St. Louis, MO 81
Sacramento, CA 81
Riverside, CA 80
San Diego, CA 80
Philadelphia, PA 79
Baltimore, MD 79
Cleveland, OH 79
Indianapolis, IN 79
Orlando, FL 78
Minneapolis-St Paul, MN 77
Portland, OR 76
Houston, TX 75
Cincinnati, OH 75
Austin, TX 75
Chicago, IL 74
Charlotte, NC 74
Kansas City, MO 74
Atlanta, GA 69
Seattle, WA 69
Detroit, MI 67