He was the illegitimate child of a mathematically gifted lawyer who was a friend of Leonardo da Vinci. In his autobiography, Cardano claimed that his mother had attempted to abort him. Shortly before his birth, his mother had to move from Milan to Pavia to escape the plague; her three other children died from the disease. In 1520, he entered university in Pavia and later in Padua studying medicine. His eccentric and confrontational style did not earn him many friends and he had a difficult time finding work after his studies had ended.
Eventually, he managed to develop a considerable reputation as physician and his services were highly valued at the courts. He was the first to describe typhoid fever.
Today, he is best known for his achievements in algebra. He published the solutions to the cubic and quartic equations in his 1545 book Ars magna. The solution to the cubic was communicated to him by Niccolo Fontana Tartaglia (who later claimed that Cardano had sworn not to reveal it, and engaged Cardano in a decade-long fight), and the quartic was solved by Cardano's student Lodovico Ferrari. Both were acknowledged in the foreword of the book. In his exposition, he occasionally used complex numbers even though he did not quite trust them.
Cardano was notoriously short of money and kept himself afloat by being an accomplished gambler and chess player. A book by him about games of chance (Liber de ludo aleae, written in the 1560's but published only in 1663 after his death, contains the first systematic treatment of probability, as well as a section on effective cheating methods.
Cardano invented several mechanical devices including the combination lock, the Cardano suspension consisting of three concentric rings allowing a supported compass or gyroscope to rotate freely, and the Cardan shaft which allows to transmit rotary motion at various angles and is used in vehicles to this day. He made several contributions to hydrodynamics and held that perpetual motion is impossible, except in celestial bodies. He published two encyclopedias of natural science which contain a wide variety of inventions, facts, and occult superstitions.
Cardano's eldest and favorite son was executed in 1560 after he confessed to having poisoned his annoying, mercenary, cuckolding wife. Cardano's daughter was a prostitute who died from syphilis, prompting him to write a treatise about the disease. His other son was a gambler who stole money from him. Cardano himself was accused of heresy in 1570 because he had computed and published the horoscope of Jesus Christ in 1554. Apparently, his own son contributed to the prosecution. He was arrested and had to spend several months in prison, was forced to abjure and give up his professorship. He moved to Rome, received a lifetime annuity from Pope Gregory XIII (after first having been rejected by Pope Pius V) and finished his autobiography. He died on the day he had (supposedly) astrologically predicted earlier.