About 20 pupils fell ill at Flash Ley Community Primary School and Nursery in Stafford in October amid reports of a mystery smell.
An investigation has concluded that work to floor ducts last summer led to high levels of the chemical, Staffordshire County Council said.
The Hawksmoor Road school has been shut on safety grounds ever since.
Repairs will now start in March and completed in time for the new school year in September.
The building will undergo a deep clean and the substance believed to be behind the presence of formaldehyde in the air removed.
Children will continue lessons at the nearby Chetwynd Centre, Tillington Manor Primary and Stafford Manor High School.
Councillor Ben Adams, cabinet member for learning and skills, said: "Children and staff will only return to the building once extensive tests show that is safe to do so."
Head teacher Simon Barker said: "We are delighted that the county council have announced the decision and staff will now begin to make plans to ensure the arrangements for September will be in place and the transition back to Flash Ley will be smooth.
"I would personally like to thank the children, parents and staff for their support while we have been temporarily moved. We can now look forward to a safe school to educate our children."
Formaldehyde is a colourless gas with a pungent odour and is found in materials used in plywood, carpeting and foam insulation.
Those exposed to it can suffer irritation to the eyes, nose, mouth and throat.
It is understood parents reported children with symptoms of nausea, vomiting and dizziness at the time.

Manx organisation Beach Buddies tackled the problem at Fleshwick Bay following concerns from the public.
Coordinator Bill Dale said one of the coves near the beach was found to be "jammed with plastic".
He added: "Amongst the find were a number of plastic bands which became infamous when a basking shark was photographed with one around its nose."
About 30 people joined forces with the Beach Buddies volunteers on Saturday morning.
"The area was in serious need of a clear-up," said Mr Dale.
"It was the first trip to Fleshwick for a team of our volunteers this year and it was a really big job".

Cannon Hill Park will host The 2015 Sousse and Bardo Memorial.
Thirty Britons were among 38 tourists killed by a gunman at Port El Kantaoui in an attack on 26 June. A UK tourist was one of 22 killed in a separate attack at a museum in Tunis in March.
The memorial is planned to open in 2018.
See more stories from across the Birmingham and Black Country areas here
The park was chosen following consultation with the victims' families.
It was selected due to its central location, as well as the balance between "seclusion and tranquillity" and "being a place of public prominence", the Foreign and Commonwealth Office (FCO) said.
FCO Minister for North Africa Tobias Ellwood said it will be a "place of remembrance for the families of those who lost their lives".
West Midlands victims include Charles Patrick Evans, 78, his son Adrian Evans, 49, and grandson Joel Richards, 19, who were killed in Sousse and Sally Adey, 57, of Shropshire, who died in the museum attack.
Councillor Lisa Trickett, cabinet member for environment at Birmingham City Council, said: "We are honoured that the families of the victims of this terrible massacre have chosen it as the place for their memorial.
"I hope that it will in some small way help the families directly affected, whilst also providing a space for everyone to remember, commemorate and reflect."
The Foreign Office is now inviting expressions of interest to design the memorial, which will be located on an oval-shaped site with views of the boating lake.
A shortlist will be announced at a later date.
A primary school will be closed until September after high levels of formaldehyde were discovered last year.
[NEXT_CONCEPT]
A stream "choked by plastic" on the southern coast of the Isle of Man has been cleaned up by charity volunteers.
[NEXT_CONCEPT]
A memorial dedicated to British tourists killed in two terrorist attacks in Tunisia in 2015 will be erected in a Birmingham park.