“To have enslaved America with this hocus-pocus! To have captured the mind of the world’s greatest nation without uttering a single word of truth! Oh, the pleasure we must be affording the most malevolent man on earth!” These words come near the end of Philip Roth’s 2004 novel The Plot Against America, but for some they could have been written yesterday. The election of Donald J Trump as president has been called “unimaginable”, but the truth is many people did imagine the forces that have brought him to power, or versions of them; we just stopped listening to them.

In 1944, an article called “American Fascism” appeared in the New York Times, written by then vice president Henry Wallace. “A fascist,” wrote Wallace, “is one whose lust for money or power is combined with such an intensity of intolerance toward those of other races, parties, classes, religions, cultures, regions or nations as to make him ruthless in his use of deceit or violence to attain his ends.” Wallace predicted that American fascism would only become “really dangerous” if a “purposeful coalition” arose between crony capitalists, “poisoners of public information” and “the KKK type of demagoguery”. Those defending the new administration insist it isn’t fascism, but Americanism. This, too, was foretold: in 1938, a New York Times reporter warned: “When and if fascism comes to America it will not be labelled ‘made in Germany’; it will not be marked with a swastika; it will not even be called fascism; it will be called, of course, ‘Americanism’.”

Today, George Orwell’s Nineteen Eighty-Four is No 1 on Amazon.com, while Hannah Arendt’s The Origins of Totalitarianism has been selling at 16 times its normal rate since December. The Trump administration’s use of Newspeak (“designed to diminish the range of thought”, in Orwell’s words), its partiality for “alternative facts”, have sent readers diving back into history in search not only of explanations, but solutions.

One perspective fiction can offer is to imagine not alternative facts but alternative futures, based on shared pasts. These are the stories we call “counterfactual”, the what-ifs that might have emerged had historical forces twisted in different directions. Nineteen Eighty-Four was Orwell’s vision of postwar fascism, while Aldous Huxley’s Brave New World, written just as European fascism began to consolidate in 1932, incorporated American culture into its dystopian vision, in which citizens of the “World State” pray to long-dead gods of technology (“In Ford We Trust”) and entertain themselves with “Feelies” (a play on “talkies”, the new sound films). Books are suppressed, but no one wants to read them any more anyway.

Books are the enemies of totalitarians, which is why they like to burn them. And there are certainly crucial lessons to be learned from Orwell, Arendt, Elie Wiesel, Aleksandr Solzhenitsyn and many of other writers of the last century who emerged from the first waves of modern totalitarianism determined to share their painful lessons. Consoling tales about defeating nazism remain perennially popular, but darker counterfactual stories have gradually been reclaiming our attention. Len Deighton’s 1978 novel SS-GB, recounting an alternative history in which the Battle of Britain was lost and Germany occupied Great Britain, is being adapted for the BBC, while Amazon’s version of Philip K Dick’s The Man in the High Castle (1962), which imagines the world after the axis powers triumphed, is filming a third season. Its plot hinges on propaganda films that literally offer “alternative facts”, as history changes according to individual choices.

‘A powerful cautionary tale’ … the 1990 film of Margaret Atwood’s The Handmaid’s Tale. Photograph: Allstar/Odyssey

Alongside these fables of evil Nazis and heroic freedom fighters is the spectre of homegrown totalitarianism. And despite America’s insistence that “it can’t happen here”, many writers have shown exactly how it could. The Handmaid’s Tale (1985), Margaret Atwood’s vision of theocratic misogynists taking over America, is among the most powerful modern cautionary tales. One of its most quoted lines articulates the argument of authoritarians everywhere, that “there is more than one kind of freedom … freedom to and freedom from. In the days of anarchy, it was freedom to. Now you are being given freedom from.” Atwood’s parable was published a year after Ronald Reagan passed the “global gag” rule, restricting funding of reproductive rights – the same rule that Trump, surrounded by a group of men, was just photographed signing back into law.

