A 12-year-old boy charged with raping a six-year-old girl at a primary school on Sydney's northern beaches has entered not guilty pleas.

The boy has been charged with three counts of aggravated indecency in company, two counts of sexual intercourse with a child under the age of 10 and one count of indecent assault.

Court documents allege the girl was attacked between June 24 and August 16 this year. The alleged rapes and assaults occurred between 8am and 4pm, according to the documents.

The boy is accused of raping the girl twice on separate occasions, and was with another 12-year-old boy when he allegedly indecently assaulted her three times.

At a Children's Court on Thursday, the boy's defence barrister James Viney formally entered not guilty pleas to the charges on the boy's behalf.