A suburban New York mother who blogged about motherhood has been sentenced to 20 years to life in prison for murdering her young son with a salt overdose so she could bask in social media attention about his mysterious illness.

The sentence imposed on Lacey Spears, 27, who chronicled her 5-year-old son's illnesses on a personal blog called Garnett's Journey and other social media, was less than the maximum penalty of 25 years to life requested by the prosecution.

"By not imposing the maximum, I'm exhibiting something you didn't show your son — namely mercy," said Judge Robert Neary in the Westchester County Courthouse in Valhalla.

A jury convicted Spears of second-degree murder in Garnett's 2014 death at Westchester Medical Centre.

Assistant district attorney Doreen Lloyd described Garnett as a normal, healthy child whose illnesses were induced by his mother, who eventually killed him by putting a lethal amount of salt into the hospitalised boy's feeding tube, all the while blogging and posting pictures to Facebook.

"She continued to portray him as a sick child for her own bizarre need for attention. She used that feeding tube as a weapon to kill him," Ms Lloyd said.

"Garnett Spears should be in school today, but he's not because his mother murdered him."

Defence lawyers, who asked for the minimum sentence of 15 years to life and filed a notice of appeal, said Spears was innocent and blamed the hospital for negligence.

Spears, who lived in Chestnut Ridge, about 50 kilometres north of New York City, declined the judge's request to make a final statement, standing with her wrists cuffed behind her.

The judge described her as mentally ill and identified her condition as "Munchausen by proxy syndrome", in which a caregiver fabricates a medical problem for someone in their care.

"Your crime is unfathomable in its cruelty. How could a mother ever treat her child in such a callous, inhumane manner?" the judge said.

Spears told investigators that her son, whose father was killed in a car accident, suffered from a slew of medical problems, from Crohn's disease and Celiac diseases to ear abnormalities, according to court papers.

The child had been hospitalised with gastrointestinal symptoms that prosecutors say his mother induced.

Spears had moved with Garnett from Decatur, Alabama, to Clearwater, Florida, to Chestnut Ridge.

Reuters