Richard Attenborough, who has died aged 90, had three distinct personas for those who followed his career in the entertainment world: the baby-faced, pint-sized actor, at turns, cocky and cowardly, later rotund in mostly creepy character roles; the film director of epics such as Gandhi, and Chaplin; and Lord "Dickie", ubiquitous, ebullient and lachrymose, presiding over a host of charitable organisations. However, each image merges into one complete picture of a cheerful humanitarian and imperishable idealist who, for over half a century, played an integral part in British cultural life.

In the history of cinema, the image of the actor will probably be the most enduring, though physically Attenborough lacked the requirements of a romantic leading man (ironically, his younger brother, David, the wildlife expert, had the film-star looks). In fact, Attenborough was in front of the camera for over a quarter of a century before his directorial debut, at the age of 46, with Oh! What a Lovely War in 1969.

His first screen role was as a callow stoker who deserts his post in Noël Coward's In Which We Serve (1942), told in flashback by survivors while they cling to a life raft after their ship has been sunk off Crete in May 1941. Small as the part was, the 19-year-old Attenborough made an impression as a cockney coward for Coward. A cockney he wasn't, though he played mainly working-class characters throughout his career.

Attenborough's father, Frederick, was a Cambridge don, who later became principal of University College Leicester. Richard, born in Cambridge, was exposed to culture early. His parents and grandparents were all musical, and one of his first memories was hearing The Messiah conducted by Malcolm Sargent in the De Montfort Hall in Leicester.

Above all, Richard and his two younger brothers, David and John, were brought up with a sense of social responsibility. Their mother, Mary, was chair of a committee to care for evacuee Basque children during the Spanish civil war, and she marched in protest against the bombing of Guernica. On the outbreak of the second world war, the Attenboroughs took two Jewish girls into their home, where they stayed for eight years. "That particular decision, not merely paying lip service but taking positive, responsible action to help other human beings, made a profound impression on me. It has, I suppose, affected my life and my attitudes ever since," Attenborough wrote.

This is clear from most of his choices of subjects as a producer and director. He inherited his energy and non-stop activity from his mother, who died in a car accident, apparently suffering a heart attack as she was returning alone from a committee meeting.

Attenborough was educated in Leicester, at Wyggeston grammar school, and showed his acting skills early on, gaining a scholarship to Rada in 1940. His first part in the West End was Ralph Berger, the younger son of a Bronx Jewish family in Clifford Odets's Awake and Sing. The Times said he played it "with sound understanding", while the Daily Sketch thought he "showed an intensity of feeling and restraint for a youngster who has a big future".

A few months before joining the RAF in June 1943, Attenborough achieved his greatest stage success in Brighton Rock, adapted from the Graham Greene novel by Frank Harvey. Attenborough as Pinkie Brown, the vicious young Catholic gangster, according to the New Statesman, "deserves to have won fame in a single night, for his study in abnormal psychology is thoughtful, delicate and powerful." This forceful performance was recreated in the 1947 Boulting Brothers film version, and remains one of Attenborough's most memorable creations.

In 1945, while in the RAF Film Unit, he married Sheila Sim, whom he had met at Rada. The year before, they had both been cast (though her role was cut out in the editing) in the wartime propaganda film Journey Together, directed by John Boulting, which was meant to demonstrate the special relationship between America and Britain. The US was represented by Edward G Robinson, who waived his fee for playing a flying instructor, while Attenborough was a would-be pilot who has to be content with being a navigator, reflecting his own frustration at never having become a pilot during the war.

After demob, Attenborough continued in uniform on screen in Powell and Pressburger's A Matter of Life and Death (in one shot as an airman) and Peter Ustinov's School for Secrets (both 1946). He was to play several soldiers and sailors into the 1970s. In The Man Within (1947), based on Greene's first novel, one of Attenborough's rare costume dramas, he was an adolescent member of a gang of smugglers, who betrays his leader (Michael Redgrave). He would continue to play teenagers into his late 20s.

Although he had not changed much physically since Pinkie on stage in Brighton Rock four years previously, he brought more maturity to his film performance. However, it was pushing it a bit to accept the 25-year-old Attenborough in the title role of The Guinea Pig (1948), a 15-year-old working-class scholarship boy at a posh public school, particularly as his wife Sheila played the house mistress.

