The Catalan Justice Department said prison medics tried to resuscitate him, but were not successful.
It said in a statement that "everything indicates" McAfee took his own life.
A controversial figure in the tech world, his company released the first commercial anti-virus software.
McAfee VirusScan helped to spark a multi-billion dollar industry in the computer world, and was eventually sold to technology giant Intel for more than $7.6bn (£4.7bn).