Most Tommy Cooper stories are funny, but this one isn't. For behind the old Cooper magic and everything that made him the best natural clown Britain ever produced was a secret life of incessant boozing that several times threatened his marriage; childish tantrums; flashes of violence; a lengthy affair he made his children swear they'd never tell their mother about; and a stinginess that was a showbusiness legend. And he once nearly killed Michael Parkinson.

This Cooper, so different from the gangling six foot four figure of chuckling affability whom millions adored on their TV screens, emerges from a biography published next month: Tommy Cooper: Always Leave Them Laughing. Its author, John Fisher, worked with Cooper as a television producer, got to know him, has interviewed those closest to him, and had access to private letters and papers. The result is an extraordinary life of the only man who could rival Eric Morecambe as a popular television performer.

Cooper was born in Caerphilly, moved to Hampshire, and here, at the age of seven, his Aunt Lucy gave him a magic set. From then until his death he was obsessed with tricks, and one Christmas, when he was an apprentice at the British Power Boat Company, the management asked him to perform in the canteen. Cooper said: "I did everything wrong. But the audience loved it. The more I panicked and made a mess of everything, the more they laughed. I came off and cried, but five minutes later I could still hear the sound of the laughter in my ears and was thinking maybe there's a living to be made here." War came, he joined the Guards, and was soon doing a turn at troop concerts. For this he wore a pith helmet, but one night, at an RAF station near Cairo, he couldn't find it, so he grabbed a fez from a passing waiter.

Download the new Independent Premium app Sharing the full story, not just the headlines

He thus emerged from the war with an act recognisable as the one that would take him to the top. Not everyone recognised its potential, the verdict from a 1947 BBC audition being: "Unattractive young man with indistinct speaking voice and extremely unfortunate appearance." But by the early 1950s he had his first television series and was playing the top variety circuit. This included the Glasgow Empire, notoriously a graveyard for southern comics. Fisher writes: "They didn't care for him first house. By the second open warfare had been declared ... Tommy simply came down to the footlights and told them all to fuck off."

Gradually he learnt more subtlety. One night, he played the Bag of Nails, populated by the hardest men in London. As soon as he walked out he was bombarded with bread rolls. The frightened Cooper's response was a feeble "Stop that", whereupon, as he later put it: "The place came over all strange. I said: 'Stop throwing those bread rolls at me.' 'And why should I stop?' someone shouted back. 'Because I haven't got an ad lib for people throwing bread rolls at me.' " The hard cases immediately melted. By the Sixties he was a major star, living in Chiswick (with a seaside retreat at Eastbourne), happily married, and the nation's most imitated performer, loved as much for his Easter Island face as his daft jokes ("I went to the doctor. I said: 'There's something wrong with my foot. What should I do?' He said: 'Limp.'").

But with success came excessive drinking. Some of it was tinged with Cooper humour, like the time he demanded (and got) a large gin and tonic to pour over his cornflakes at a Bournemouth hotel. Yet a lot of it wasn't funny. He was once seen to take from a bag bottles of Green Chartreuse, advocaat, gin, whisky, brandy and other liqueurs, and then mix them in various combinations into tot glasses. After sipping each one, he looked up and said: 'You have to keep experimenting to get any sort of taste.'"

The drinking caused trouble at home. In April 1969, his wife Gwen made the first of several calls to Cooper's manager, Miff Ferrie, telling him she was leaving Cooper because he had struck her in front of the children. A similar call came in 1973. Ferrie spoke to Cooper, who said his wife must have been drunk, which she sometimes was, and their late son Tommy said she gave as good as she got in the fights. There were further late-night calls. After the last one, Ferrie noted: "She has had enough. He drinks all the time ... He gets violent when drunk ... Goes to bed at 5am then goes down to kitchen and starts drinking again."

She gave him one more chance, but soon after, in April 1977, Cooper suffered a heart attack in Rome. The Italian doctors were in no doubt about the cause: chronic alcoholism. There was also the stress of running a mistress, divorcee Mary Kay. They met in 1967, were soon in love and she became his companion on tour. He could be violent with her, too. Fisher describes several incidents, such as the time in a Derby restaurant when "he flung her to the floor after she laughed at his complaint that the crackling with his roast pork was soggy; the time when in some kerfuffle about luggage he ripped apart the seam of an expensive new dress he had just bought her; the time she was anxious about keeping an appointment and he tore another gift, an expensive watch, off her wrist and threw it across the room."

The boozing ("I only drink for medicinal purposes," he would joke, "I'm sick of being sober") sometimes affected his performances. In 1974 a Merseyside club complained he stayed drinking till 7am, and on one night of his week's booking he did not show up at all. He had to forgo a quarter of his fee. At Southend, he only did five minutes before walking off, and other clubs complained he was often late, leaving the band to fill in for up to 45 minutes. An organiser once said to him as he arrived late: "You were on half an hour ago." He replied: "Was I? How did I do?" Kay later wrote: "You just don't know the number of times before a show I've said: 'Please, Tommy, don't drink.'"

At times he would battle it, going to a Hampshire health farm and turning to alcohol-free lager. And there were high spots: his stealing of the show at the 1977 Royal Variety Performance, and his brilliance on the 1979 ChristmasParkinson. (What viewers did not know, however, was that Cooper forgot to put the safety catch on a guillotine about to be deployed on Parkinson, and only the alertness of a technician, who dived in off-camera to flick the switch, saved Parky from serious injury or worse.) But there were lows, too: a commercial for Sodastream where he was so ragged that they had to dub his voice with that of a Cooper impersonator, and the shock of his insurance cover arriving with an exclusion clause referring to "a state of intoxication or whilst suffering from alcoholism directly or indirectly".

And then there was the stinginess: the phobia about buying a round, the demands for free tickets, and the time when a down-on-his-luck old-timer gave him a gag that brought the Palladium house down. When they met later, the old lad didn't ask for payment but a lift down the street. Copper coldly replied: "I'm not a fucking taxi service." Stage doormen did not get a tip but a choice of three envelopes. "Oh well, better luck next time," Cooper would say as they plumped for one empty of money. At least his tipping of taxi drivers gave them a memento. "Have a drink on me," he would say, stuffing a tea bag in their top pocket. "Quite simply," writes Fisher, "he was acknowledged as the tightest man in the business."

But as a performer, he was up among the variety gods. And it was live on TV in 1984 - just after saying to the orchestra: "I want you to play tonight as you've never played before. Together!" - that he clutched his chest, crumpled and died with his fez still on. Today, even people barely old enough to have seen him regard him as the funniest man of all time. As Fisher says: "For all the drinking and tantrums and meanness, he was, and is, a national treasure. You only had to look at him and you felt happier."