A memory expert and magician who was a favorite guest of Johnny Carson’s, he astonished audiences by reeling off the names of hundreds of people he had only just met.Harry Lorayne, who parlayed a childhood reading disability and the brutal punishment it engendered into an international career as a memory expert, summoning the names of roomfuls of strangers in a single sitting, rattling off entire small-town telephone books and telling astonished audiences what was written on any page of a given issue of Time magazine, died on Friday in Newburyport, Mass. He was 96.His death, at a hospital, was confirmed by his publicist, Skye Wentworth, who did not specify a cause. He had lived in Newburyport, north of Boston.Fleet of mind and fleet of mouth, Mr. Lorayne was a sought-after guest on television shows and a particular favorite of Johnny Carson’s, appearing on “The Tonight Show” some two dozen times.Mr. Lorayne had begun his professional life as a sleight-of-hand artist and well into old age was considered one of the foremost card magicians in the country. As both magician and mnemonist, he was a direct, gleeful scion of the 19th-century midway pitchman and the 20th-century borscht belt tummler.By the 1960s, Mr. Lorayne was best known for holding audiences rapt with feats of memory that bordered on the elephantine. Such feats were born, he explained in interviews and in his many books, of a system of learned associations — call them surrealist visual puns — that seemed equal parts Ivan Pavlov and Salvador Dalí.Mr. Lorayne demonstrated his act on the night of July 23, 1958, when, in his first big break, he appeared on the TV game show “I’ve Got a Secret.”While the host, Garry Moore, was introducing members of the show’s panel, Mr. Lorayne was at work in the studio audience, soliciting the names of its members.He was then called onstage. Mr. Moore asked the audience members who had given Mr. Lorayne their names to stand. Hundreds did.“That’s Mr. Saar,” Mr. Lorayne began, pointing to a man in the balcony. (The transcriptions here are phonetic.)“Mr. Stinson,” he continued in his rapid-fire New Yorkese, gathering speed. “Miss Graf. Mrs. Graf. Miss Finkelstein. If I can see correctly, I believe that’s the Harpin family: Mr. and Mrs. Harpin; there was Dorothy Harpin and Esther Harpin. Mrs. Pollock. And way in the corner — it’s a little dark there — but I believe that’s Mrs. Stern.”And so it went, through scores of names, each impeccably recalled.How did he do it? “You have to take the name, make it mean something and then associate it to one outstanding feature on the person’s face,” he explained, indicating a man in the audience named Theus.“I thought of the United States: ‘the U.S.,’” Mr. Lorayne continued. “It’s spelled T-H-E-U-S. And I picked out his character lines, from the nose down to the corner of the lip, and just drew a map of the United States there.”Absent the time constraints of television, Mr. Lorayne often said, he could handily memorize the names of 500, or even a thousand, people in a single outing. Over the years, he said, he had met and recalled the names of more than 20 million people.To naysayers who contended that he routinely seeded his audiences with friends, Mr. Lorayne’s reply was unimpeachable: “Who’s got 500 friends?”Nor, as the skeptics sometimes suggested, was Mr. Lorayne a mnemonic freak, endowed with a preternaturally good memory. He was born with quite ordinary powers of recall, he often said, and that was precisely the point. Memory, he maintained, was a faculty akin to a muscle that could be trained and strengthened.Mr. Lorayne did not claim to have invented the mnemonic system that was his stock in trade: As he readily acknowledged, it harked back to classical antiquity. But he was among the first people in the modern era to recognize its use as entertainment, and to parlay it into a highly successful business.Mr. Lorayne ran a memory-training school in New York during the 1960s. via Skye WentworthAt the height of his renown, Mr. Lorayne traveled the country demonstrating his prowess on theater stages, at trade shows and in corporate training seminars. During the 1960s, he ran a memory-training school in New York. In later years, he starred in TV infomercials for his home memory-improvement system. His scores of books were translated into many languages.He was awash in celebrity friends, many of whom were reported to use his techniques. Among them were Anne Bancroft, who spoke of using Mr. Lorayne’s methods to learn lines, and the New York Knicks star — and memory expert in his own right — Jerry Lucas, with whom Mr. Lorayne wrote “The Memory Book” (1974), a New York Times best seller.For many years Mr. Lorayne lived in a gracious townhouse at 62 Jane Street in the West Village of Manhattan. (In sly tribute, his friend Mel Brooks planned to give that address as the home of the playwright Franz Liebkind in his 1967 film, “The Producers.” After Mr. Lorayne’s wife, Renée, objected that the moviegoing public would be banging on their door day and night, Mr. Brooks changed it to the fictional 100 West Jane Street.)Mr. Lorayne’s attainments are all the more noteworthy in light of the fact that he grew up in poverty, struggled academically as a result of undiagnosed dyslexia and concluded his formal education after only a single year of high school.Mr. Lorayne in 1986. As a boy he had an epiphany: If only he could learn to memorize, he realized, his problems with dyslexia would end and he’d avoid his father’s wrath over poor school grades. Stuart William MacGladrie/Fairfax Media, via Getty ImagesHe was born on May 4, 1926, on the Lower East Side of Manhattan to Benjamin and Clara (Bendel) Ratzer. His father was a garment cutter.The family was poor — beyond poor, Mr. Lorayne often said.“They were professional poor people,” he told an interviewer, invoking his parents. “I remember having a potato for dinner.”Benjamin Ratzer was a violent man, and whenever young Harry brought home failing grades on an exam — and because of his dyslexia, he often did — his father beat him.One day, Harry had an epiphany. If only he could learn to memorize, he realized, his problems would end. At the library, he found a shelf of dusty books on memory training, some dating to the 18th century. Most were beyond him, but he fought his way through.Using elementary versions of the techniques he would later employ professionally, he began earning perfect marks.“My father stopped hitting me for my grades,” Mr. Lorayne told The Chicago Tribune in 1988. “He hit me for other things.”When Harry was 12, his father, plagued by illness, died by suicide. Soon afterward, Harry left high school to work a series of odd jobs.“I was a Lower East Side ‘dese, dem and dose’ kid with no money, no prospects, no education, no nothing,” Mr. Lorayne wrote in a self-published memoir, “Before I Forget” (2013).He did not yet conceive of memory as a marketable skill: His professional aspirations lay in magic. As a child, he had watched, entranced, as neighborhood men did card tricks in Hamilton Fish Park, on the Lower East Side. He stole milk bottles, recouped the deposits, bought his first deck of cards and began to practice.He embarked on his magic career in the 1940s, adapting his stage name from the middle name of his wife, Renée Lorraine Lefkowitz, whom he married in 1948. He performed on local television in the early 1950s and did close-up magic at Billy Reed’s Little Club on East 55th Street.The actor Victor Jory, a keen amateur magician, visited the club often to catch Mr. Lorayne’s act. One night, performing at Mr. Jory’s table, Mr. Lorayne realized he had exhausted his vast repertoire of card tricks. Seeking to keep Mr. Jory entertained, he idly tossed off a stunt in which he recalled the location of all 52 cards in a shuffled deck.Mr. Jory raved so much about the feat, Mr. Lorayne wrote, that he realized his future lay in memory. He made it his act, beginning at Catskill hotels.Mr. Lorayne wrote a batch of books, including this one as well as “The Memory Book” (with the basketball star Jerry Lucas), “How to Develop a Super Power Memory,” “Miracle Math” and, his last one, “And Finally!”The bizarre visual associations at the heart of Mr. Lorayne’s system were good not only for remembering names and faces but also, he explained, for memorizing numbers, learning foreign-language vocabulary and the like. The more surreal the association, he said, the more tenacious its hold in the mind.“Take the French word for watermelon, which is ‘pastèque,’” he told the Australian newspaper The Sunday Mail in 1986. “When I wanted to learn this I visualized myself playing cards and saying, ‘Pass the deck; pass deck.’”It was essential to note, he added, that “I am playing cards with a watermelon. I ask the watermelon to pass the deck.”Mr. Lorayne’s wife, who assisted in his stage act for two decades, died in 2014. His survivors include a son, Robert, and a granddaughter.Mr. Lorayne in the early 1990s. He continued to perform as a magician throughout his career, but it was for his feats of memorization that he was, fittingly, remembered. via Skye WentworthHis other books include “How to Develop a Super Power Memory,” “Miracle Math” and “Ageless Memory.” In 2018, at the age of 92, he published his last book, “And Finally!”Throughout his career, Mr. Lorayne continued to ply the magician’s trade, for many years publishing Apocalypse, a magic magazine, and producing books and videos on card magic.But it was as a memory expert that he remained, fittingly, remembered, though his most important act of recall was one that audiences never saw.Before every performance, Mr. Lorayne, out of sight in the wings, would discreetly check to make sure his trousers were zipped.It was not merely a question of propriety, but also of credibility. For the man often billed as the world’s foremost memory expert to face an audience with fly unheeded, he explained, would be the poorest professional advertisement of all.Maia Coleman contributed reporting. More