The group will appear in a monthly spin-off from the long-running children’s magazine BeanoMAX which goes on sale today.
Other stars to appear in the pages of the comic include Jessie J, Olly Murs and former Doctor Who, David Tennant.
One Direction, who last week won a “global success” Brit Award to recognise their international sales, said: “We’ve grown up with the magazine so now to actually appear in it with Dennis and Gnasher themselves is incredible.”
Mike Stirling, editor-in-chief of The Beano and BeanoMAX, said: “It was brilliant fun imagining how Jessie, Olly, David and 1D would interact with our mischievous characters and I hope they enjoy the results as much our readers and their fans will.”
In another Comic Relief stunt, comedian Harry Hill is to guest edit The Beano’s Red Nose Day special. He is only the second person to do so and follows in the footsteps of animator Nick Park.
The comedian has written some of his own strips. The Beano special goes on sale on March 6.