Citizen Television said the fire in the early hours of Friday had burnt the victims beyond recognition.
The blaze occurred at the Hillside Endarasha Academy in Nyeri, a primary boarding school for young students.
"We have lost 17 pupils in the fire incident while 14 are injured," police spokesperson Resila Onyango said.
Our thoughts are with the families of the children who have lost their lives in the fire tragedy at the Hillside Endarasha Academy in Nyeri County.— William Samoei Ruto, PhD (@WilliamsRuto) This is devastating news.We pray for speedy recovery to the survivors.I instruct relevant authorities to thoroughly investigate…September 6, 2024
"Our team is at the scene at the moment."
Government spokesperson Isaac Mwaura said the boys were in grades 4 to 8, putting their ages about nine to 13 years old.
He said the dormitory housed 156 students.
The cause of the fire was not immediately clear.
President William Ruto said he had told authorities to investigate what he called the "horrific incident" and said those responsible would be held to account.
Authorities had cordoned off the school, the Kenya Red Cross said on X.
Kenya has a history of school fires, many of which have turned out to be arson.
Nine students were killed in Sept 2017 in a fire at a school in the capital Nairobi that the government attributed to arson.
In 2001, 58 schoolboys were killed in a dormitory fire at Kyanguli Secondary School outside Nairobi.
In 2012, eight students were killed at a school in Homa Bay County in western Kenya.