Philip IV was born in Royal Palace of Valladolid, and was the eldest son of Philip III and his wife, Margaret of Austria. In 1615, at the age of 10, Philip was married to 13-year-old Elisabeth of France, although the relationship does not appear to have been close; some have even suggested that Olivares, his key minister, later deliberately tried to keep the two apart to maintain his influence, encouraging Philip to take mistresses instead. Philip had seven children by Elisabeth, with only one being a son, Balthasar Charles, who died at the age of sixteen in 1646. The death of his son deeply shocked the king, who appears to have been a good father by the standards of the day. Elisabeth was able to conspire with other Spanish nobles to remove Olivares from the court in 1643, and for a brief period she held considerable influence over Philip; by the time of her death, however, she was out of favour, following manoeuvering by Olivares' successor, Luis de Haro.
Philip remarried in 1646, following the deaths of both Elisabeth and his only legitimate heir. His choice of his second wife, Maria Anna, also known as Mariana, Philip's niece and the daughter of the Emperor Ferdinand, was guided by politics and Philip's desire to strengthen the relationship with Habsburg Austria. Maria Anna bore him five children, but only two survived to adulthood, a daughter Margarita Teresa, born in 1651, and the future Charles II of Spain in 1661 – but the latter was sickly and considered in frequent danger of dying, making the line of inheritance potentially uncertain.
Perceptions of Philip's personality have altered considerably over time. Victorian authors were inclined to portray him as a weak individual, delegating excessively to his ministers, and ruling over a debauched Baroque court. Victorian historians even attributed the early death of Baltasar to debauchery, encouraged by the gentlemen entrusted by the king with his education. The doctors who treated the Prince at that time in fact diagnosed smallpox, although modern scholars attribute his death to appendicitis. Historians' estimation of Philip gradually improved in the 20th century, with comparisons between Philip and his father being increasingly positive – some noting that he possessed much more energy, both mental and physical, than his diffident father.
Philip was idealised by his contemporaries as the model of Baroque kingship. Outwardly he maintained a bearing of rigid solemnity; foreign visitors described him as being so impassive in public he resembled a statue, and he was said to have been seen to laugh only three times in the course of his entire public life. Philip certainly had a strong sense of his 'royal dignity', but was also extensively coached by Olivares in how to resemble the Baroque model of a sovereign, which would form a key political tool for Philip throughout his reign. Philip was a fine horseman, a keen hunter and a devotee of bull-fighting, all central parts of royal public life at court during the period.
Philip pictured with his older sister, Anne
in 1612 by Bartolomé González y Serrano
Privately, Philip appears to have had a lighter persona. When he was younger, he was said to have a keen sense of humour and a 'great sense of fun'. He privately attended 'academies' in Madrid throughout his reign — these were lighthearted literary salons, aiming to analyse contemporary literature and poetry with a humorous touch. A keen theatre-goer, he was sometimes criticised by contemporaries for his love of these 'frivolous' entertainments. Others have captured his private personality as 'naturally kind, gentle and affable'. Those close to him claimed he was academically competent, with a good grasp of Latin and geography, and could speak French, Portuguese and Italian well. Like many of his contemporaries, including Olivares, he had a keen interest in astrology. His handwritten translation of Francesco Guicciardini's texts on political history still exists.
Although interpretations of Philip's role in government have improved in recent years, Diego Velázquez's contemporary description of Philip's key weakness – that 'he mistrusts himself, and defers to others too much' — remains relevant. Although Philip's Catholic beliefs no longer attract criticism from English language writers, Philip is still felt to have been 'unduly pious' in his personal life. Notably, from the 1640s onwards he sought the advice of a noted cloistered abbess, Sor María de Ágreda, exchanging many letters with her. This did not stop Philip's becoming known for his numerous affairs, particularly with actresses; the most famous of these was his actress-mistress María Inés Calderón (La Calderona), with whom he had a son in 1629, Juan José, who was brought up as a royal prince. By the end of the reign, and with the health of Carlos José in doubt, there was a real possibility of Juan José's making a claim on the throne, which added to the instability of the regency years.