This was followed by another well-meaning social reform melodrama, Boys in Brown (1949), in which "bad 'uns" Attenborough and Dirk Bogarde were Borstal boys. In the same year, Attenborough took another neurotic role on stage, a mentally disturbed Jewish GI in Arthur Laurents's Home of the Brave. Then, eight months after the birth of Michael, their first child, Richard and Sheila appeared together in Roger MacDougall's farce To Dorothy a Son, which ran in the West End for over a year from November 1950.

Meanwhile, Attenborough reprised his cowardly sailor role of In Which We Serve in the submarine drama, Morning Departure (1950) as Stoker Snipe, who cracks under pressure. If John Mills represented the stiff-upper lip school, then Attenborough often had a quivering lower lip. "Pull yourself together, Stokes," says Commander Mills, slapping the hysterical Snipe. "Thank you, sir. I needed that." It worked, because Attenborough seldom let the side down again when below decks in Gift Horse (1952) and The Ship That Died of Shame (1955).

In 1952, Sheila and Richard (as Detective Sergeant Trotter) led the first cast of a play which was to became a theatrical phenomenon. They stayed two years at the Ambassadors with The Mousetrap, of which its author Agatha Christie prophesied that "we should get a nice little run out of it". The Attenboroughs were still around to celebrate the 50th anniversary of the whodunnit's run.

In the mid-1950s, Attenborough reunited with the Boulting brothers in a series of satirical comedies attacking some of Britain's institutions. Attenborough, now having put on more weight, was a louche figure in all of them. In Private's Progress (1956), on the army, he was a scrounger; in Brothers in Law (1957), on the legal profession, a smarmy barrister; and in I'm All Right Jack (1959), on management and unions, he was Sydney de Vere Cox, a shady munitions manufacturer.

In 1960, Attenborough formed Beaver Films with the actor and director Bryan Forbes, and an independent distribution company, Allied Film Makers, with Forbes, Guy Green, Michael Relph, Basil Dearden and Jack Hawkins. His first film as producer was The Angry Silence, an anti-trades union tract, in which Attenborough was a blackleg and yet a hero. Better was the delightfully piquant heist comedy The League of Gentlemen (1960) with a gallery of British ex-army types, including Attenborough in his spiv persona. Also for his own production company was Forbes's Seance On a Wet Afternoon (1964), in which Attenborough was medium Kim Stanley's weak husband.

The 1960s saw him break into Hollywood, with The Great Escape (1963), third-billed, after Steve McQueen and James Garner, as Squadron Leader "Big X" Bartlett, the master escape planner who is later executed. Further US movies were The Flight of the Phoenix (1965) in which he was an inept navigator whose alcoholism has led to a plane, piloted by James Stewart, to crash in the Sahara desert; in The Sand Pebbles (1966), supporting McQueen again, Attenborough was encouraged to go over the top as a crewman hopelessly in love with a Chinese girl bound for prostitution, and as circus man Albert Blossom in Dr Dolittle (1967).

These roles were taken on to help finance his long-cherished project, a film on the life of Gandhi. It was the only film he thought he would direct, but when offered Oh! What a Lovely War, he accepted the challenge gladly.

Although the film, with a dazzling all-star cast of British actors, rather softened Joan Littlewood's scabrous stage satire on the first world war, its stylisation and clever seaside-postcard use of the Brighton pavilion and old pier made it Attenborough's most audacious and artistically successful project. The closing scene, a helicopter shot of thousands of white crosses in a military cemetery, as a chorus sings They'll Never Believe Me, is genuinely moving.

Attenborough appeared in four features in 1970, mostly antipathetic roles, notably as the serial killer John Christie in 10 Rillington Place. The sight of a chubby, bald Attenborough wearing thick glasses rubbing a corpse and moaning with orgasmic delight is particularly disturbing. Sir Richard – he was knighted in 1976 – with a broad Scots accent, played a British general sent to take over a small kingdom in Satyajit Ray's The Chess Players (1977). He had met the great Bengali film director in India during his long quest to set up Gandhi. "I count working for Ray as one of the milestones of my career."