American authoritarianism has always been entangled not only with patriotism, but with the country’s two most familiar belief systems: religion and business. “When fascism comes to America, it will be wrapped in the flag and carrying a cross,” someone once observed, who might have added that it would also be waving a dollar bill. That person was not, as is often reported, Sinclair Lewis in his 1935 novel It Can’t Happen Here, a furious satire of the idea that American exceptionalism might inoculate it against fascism. But Lewis’s novel does make a similar (if less pithy) observation, declaring that in America, fascism’s most dangerous supporters would be those “who disowned the word ‘fascism’ and preached enslavement to capitalism under the style of constitutional and traditional native American liberty”. American fascism will necessarily be shaped by capitalism – or, as Lewis memorably puts it, “government of the profits, by the profits, for the profits”.

It Can’t Happen Here lambasts the “funny therapeutics” of trying to “cure the evils of democracy by the evils of fascism”. Senator Buzz Windrip runs for president on a populist campaign of traditional values, making simplistic promises about returning prosperity (“he advocated everyone’s getting rich by just voting to be rich”). A newspaper editor issues futile warnings: “People will think they’re electing him to create more economic security. Then watch the Terror!” Once in office, Windrip makes good his authoritarian threats, creating a private security force called the Minute Men and imprisoning his political enemies in “concentration camps”. As the midwest grumbles about secession, the administration decides to arouse “that useful patriotism which always appears upon threat of an outside attack” by arranging “to be insulted and menaced in a well-planned series of deplorable ‘incidents’ on the Mexican border, and declare war on Mexico”. Windrip was inspired by Huey Long, the charismatic populist from Louisiana who was assassinated in 1935 and to whom Trump has been frequently compared. Robert Penn Warren’s All the King’s Men (1946) told another tale inspired by Long’s rise and fall: “Just tell ’em you’re gonna soak the fat boys,” politician Willie Stark is cynically advised. “Make ’em cry, make ’em laugh, make ’em mad, even mad at you. Stir them up and they’ll love it and come back for more.”

Sean Penn as Willie Stark in the 2006 film of All the King’s Men. Photograph: Allstar/Sony

More recently, Roth’s The Plot Against America, set at the beginning of the second world war, imagines Charles Lindbergh winning the White House on a slogan of “America First”, the antisemitic platform he supported in real life. In fact, the phrase “America First” was originally associated not with Lindbergh, but with the 1916 campaign of Woodrow Wilson, and then echoed four years later by the first businessman to become president, Warren G Harding, who said during his campaign that “patriotic devotion” meant “to prosper America first, to think of America first, to exalt America first, to live for and revere America first”. Harding’s version of putting America first was to allow the rise of the Ku Klux Klan while creating a graft-ridden cabinet responsible in 1923 for the Teapot Dome bribery scandal, the worst corruption scandal in American political history so far – but then American history isn’t over yet.

The Plot Against America begins as Lindbergh wins the election, thanks to “carnival antics” that leave Republican leaders “in despair over their candidate’s stubborn refusal to allow anyone other than himself to determine the strategy of his campaign”. The president-elect heads immediately to Europe for “cordial talks” with Hitler, agreeing to peaceful relations. This leads to protests at home, but establishes “a new order in Europe”. Still, Americans insist that “America wasn’t a fascist country and wasn’t going to be” because the president and congress were “bound to follow the law as set down by the constitution. They were Republican, they were isolationist, and among them, yes, there were antisemites … but that was a long way from their being Nazis.” The story concerns the gradual erosion of norms and acceptance of oppression: “Now they think they can get away with anything. It’s disgraceful. It starts with the White House.” For all its brilliance, however, Roth’s Plot evades its own central quandary, which is that of history: what is the solution? Roth settles for an easy optimism, one of the US’s national hallmarks, in which American virtue asserts itself and Lindbergh literally disappears.

Trump speaking in front of a picture of his own face at the Republican National Convention in July 2016. Photograph: Carolyn Kaster/AP

We call such facile resolutions “Hollywood endings” for a reason, but it’s also true that the dream factory has been the source of some of America’s most powerful stories about domestic fascism, including the one that Trump has named his favourite film, Orson Welles’s Citizen Kane (1941). When Trump appeared at the Republican National Convention last July in front of a colossal picture of his own face, many were startled by his conjuring of fascist iconography. It seems more likely that he was visually quoting Citizen Kane’s invocation of fascism, in its famous scene of Kane holding a campaign rally with a giant self-portrait behind him; Welles’s satire appears to have been lost in translation. When Kane loses his bid for governor, brought down by a sex scandal, we learn that his newspaper had prepared two headlines, depending on the election outcome: either “Kane Elected” or “Fraud at Polls”. Trump has said he identifies with Kane, overlooking the fact that Kane destroys himself in his quest for greatness. Kane’s only friend says of him after his death: “He never believed in anything except Charlie Kane. He never had a conviction except Charlie Kane in his life.” It wasn’t intended as a recommendation.

