IN A former Rolls-Royce factory north of London, a new kind of industry is churning. Gothic walls are being moulded and costumes sewn. Women stitch hairs onto goblins. A sculptor creates a huge monument to wizarding might. Two men are employed to spackle the roof. This production line at Leavesden Studios, which has been running for almost a decade, will soon be switched off. “People talk about the effect of factories closing,” says David Heyman, who produces the Harry Potter films. “When we stop filming next May, at least 800 people will be looking for work.”

The recession of 2008-09 has been accompanied by bold claims about businesses' economic importance. As carmakers teetered many people put it about that one in ten American jobs depended on the industry. The figure turned out to include taxi drivers. Similarly adventurous claims have been made for telecoms and road-building. As a single-handed creator of jobs and wealth, though, few can match the writer Joanne Rowling.

Ms Rowling's chief contribution to the economy consists of seven books about a wizard. Harry Potter is an orphan who has been raised in a stifling suburban house. At the age of 11 he is surprised to get an invitation to attend Hogwarts School of Witchcraft and Wizardry. There, he learns about Lord Voldemort, his parents' killer and a wizard of such wickedness that he is known as “He Who Must Not Be Named”. Potter must confront this menace in between worrying about sport, homework and girls.

It is not great literature. The first three books make for pleasant and occasionally gripping beach reading. From the fourth instalment the series begins to sprawl. It also makes unconvincing forays into teenage psychology. Yet even at their clumsiest the books are well-plotted and full of invention. They also avoid the temptation to sneak ideology into children's heads by wrapping it in fantasy. C.S. Lewis's children's books, to which Ms Rowling's are often compared, are spoiled by creeping piety. Philip Pullman's suffer from strident anticlericalism. Although the Harry Potter series endorses traits such as bravery and loyalty, it is intended above all to entertain. It has, hundreds of millions of times.

The story of Harry Potter's journey from the mind of a single mother living in Edinburgh to a global mass-media franchise is a fairy tale. Precisely, it is Cinderella—a story of greatness overlooked, chance discovery and eventual riches. Harry Potter might never have become known had an employee at Christopher Little's literary agency in London not taken a liking to the manuscript's binding and picked it out to read. It went on to be rejected by several publishers. Cinderella's transformation from kitchen grunt to belle is both delightful and disruptive. So it has proved for the companies involved with Harry Potter.

The first company to be transformed was Bloomsbury, a London publishing house. It was a somewhat unlikely home for a blockbuster children's book series. In 1996 the firm's children's books division had generated just £732,000 ($1.2m) in sales, compared with £4.7m for the reference division. Nigel Newton signed up the manuscript that was to become “Harry Potter and the Philosopher's Stone” after market-testing it on his daughter.

The firm had little idea of what was to come. Bloomsbury's annual report for 1996, written shortly before the publication of “Harry Potter and the Philosopher's Stone”, contained no mention of the forthcoming book. The following year's report celebrated three big titles. They were “Great Apes” by Will Self, “The Magician's Wife” by Brian Moore and “Fugitive Pieces” by Anne Michaels. The report did mention that a book by Ms Rowling had won the Smarties prize, awarded by children, and was selling well. Even in the spring of 1999, by which point the Harry Potter books had sold 763,000 copies, the company was still emphasising other children's books, referring to the Harry Potter series as “the tip of a publishing iceberg”.

2009 Universal Orlando Resort

A profitable ride

In fact the Harry Potter books were the iceberg. As each book appeared it drew new readers to the series and expanded sales of earlier books in a snowball effect. Thanks largely to the boy wizard, Bloomsbury's turnover, which had gradually increased from £11m in 1995 to £14m in 1997, took off. In 1999 it stood at £21m. Two years later it was £61m. By the middle of this decade, with Bloomsbury's revenues above £100m, rival publishers were griping that there was no point bidding against the firm for a children's title. So far the books, which are published in America by Scholastic, have sold more than 400m copies worldwide. Not all were read by the young. Central to the books' success was a repackaging, with a darker cover, for adults embarrassed about being seen reading a children's book.

Mr Newton says he became “fearful and respectful” of the windfall. A sudden hit can destabilise any company, but the danger is acute in the swaggering media industry. Bloomsbury banked a lot of the money, and has taken advantage of the slump in asset prices to pick up specialist and scholarly publishers. It now owns Arden, most famous for its series of Shakespeare texts, the legal publisher, Tottel, and the cricketer's bible, Wisden. Having learned to handle magic, Bloomsbury is thus returning to its Muggle (non-wizard) roots. The ideal, Mr Newton says, is to balance the risks—and large potential profits—of the trade fiction business with the dependability and high margins of specialist publishing.

