But the candidates differ on lifting the ban on offshore drilling. Obama is mainly against it while McCain is for it, arguing that "drill baby drill" is a way to break dependence on foreign oil.
Both men support climate control: Obama promising to cut greenhouse gases by 80%, McCain by almost 70% and both advocating cars that get more miles per gallon.
Obama and McCain both support investment in renewable energy, like wind and solar power. But their approaches are different.
McCain offers limited tax credits and opposes timetables, while Obama spends $150 billion on development and mandates a quarter of American energy must be renewable by 2025.
But on everything else, the two are opposites:
*Obama would tax the record windfall profits of oil companies, McCain would not.
*Obama backs ethanol subsidies, while McCain opposes them.
*Obama is hesitant about nuclear power, while McCain is a strong advocate, offering subsidies towards building 45 new nuclear plants.
*Obama would ban new coal plants that don't use so-called "clean coal" technology. McCain supports clean coal, but says its wrong to stop the production of traditional coal plants.