On “Saturday Night Live,” Will Ferrell’s genius came from his mastery of one of comedy’s most basic elements: You have to be committed. Nearly anything can be funny as long as the performer completely believes in what he’s doing, no matter how absurd or stupid. If the audience sees doubt in the actor’s eyes — a glimmer of, “This is kinda silly, isn’t it?” — the spell is broken and the humor becomes diluted.

Ferrell demonstrated this principle in nearly every sketch he appeared in during his seven-year stint, and he does it again in “Elf,” his first starring film role. He plays Buddy, a human who crawled into Santa’s sack as a baby and was subsequently raised by elves back at the North Pole. Now, 30 years later, he follows all the customs of the elves, including being perpetually merry, living on sugar, and admiring Santa (played by Edward Asner) to a nearly psychotic degree. Despite physical evidence to the contrary (i.e., being twice the size of one), he believes he is an elf. And more to the point, Ferrell believes that Buddy believes he’s an elf.

This sets the stage for what turns out to be one of the jolliest, funniest, most deliriously whimsical family comedies we’ve seen in quite a while. Buddy finally learns from his adoptive elf father (Bob Newhart) of his true heritage, and sets out for New York — dressed in full elf accouterment — to find his birth father, Walter Hobbs (James Caan), a children’s book editor who is gruff and busy and doesn’t know the True Meaning of Christmas. (Long-lost relatives, as you know, always live in New York and seldom know the True Meaning of anything.)

Buddy’s adventures in the big city are what you’d expect: He’s never dealt with cars before (let alone New York City taxis), he’s fascinated by revolving doors, he takes at face value a cafe’s assertion that it sells the “world’s best cup of coffee,” and he accepts with thanks the fliers for nudie shows being handed out by men on the sidewalk.

But heaven help me, the way Ferrell sells it is hysterical. He’s a completely innocent, blithely naive manchild, skipping and caroling his way through New York like it’s his own personal winter wonderland, demonstrating his obliviousness in an endlessly creative series of vignettes. (Why does he eat cotton balls at the doctor’s office? BECAUSE IT’S FUNNY, that’s why.)

His meeting with his father, who never knew he existed, also results in what you’d expect. Dad is unreceptive, but he has a wife (Mary Steenburgen) and young son (Daniel Tay), whom he neglects, who like Buddy and take him into their home. Buddy wreaks havoc on Dad’s work, causing Dad to blow up. Then Buddy saves the day, and Christmas, and probably the world, all while developing a crush on a girl (Zooey Deschanel) who finds his elf-like guilelessness fascinating.

It’s a lot like “Splash,” and a lot like “Big,” and a lot like some other movies that did not star Tom Hanks. Some family films attempt originality; this one, written by first-timer David Berenbaum and directed by Jon Favreau, is happy to rely on familiar devices, confident that the performances and good-natured holiday cheerfulness will bolster it.

The plan works, and it’s Ferrell’s film all the way. In fact, there is a noticeable decrease in the film’s buoyancy when he is not on the screen, as the story falls back to earth, its unoriginal roots becoming more obvious. Fortunately, he’s nearly always visible, his enthusiasm, dedication and sheer comic agility completely infectious. Kids will probably find his antics amusing, if not hilarious, while enjoying the simple story. Adults, whose eyes for genius are a bit keener, will find no end to the delight that is Will Ferrell.

B+ (1 hr., 34 min.; PG, some very mild crude humor.)