Citizen Kane was more about megalomania than the autocracy to which it almost led. (Like Lindbergh, for whom he was instrumental in reviving the phrase “America First”, William Randolph Hearst – on whom Kane was based – spoke approvingly of Hitler, and an early draft of the film reveals that Kane’s son became a card-carrying Nazi.) But during the second world war, Hollywood produced many stories about the defeat of totalitarianism at home, as well as abroad. Frank Capra’s Meet John Doe, also released in 1941, offers a more sentimental version of a similar story. A business tycoon called Norton tries to harness a populist movement for his own purposes, but the people reject him in the name of democratic ideals. “I get mad not just for myself but for a guy named Washington, and Jefferson, and Lincoln,” declares a freedom-loving newspaper editor. Norton believes that “what the American people need is an iron hand” and tries to manipulate the crowd into hating John Doe, their populist hero. But in the end, Doe is saved by a handful of Americans who believe in him, leading to the editor’s valedictory line: “There you are, Norton, the people! Try and lick that!”

These stories continually depict the people rising up to assert their decency, with journalists as their spokespeople. The free press saves America from fascism again and again, as in an all but forgotten film called Keeper of the Flame (1942), the least well known of the screen partnerships of Katharine Hepburn and Spencer Tracy. As it opens, a successful businessman who has become a popular demagogue dies under mysterious circumstances. Eventually his widow reveals that he was, in fact, a secret fascist, supported “by a few private individuals to whom money didn’t mean anything any more but who wanted political power. Knew they could never get it by democratic means.” While movies like Meet John Doe allow that individual authoritarians might occasionally spring up, Keeper of the Flame is one of the few Hollywood films that explicitly imagines a fully fledged homegrown American fascist movement. The demagogue’s campaign is managed by a media manipulator who plants fake stories to stir up hatred, including an “antisemitic paper attacking the Jews”, a Farmer’s Gazette that savages “the city dwellers”, a “Southern appeal to the Ku Klux Klan,” along with plans to create “America’s first storm troopers”. “Of course,” the widow explains, “they didn’t call it fascism. They painted it red, white, and blue, and called it Americanism.”

Media provides both sides with their weapons: the fascists in Keeper of the Flame are defeated when the truth is revealed by the journalist who speaks for democracy, once again. The power of the press drives another political film Hepburn and Tracy made a few years later, State of the Union (1948), which begins with an authoritarian Republican newspaper tycoon’s failed efforts to become president. Just as reporters were the voice of the people, so American fascists were often imagined as newspaper tycoons, thanks to the toxic mix of capitalism, media and politics, the perversion of America’s cult of business, against which people such as Henry Wallace cautioned.

The TV adaptation of Philip K Dick’s The Man in the High Castle. Photograph: Amazon Studios

McCarthyism engendered a whole new cadre of warnings against authoritarianism, with a specifically ideological cast. By 1959, this had inspired books such as The Manchurian Candidate, made into a film in 1962, and also frequently invoked in recent weeks by those who argue that Trump is, in fact, a puppet of the Russian state. These fears were hardly assuaged by his shouts of “no puppet” during the presidential debates, perhaps because they brought to mind a line from The Manchurian Candidate: “You just keep shouting ‘Point of Order, Point of Order’ into the television cameras and I will handle the rest.” As the sinister brainwashing scientist observes: “His brain has not only been washed, as they say, it’s been dry-cleaned.”