Harry Potter's journey from the mind of a single mother to a global media franchise is a fairy tale

The next company to be touched by the commercial magic wand was even smaller. Heyday Films, a young London production outfit founded by Mr Heyman, was looking for books that could be turned into films. In another tale of magic nearly overlooked, “Harry Potter and the Philosopher's Stone” was picked up by Mr Heyman's secretary in the summer of 1997. He took it to Warner Bros, with which he had a first-look deal. Although his main contact there, Lionel Wigram, was keen, senior executives did not share the enthusiasm. It took the studio until October 1998 to option the rights to the first books. Warner Bros commissioned a screenplay but then spent months negotiating with Steven Spielberg of DreamWorks, who was interested in directing. Only after he pulled out, in February 2000, did the project roll forward.

In retrospect the studio appears unforgivably tardy. But the books had taken off slowly in America. In July 1999 an article in the New York Times asked “Harry who?” Mr Wigram, executive producer of the later films, points out that fantasy was out of fashion at the time (“Lord of the Rings” had not yet appeared). A Hollywood studio was bound to question whether American audiences would warm to an inherently British story. Yet flying broomsticks and dragons are not cheap. The project appeared “too British for the studios but too big to be a British production”.

Warner Bros' initial reluctance to make the films appears odd only because it has had such success with them. With six movies out and two to come, the series has sold $1.7 billion-worth of cinema tickets in America and $3.7 billion elsewhere. In America each Harry Potter film has been among the top five sellers on DVD and VHS tape, even in years when the films were released in November and December. In July Variety, a trade magazine, reported that worldwide DVD sales amounted to $2.7 billion. Throw in a few hundreds of millions of dollars more for television advertising. Between January and October of this year the Harry Potter films were shown 65 times in America, according to Nielsen. Yet the torrent of money, impressive though it is, greatly understates Harry Potter's effect on Hollywood.

In 2001, as the first film in the series headed for cinemas, executives and media pundits speculated that Harry Potter might come to rival “Batman”, a series that then numbered four big-budget films. The contrast is revealing. “Batman” was a good example of a 1990s blockbuster-film franchise. It had big stars in Jack Nicholson and Michael Keaton (and, later, George Clooney and Arnold Schwarzenegger). The films went steadily downhill, both in quality and in box-office performance, as the condition known as “sequelitis” took hold.

Harry Potter is a wholly different product. Instead of A-listers the films feature hitherto obscure child actors and British theatrical talent. Perhaps the biggest star is Alan Rickman, previously known to American cinema-goers (if at all) as the villain in “Die Hard”. Over time they have faded neither commercially nor artistically. If anything the reverse is true. After the first two films the Harry Potter franchise was handed to non-American directors more associated with independent film and television. Alfonso Cuarón, Mike Newell and David Yates have been given a good deal of autonomy by Warner Bros.

Harry Potter was in the vanguard of a new approach to big-budget film-making. Most modern blockbuster franchises have two things in common: they are based on known properties such as books and comics, and they are steered by respected but little-known directors. The successful “Spider-Man” films are directed by Sam Raimi, a cult horror-film maker. Peter Jackson, a New Zealander, was asked to steer “Lord of the Rings”, the first instalment of which appeared a month after Harry Potter. Perhaps the best example of the new model is the revived “Batman” franchise, now in the care of an independent-film director, Christopher Nolan. It is again producing critical cheers and plenty of money for Warner Bros. None of these franchises revolves around a star actor, although all have created stars.

In Harry Potter's case, creative experimentation is possible because of the rigorous control exerted over many aspects of the production. The team that has worked on the Harry Potter films is unusually stable. Mr Heyman and the lead designers have stayed put throughout. All but one of the screenplays have been written by Steve Kloves. Stimulated by a steady supply of complex work, local outfits like Double Negative and the Moving Picture Company have grown in competence and can now handle just about all the films' special-effects needs. Even more unusually, some sets have been allowed to remain in Leavesden Studios for almost ten years. As Mr Heyman puts it, directors may shoot the action from different angles but they are filming the same Hogwarts. It is as though the auteur tradition has been fused with the industrial approach to film-making that was common practice in Hollywood before the war.

Harry Potter and the multiple revenue streams

In 2000 Ms Rowling said her “worst nightmare” was that her hero would end up on the side of fast-food containers. He was to appear just about everywhere else. Warner Bros, which had been wary of being seen to spoil a revered series of books with tacky tie-ins, had no qualms about exploiting its own property. As the first film was released, in 2001, a merchandising blitz began. Shelves groaned under figurines, snow globes, beach towels and furniture. That year Mattel, which held the master toy licence, sold about $160m-worth of Harry Potter products.

