In more than 20 of the most competitive House races of 2018, the share of Democrats voting in primaries notably increased, compared with 2014, the last midterm election cycle.

Democrats have appeared to be more enthusiastic than Republicans about the 2018 elections, showing up in massive numbers to protest President Trump and volunteer for campaigns.

But to win the midterms, Democrats still have to translate that energy into votes. The still-unfolding season of primary elections has been encouraging to Democrats on that front.

Democratic turnout has risen more sharply than Republican turnout in at least 123 congressional districts, including districts where Republican incumbents are most vulnerable, in states like California and New Jersey.

That turnout pattern is highly encouraging to Democrats who hope to flood the polls in November and unseat Republicans, even in districts that typically lean to the right. Midterm campaigns often hinge on voter enthusiasm: Without a presidential race to draw casual voters to the polls, the party out of power tends to benefit from disproportionate turnout among Americans who feel angry or aggrieved about politics in Washington.

That’s exactly what happened in the first midterm election of Barack Obama’s presidency, when Republicans and disaffected independent voters showed up in powerful numbers and pro-Obama voters did not. Democrats lost 63 House seats as a result, handing Republicans control of the House.

The turnout pattern in primary season that year looks a lot like 2018 so far, except with Republicans displaying far greater enthusiasm then. In 186 congressional primaries in 2010, the share of Republicans voting was higher than in the prior midterm election. Democrats improved upon their 2006 numbers in just 35 primaries in 2010 — a convincing indication, months before the general election, that the president’s party was in a slump.

There have been important exceptions to the trend of powerful Democratic enthusiasm this year, and Republicans have been encouraged by robust turnout among Republican voters in a number of statewide primaries, in places like Ohio and Texas.

And there is still time for the political environment to change, perhaps even before the end of primary season. Some of the most important states on the map — including Florida, Michigan and Wisconsin — are still months away from holding primary elections.

Michael Podhorzer, the political director of the A.F.L.-C.I.O., who tracks voting patterns closely, said the primary returns were a positive sign but Democrats should interpret them with caution. It remains uncertain, he said, whether Democrats are activating new and disaffected voters for the midterms, or mostly turning out people who would have voted in November anyway.

“If it wasn’t happening, I’d be really worried,” Mr. Podhorzer said of the turnout boost. “But that it is happening doesn’t make me confident.”

Still, for Republicans seeking to defend a precarious majority in the House, the Democratic turnout increase in closely divided districts has been unsettling. Four of the seats where Democrats improved markedly were in California, including the seats held by Representatives Steve Knight and Dana Rohrabacher, which national Republicans already saw as gravely endangered.

And Democrats surged, too, in the districts of Representatives Leonard Lance of New Jersey and Will Hurd of Texas — lawmakers from diverse, moderate areas where Mr. Trump is unpopular.

Mr. Trump himself has appeared sensitive to the disparity in political energy between the two parties, and he has taken to telling supporters at his campaign rallies that political disengagement could be lethal. At a convention of the National Rifle Association last month, Mr. Trump warned that liberals were “fighting like hell” ahead of the election.