McCarthyism camouflaged itself as a story about external enemies infiltrating peaceful American society, so that “Americanism” could define itself against “un-Americanism” and pretend this was a cold war rather than a civil one. As the rifts created by the Vietnam war deepened, however, so did the sense that America was fighting an internal, not an external, battle, an existential struggle for the nation’s soul that drove many people towards a crude nationalism. This is the lesson of a forgotten popular novel written in response to Watergate, another historical shock to America’s democratic spirit. In The R Document (1976) by Irving Wallace, a power hungry FBI director plans to overturn the Bill of Rights with a new constitutional amendment: “No right or liberty guaranteed by the constitution shall be construed as licence to endanger the national security.” He tries to shut down all press opposition and fakes statistics to make his case. Eventually, in another Hollywood ending, a crusading district attorney reveals the truth and shocked congressmen defeat the amendment, but not before Wallace has warned his readers: “If fascism ever comes to the United States, it’ll be because the people voted it in.” Or, as Wallace’s epigraph from Benjamin Franklin puts it, the founding fathers gave us “a republic, if you can keep it”.

These parallels between fictional pasts and our political present may seem eerie: they aren’t. There is nothing surprising about people trying to replicate the oldest models of power. Wallace also quotes the observation of the writer Charles Péguy, killed in the first world war, that tyranny is by definition better organised than freedom. To this it could be added that tyranny is always simpler than freedom, because it decides its own rules, or whether to have any at all.

Frank Sinatra and Laurence Harvey in the 1962 film of The Manchurian Candidate. Photograph: Allstar/United Artists

What all these stories demonstrate – and what their resolutions rely on – is that democracy depends on good faith. Individuals operating in bad faith are nothing new, but these stories trust that the majority work in good faith, and will prevail. Only in Preston Sturges’ The Great McGinty (1940) is the whole system riddled with bad faith, so that a corrupt politician has to flee the country when he tries to go straight. The crisis facing America today isn’t ultimately about political differences: it’s about ethical ones. Faith in business, or religion, or nation means nothing if those faiths are deployed for cynical or vicious ends; it turns out our idealism was there to protect our ideals. “Common decency,” after all, means not only basic decency, but a decency that is held in common. American history is not on Trump’s side; his own favourite film isn’t even on his side.

There are two ways to learn: one is by direct experience, otherwise known as the hard way. The easier way is to read, and pay attention. Ray Bradbury’s Fahrenheit 451 was published in 1953, at the height of McCarthyism. In Bradbury’s dystopian near-future, books were neglected as people’s attention span shortened, until finally they were banned (“a book is a loaded gun in the house next door”). Gradually a fireman who burns books realises they may contain lessons that could save society from repeating the mistakes of the past: “The books are to remind us what asses and fools we are … When they ask us what we’re doing, you can say, We’re remembering. That’s where we’ll win out in the long run.”

During the writing of It Can’t Happen Here, Sinclair Lewis was married to Dorothy Thompson, one of the most influential American journalists of the late 1930s, and the inspiration for Katharine Hepburn’s character in her first pairing with Spencer Tracy, Woman of the Year (1942). Thompson interviewed Hitler in 1931, calling him “the very prototype of the little man”; by 1939, Time magazine named her the second most popular woman in America after Eleanor Roosevelt. In 1941, Thompson wrote an article for Harper’s magazine, called “Who Goes Nazi?”, in which she recommends a “somewhat macabre parlour game” for social gatherings, “to speculate who in a showdown would go Nazi”. Cataloguing various sub-groups (born Nazis, persuaded Nazis, never-Nazis), Thompson notes that nazism was not a matter of nationality but of “a certain type of mind”. She describes Person A, Person B and so on, predicting each one’s potential for fascism, before arriving at “young D”, who is, Thompson declares, “the only born Nazi in the room. Young D is the spoiled only son of a doting mother. He has never been crossed in his life. He spends his time at the game of seeing what he can get away with. He is constantly arrested for speeding and his mother pays the fines. He has been ruthless toward two wives and his mother pays the alimony. His life is spent in sensation seeking and theatricality. He is utterly inconsiderate of everybody. He is very good looking, in a vacuous, cavalier way, and inordinately vain. He would certainly fancy himself in a uniform that gave him a chance to swagger and lord it over others.”

There is also a young immigrant: “The people in the room think he is not an American, but he is more American than almost any of them.” Along with the Americans who understand their own values, one of which is kindness, the immigrant is the greatest opponent of nazism in the room. Only together, Thompson implies, can they recognise, and defeat, young D.