A Google software engineer found dead inside the tech giant’s Chelsea headquarters back in December died of abnormal heart rhythm, officials said Friday.

A janitor found 22-year-old Scott Krulcik unconscious at his work terminal on the sixth floor of the building on Eighth Avenue near West 16th Street around 9 p.m. Dec. 7, police sources said at the time.

EMS workers tried to perform CPR, to no avail. Krulcik was pronounced dead at the scene. His body did not show any signs of trauma, authorities said.

The city Medical Examiner’s Office said Friday that Krulcik died of “cardiac arrhythmia” likely caused by a gene mutation.

“This young man died of an abnormal heart rhythm, which developed due to a genetic abnormality in an ion channel of the heart (also known as ‘cardiac channelopathy’),” chief medical examiner Dr. Barbara Sampson said in a statement.

Krulcik was a Saratoga Springs, New York, native who lived in the West Village with a roommate who was also a Google engineer.

Both Krulcik and his roommate graduated from Carnegie Mellon University in Pittsburgh, Pennsylvania.

He joined Google as a software engineering intern in May 2016 while he was still enrolled in classes at Carnegie Mellon, according to his personal website.

He interned at the company again the following summer, and graduated in May with a degree in computer science.