A Sydney teenager accused of posting threats that claimed he would carry out the worst attack in Australia since the Port Arthur massacre has been refused bail.

The 17-year-old boy, who has special needs, had been charged with preparation for, or planning a terrorist act and using a telecommunication network with the intention to commit a serious offence.

Justice Robert Beech-Jones today told the NSW Supreme Court the boy posted a number of threats including: "I can get a real long sharp knife and just cut up and kill as many people that I can under a minute."

"If I were to do this it would be the most far worst (sic) bloody massacre ever to happen in Australia since the Port Arthur massacre," another post read, the court heard.

The prosecution alleges the 17-year-old published a series of posts which revealed he intended to attack members of the public with a knife in a suicidal attack on a crowded public area in Sydney.

It also contends that he intended to carry out his threats to make a statement about the mistreatment of people with mental illness.

The judge found the prosecution case against the teenager was weak, partly because of evidence suggesting it was unlikely he intended to carry out his threats.

"But principally because I consider that the prosecution has minimal prospects of establishing that he planned a 'terrorist attack'," he said.

In refusing bail, the judge accepted that the boy's parents would do everything they could to monitor their son if he is released.

"No reasonable person could fail to sympathise with the anguish they must be enduring," he said.

"However I am driven to the conclusion that the risk posed by a nihilistic attack on people congregating in a public place cannot be adequately mitigated, even by a form of strict house arrest."

Family members wept in the Supreme Court when Justice Beech-Jones refused bail for the boy.

AAP