A 30 percent federal tax credit, state and utility rebates, more efficient equipment, and eco-conscious homeowners continue to spur interest in residential solar energy.

As we discuss in our report on solar energy system options, these projects are expensive, but generous programs available in Massachusetts, plus resulting energy savings, add up so that homeowners will quickly recoup upfront costs.

Before shelling out more than $10,000 to equip your home with a solar array, consider your roof’s age. Panels sold today are designed to last for 25 years or more. If your roof is more than 15 years old, the panels will outlast your shingles, which might become a problem when you need a new roof. You’ll have to have solar panels uninstalled and reinstalled, which can be expensive. Many roofing contractors won’t do that work, leaving you to find a separate company to deal with it.

An alternative is to replace your entire roof with solar shingles or tiles, which work the same way panels do. Installing them gives you a new roof and a solar energy system at the same time.

Because many homeowners find solar panels ugly contraptions, solar roofs may boast more curb appeal. CertainTeed offers solar shingles and tiles that get installed right on top of sheathing, replacing some of the roof’s conventional shingles. While solar panels look a bit like the International Space Station crashed onto your roof, solar shingles are composed of thin low-profile units that get installed even with the plane of the roof. They will still have a glassy black surface that visually stands out from adjacent lighter-color asphalt shingles that cover the rest of your roof. In other words, they’re far less noticeable than conventional solar panels, but you’ll still notice that there’s a solar array up there.

Tesla and Luma Solar try to make solar power more attractive by covering the entire roof with a uniform-looking surface. These companies produce metal tiles equipped with photovoltaic generators that get installed on areas of a roof that get the most sun; the rest of the surface gets lookalike non-solar metal tiles. Still, metal tiles don’t look like conventional shingles. If you live in a contemporary-style home, these products might fit in—but they may stand out in a more traditional structure.

On the other hand, as more homeowners embrace solar roofs—or panels, for that matter—they will become more common and may not look odd.

Become a Smarter Consumer Get free, expert advice delivered to your inbox every Wednesday when you sign up for the Weekly Checklist newsletter.

Unfortunately, solar tiles remain pricier than conventional solar panels. Replacing your old roof with conventional shingles and then installing solar panels will still be cheaper than reroofing with solar shingles or tiles.

CertainTeed’s website states that its “solar shingles and solar tiles are considerably more expensive [than panels], costing more than $65,000 for the average install of a full roof system” (before factoring in available tax credits and rebates).

Our researchers collected price quotes from Tesla’s “certified” installers for a few sample homes and were quoted about $20 per square foot—or $40,000 for a 2,000-square-foot roof. Tesla also requires that all its new solar roof customers purchase its Powerwall battery system, which adds $10,000 to $18,000 to the tab. (Again, these costs don’t include the effects of tax credits and other local incentives.)

Panel systems are far less expensive: A typical-size solar energy system using panels runs about $18,000 for a typical home in the Boston area, before tax credits and rebates.

Reasonably priced roofing companies charge about $4 per square foot to install new roofs using high-quality architectural shingles, meaning a typical new roof costs about $10,000 to $12,000.

So, the math: Even if we use a highly conservative estimate (and factor in the 30 percent tax credit), you’ll likely pay at least $35,000 to install a roof with solar shingles or tiles, compared to $10,000 to $12,000 for a conventional one plus $18,000 for a solar panel setup.

Aside from lower costs, other reasons make panels a better buy. Although solar-roof manufacturers claim their products can convert the sun’s rays into electricity as efficiently as panels, they’re still usually less productive. That’s because you can’t reorient or reangle your roof into an optimal position to catch the most rays. Panels, on the other hand, are attached to racks and installed at ideal angles to maximize production.

Another drawback for solar roofs: If you want to add capacity later (say, to generate more juice to charge an EV or to power a new heat pump), it’s pretty easy to slap more solar panels onto your roof. But if you have a solar roof, you’re stuck with the capacity that’s up there.

If you decide to go solar, no matter what you buy, take steps to avoid overpaying and stay out of trouble. Visit the “Solar Energy” section of our website for advice on important matters.