Baseball is no longer America’s national pastime. It still embodies the nation’s soul and spirit.

Football is more popular and has more money; basketball attracts more young sports fans. All Major League Baseball ballparks display the number 42 to commemorate Jackie Robinson, who blazed the trail for racial integration of the game 64 years ago; today, the percentage of African-American players in the league is smaller than in the population at large.

Yet baseball’s magic, on view in the playoffs, excites and rejuvenates an angry and dispirited American citizenry as almost nothing else — even killing Osama bin Laden — can.

“Baseball is an allegorical play about America, a poetic, complex, and subtle play of courage, fear, good luck, mistakes, patience about fate, and sober self-esteem,” observed the late Saul Steinberg of the New Yorker. Even in the game’s formative phase, more than a century and a half ago, the great American writer Walt Whitman predicted in the Brooklyn Daily Eagle that it would be “the American game. It will take our people out-of-doors, fill them with oxygen, give them a larger physical stoicism.”

Yet these days the National Football League is the crowd-pleaser. That’s because football is a much more appealing television sport. Recently, in Wisconsin, a regular-season game of the Green Bay Packers got more than twice as many local viewers as a baseball playoff contest featuring the Milwaukee Brewers. The Brewers’ opponents, the Arizona Diamondbacks, did worse with home state fans: In Phoenix, the game had almost four times fewer viewers than the NFL’s Cardinals. Even a pregame NFL television program got higher ratings than any of the baseball post-season games.

Still, under the oft-maligned commissioner Bud Selig, baseball has enjoyed a renaissance in the past few decades.

Even with the most prolonged economic downturn since the Depression, Major League Baseball attendance has soared; this year, 73.4 million fans showed up to cheer the 30 teams. That was the fifth-highest turnout ever.

The smallest showing was in Oakland, with a little less than 1.5 million; 40 years ago, more than half the Major League teams had smaller attendances than that, and one-third had less than 1 million.

The price of tickets to sporting events, driven by astronomical players’ salaries and owners’ profits, has skyrocketed. Baseball remains more affordable. A parent can take a kid to a Major League game, get good seats, buy a couple hot dogs, a beer and soft drink for less than $60. The same package for a football game is three or four times more expensive.

Ironically, baseball has flourished in parks in the city centers, while the number of black players has declined. A quarter-century after Robinson integrated the game, 27 percent of Major League Baseball players were black; today it’s only 8.5 percent.

It isn’t discrimination; the sport has far more black administrators and managers and coaches than before. Baseball has become less popular among young American blacks, who often make other choices; the National Basketball Association is overwhelmingly black, and the NFL is increasingly dominated by African-Americans.

At the same time, baseball has gained many more Hispanics — both U.S.-born and from Latin America — who now account for more than a quarter of the Major League rosters. Baseball is hugely popular south of the border. Venezuela and the Dominican Republic have well-developed winter leagues and increasingly are feeders to the American majors; no club is without a Latin American scouting team.

In Asia, baseball is popular in Japan, South Korea and Taiwan. It never caught on in Europe, though there’s a fledgling movement in Germany.

In the United States, football’s popularity notwithstanding, a community’s identity is more likely to be associated with baseball.

Then there’s Washington, which endured without a baseball team from 1971 to 2005, and became a pro football town, viscerally attached to the Redskins. That could change.

The perpetually bad Nationals finished the season on a roll, and in the final weekend home stand, with nothing at stake for them, cost the Atlanta Braves the playoffs by winning two out of three games. That performance drew more than 100,000 fans and the future looks bright.

On any given night at the new Nationals Park, you might see the speaker of the House, John Boehner — perhaps sneaking behind the stands for a smoke — and liberal Democratic Rep. Ed Markey of Massachusetts. When the Chicago White Sox come to town, President Barack Obama is there to root for his hometown team; Supreme Court Justice Samuel Alito can be seen cheering for his Philadelphia Phillies. The man in jeans and baseball cap in the lower deck on the right-field line is the chairman of the Federal Reserve Board, Ben Bernanke.

Here’s a hard-to-imagine dream: Baseball brings some civility and comity to Washington.

Albert R. Hunt is the executive editor for Washington at Bloomberg News.