At the same time, Attenborough followed his directorial debut with two technically competent but illustrated schoolbook epics, Young Winston (1972) and A Bridge Too Far (1977), the latter about the allied defeat at Arnhem. Finally, in a similar mode, after 20 years, with Goldcrest having put up two-thirds of the £20m budget, Attenborough was able to make Gandhi (1982), which had a fine performance by Ben Kingsley in the title role. The film is dedicated to Lord Mountbatten, Pandit Nehru and an unknown Indian called Motilal Kothari, who suggested the subject to Attenborough in the first place in 1962.

Nehru's advice to Attenborough was that it would be wrong to deify Gandhi: "He was too great a man for that." The film won eight Oscars – best picture, best actor, best director, best original screenplay, best cinematography, best art direction, best editing, best costume design – the biggest haul ever for a British movie. In his acceptance speech, Attenborough said: "Gandhi believed if we could but agree, simplistic though it be, that if we do not resort to violence then the route to solving problems would be much different than the one we take."

In the 1980s, he was an active and inspirational chairman of Channel 4 and the British Film Institute, as well as taking on a multitude of other duties with professional bodies and charities for film, theatre, drama and education.

With A Chorus Line (1985), Attenborough once again took on material that seemed intractably theatrical. But, as much as he tried to make the Broadway musical "cinematic", such as using flashbacks, it defeated him, replacing cynicism with mawkishness.

He was more at home with another portentous biopic, Cry Freedom (1987), through which he was able to express his anger with apartheid in South Africa. The first half, dealing with the friendship between liberal white journalist Donald Woods (Kevin Kline) and anti-apartheid activist Steve Biko (Denzel Washington), up to the murder of Biko while in police custody, is impressive, but the second half, following Woods's escape from South Africa, descends into conventional thriller territory.

When Attenborough's protracted attempts to make a film about Thomas Paine, the 18th century humanitarian and republican, fell through, he turned to another of his idols in Chaplin (1992), a sprawling, vacuous homage to the great comic. He continued on the biographical path, covering CS Lewis in Shadowlands (1993), the young Ernest Hemingway in In Love and War (1996) and the North American conservationist Archie Belaney in Grey Owl (1999), demonstrating that Attenborough's heart was definitely in the right place as was his camera, most of the time.

He once told the film critic David Robinson that he derived the most pride from a back-handed compliment paid by an American critic. As Attenborough explained: "He said something like, 'the problem with Attenborough's work is that he is more interested in the content than the execution.' Almost without exception that is true. I am glad to say I am sorry if I'm not more adventurous cinematically. But my concern is always, did the film say what I wanted to express or advocate?"

After a gap of 13 years, he returned to the screen as an actor in Steven Spielberg's Jurassic Park (1993), as the mad genius who runs the theme park featuring genetically recreated dinosaurs, a role which he was to repeat in the sequel The Lost World (1997). This introduced him to a new generation of filmgoers, as did his twinkly-eyed Kris Kringle in Miracle on 34th Street (1994), a pointless remake of the 1947 movie. In fact, it was not difficult to see something of Santa Claus in Attenborough, who disarmingly admits that the character is "not far from my own in terms of bonhomie".

In his mid-80s, Attenborough was still active in film production. The last one he directed was Closing the Ring, released in December 2007. It is a love story, set in South Carolina and northern Ireland. A dying gunner, who was in a crash involving a US B-17 plane in 1943, gives a ring to a local to return to his American girlfriend. Fifty years on, a man finds the ring and tracks down the girlfriend and the history of this ring.

Attenborough was devastated by a triple tragedy that occurred on 26 December 2004 when his eldest daughter Jane, her daughter Lucy, and Jane's mother-in-law, Jane Holland, all perished in the Asian tsunami disaster.

In 2008 he suffered a fall at his home in Richmond, south-west London and was rushed to hospital where he went into a coma, but recovered within a few days. Three years later, David said that his brother was confined to a wheelchair, and that it was unlikely he would be making any more films. In early 2012, he joined Sheila in a home for the care of elderly actors in London that they had both supported for many years. Attenborough was awarded a life peerage in 1993. He is survived by Sheila, his son Michael and daughter Charlotte.

• Richard Samuel Attenborough, Lord Attenborough, actor, producer, director, philanthropist, born 29 August 1923; died 24 August 2014