Thackeray, an only child, was born in Calcutta, India, where his father, Richmond Thackeray (1 September 1781 – 13 September 1815), held the high rank of secretary to the board of revenue in the British East India Company. Richmond Thackeray, born at South Mimms, went to India at the age of sixteen to assume his duties as writer. By 1804 he had fathered a daughter by a native mistress, the mother and daughter being named in his will. Such liaisons being common among gentlemen of the East India Company, it formed no bar to his courting and marrying Anne Becher. Anne Becher (1792–1864) was the second daughter of Harriet and John Harman Becher, also a writer for the East India Company. They sent Anne abroad in 1809, telling her that the man she loved, Henry Carmichael-Smyth, had died. This was not true, but her family wanted a better marriage for her than with Carmichael-Smyth, a military man. She married Richmond Thackeray on 13 October 1810. The truth was unexpectedly revealed in 1812, when Richmond Thackeray unwittingly invited to dinner the supposedly dead Carmichael-Smyth. After Richmond's death, Henry Carmichael-Smyth married Anne in 1818 and they returned to England the next year.
William had been sent to England earlier, at the age of five, with a short stopover at St. Helena where the imprisoned Napoleon was pointed out to him. He was educated at schools in Southampton and Chiswick and then at Charterhouse School, where he was a close friend of John Leech. He disliked Charterhouse, parodying it in his later fiction as "Slaughterhouse." Illness in his last year there (during which he reportedly grew to his full height of 6'3") postponed his matriculation at Trinity College, Cambridge, until February 1829. Never too keen on academic studies, he left the University in 1830.
He traveled for some time on the continent, visiting Paris and Weimar, where he met Goethe. He returned to England and began to study law at the Middle Temple, but soon gave that up. On reaching the age of 21 he came into his inheritance but he squandered much of it on gambling and by funding two unsuccessful newspapers, The National Standard and The Constitutional for which he had hoped to write. He also lost a good part of his fortune in the collapse of two Indian banks. Forced to consider a profession to support himself, he turned first to art, which he studied in Paris, but did not pursue it except in later years as the illustrator of some of his own novels and other writings.
Thackeray's years of semi-idleness ended after he met and, on 20 August 1836, married Isabella Gethin Shawe (1816-1893), second daughter of Matthew Shawe, a colonel, who had died after extraordinary service, primarily in India, and his wife, Isabella Creagh. The marriage appears to have been a very happy one though beset by problems (an overbearing mother-in-law and sickness). Their three daughters were Anne Isabella (1837-1919), Jane (1837; died at 8 months) and Harriet Marian (1840-1875). He now began "writing for his life," as he put it, turning to journalism in an effort to support his young family.
He primarily worked for Fraser's Magazine, a sharp-witted and sharp-tongued conservative publication, for which he produced art criticism, short fictional sketches, and two longer fictional works, Catherine and The Luck of Barry Lyndon. Later, through his connection to the illustrator John Leech, he began writing for the newly created Punch magazine, where he published The Snob Papers, later collected as The Book of Snobs. This work popularized the modern meaning of the word "snob".
Tragedy struck in his personal life as his wife succumbed to depression after the birth of their third child in 1840. Finding he could get no work done at home, he spent more and more time away, until September of that year, when he noticed how grave her condition was. Struck by guilt, he took his ailing wife to Ireland. During the crossing she threw herself from a water-closet into the sea, from which she was rescued. They fled back home after a four-week domestic battle with her mother. From November 1840 to February 1842 she was in and out of professional care, her condition waxing and waning.
In the long run she deteriorated into a permanent state of detachment from reality, unaware of the world around her. Thackeray desperately sought cures for her, but nothing worked, and she ended up confined in a home near Paris. She remained there until 1893, outliving her husband by thirty years. After his wife's illness, Thackeray became a de facto widower, never establishing another permanent relationship. He did pursue other women, in particular Mrs. Jane Brookfield and Sally Baxter. In 1851 Mr. Brookfield barred Thackeray from further visits to or correspondence with Jane. Baxter, an American twenty years his junior whom he met during a lecture tour in New York City in 1852, married another man in 1855.
In the early 1840s, Thackeray had some success with two travel books, The Paris Sketch Book and The Irish Sketch Book. Later in the decade, he achieved some notoriety with his Snob Papers, but the work that really established his fame was the novel Vanity Fair, which first appeared in serialized installments beginning in January 1847. Even before Vanity Fair completed its serial run, Thackeray had become a celebrity, sought after by the very lords and ladies he satirized; they hailed him as the equal of Dickens.
He remained "at the top of the tree", as he put it, for the remaining decade and a half of his life, producing several large novels, notably Pendennis, The Newcomes, and The History of Henry Esmond, despite various illnesses, including a near fatal one that struck him in 1849 in the middle of writing Pendennis. He twice visited the United States on lecture tours during this period.
Thackeray also gave lectures in London on the English humourists of the eighteenth century, and on the first four Hanoverian monarchs. The latter series was published in book form as The Four Georges. In Oxford, he stood unsuccessfully as an independent for Parliament. He was narrowly beaten by Cardwell (1070 votes, against 1005 for Thackeray).
In 1860, Thackeray became editor of the newly established Cornhill Magazine, but was never comfortable as an editor, preferring to contribute to the magazine as a columnist, producing his Roundabout Papers for it.
His health worsened during the 1850s and he was plagued by the recurring stricture of the urethra that laid him up for days at a time. He also felt he had lost much of his creative impetus. He worsened matters by over-eating and drinking and avoiding exercise, though he enjoyed horseback riding and kept a horse. On 23 December 1863, after returning from dining out and before dressing for bed, Thackeray suffered a stroke and was found dead on his bed in the morning. His death at the age of fifty-three was entirely unexpected, and shocked his family, friends, and reading public. An estimated 7000 people attended his funeral at Kensington Gardens. He was buried on 29 December at Kensal Green Cemetery, and a memorial bust sculpted by Marochetti can be found in Westminster Abbey.