Then sales began to drop. Mattel said it sold $130m to $140m worth of toys the following year, when the second film was released. Children had their trinkets by that point: it is unnecessary to buy a figurine of Ron Weasley with detachable broomstick every time a Harry Potter film comes out. A downward trend in sales is also evident for the computer games made by Electronic Arts, which have sold a total of $427m in America, according to NPD, a market-research company. Over the years video-game players have become older—the average age is now 35, according to the Entertainment Software Association. Older players are less interested in games based on films.

Rex Features

A new opportunity to sell stuff looms. Next year “The Wizarding World of Harry Potter” will open in a Universal Studios theme park in Florida. Amateur pictures and videos of the construction site (there are hundreds on YouTube and fan websites) show several tall buildings, including a Hogwarts school. There will be three rides and drinks such as Butterbeer and pumpkin juice, together with “traditional British fare”. And there will apparently be a good deal of shopping.

Impressive though it is, this commercial empire is not the only one to be built on Ms Rowling's creation. Alongside the legitimate one, a parasitic criminal enterprise churns out DVDs. There is also a mountain of paper comment, ranging from newspaper reviews to academic studies. Harry Potter has been subjected to religious critique (“The Gospel According to Harry Potter”), Marxist interpretation and feminist deconstruction (“Females and Harry Potter: Not All That Empowering”). America's Library of Congress tallies some 100 books in English about the boy wizard.

Fans get up to much more. As the books and films took off, the hunger for Harry Potter news and content quickly became so much greater than Warner Bros or the increasingly press-shy Ms Rowling were able to supply that alternative sources began to spring up. The emerging internet fuelled their growth. The most obvious of them are fan websites like MuggleNet and The Leaky Cauldron, which mix official announcements with rumours. But the most intriguing is the strange world of fan fiction.

Ms Rowling's “worst nightmare” was that her hero would end up on fast-food containers

Re-telling the Harry Potter story is a popular pastime. One website dedicated to it, Fiction Alley, added 14 book chapters in November 2009 alone, together with many shorter works. Would-be Rowlings push the Harry Potter story in new directions by focusing on different characters or writing about years not covered in the books. Many plunge into the characters' romantic lives—perhaps the weakest point of “the canon”, as the original series of books is reverentially known. These amateur stories, which are often subjected to rigorous criticism from other fans, are for the most part competent. The students in them often talk the way teenagers actually talk. “I can't just be an arse to him for no reason,” splutters Harry at one point in the third book in the “Lily's Charm” series, by a writer called ObsidianEmbrace. That carries a convincing whiff of the playground.

As Harry Potter's commercial footprint grew and fans' activities became more commercial (some websites sell advertising), a clash became inevitable. By early 2001 Warner Bros' lawyers were sending cease-and-desist letters to people running websites, many of them teenagers. The bigger websites fought back, writing ominously that forces “darker than He Who Must Not Be Named” were trying to spoil their fun. So began the Potter wars. Led by Heather Lawver, a 16-year-old from Virginia who showed a gift for media management, the insurgents forced the studio to back down. It continues to pursue some people who seek to profit from Potter. In October a London supper club had to cancel Harry Potter-themed events. The club held “Generic Wizard” nights instead.

Hollywood studios now understand that fans are not content to sit and passively absorb stories, and that they can wreck a film's prospects if affronted. Led by a producer, George Lucas, enlightened talents have encouraged fans to play with characters and even provided bandwidth for their home-made films. Fans are also given privileged access to news. And it would be a foolish fantasy-film director who failed to turn up at Comic-Con, a nerdy convention in San Diego.

Great media products start trends. “Star Wars” showed studios there was money in toys. Harry Potter has educated publishers about appealing both to children and adults. It has taught studios how to make and sustain blockbuster franchises and how to deal with fans. Perhaps no children's book series will match Ms Rowling's for many years. Given the rise of digital media and piracy, Harry Potter may be seen as a high-water mark in the industry.

Yet there will be fresh surprises. Indeed, there has already been one. The books now being devoured on buses and trains concern a romance between a young woman and a vampire. Like the Harry Potter books, Stephenie Meyer's “Twilight” first became popular in a place on the fringes of Hollywood's consciousness: not Britain this time but America's own “flyover states”. The four-book series by Ms Meyer has sold half as many copies in America as the Harry Potter series, according to Nielsen BookScan. Summit Entertainment has released two films, the second of which, “New Moon”, broke the American record for box-office sales in a single day. Harry Potter will not be easy to follow. But the boy wizard has lit the path.