Hoffmann's ancestors, both maternal and paternal, were jurists. His father, Christoph Ludwig Hoffmann (1736–97), was a barrister in Königsberg, Prussia (now Kaliningrad, Russia), as well as a poet and amateur musician who played the viola da gamba. In 1767 he married his cousin, Lovisa Albertina Doerffer (1748–96). Ernst Theodor Wilhelm, born on 24 January 1776, was the youngest of three children, of whom the second died in infancy.
When his parents separated in 1778, the father went to Insterburg (now Chernyakhovsk) with his elder son, Johann Ludwig Hoffmann (1768–after 1822), while Ernst's mother stayed in Königsberg with her relatives: two aunts, Johanna Sophie Doerffer (1745–1803) and Charlotte Wilhelmine Doerffer (c. 1754–79) and their brother, Otto Wilhelm Doerffer (1741–1811), who were all unmarried. This trio raised the youngster.
The household, dominated by the uncle (whom Ernst nicknamed O Weh—"Oh dear!"—in a play on his initials), was pietistic and uncongenial. Hoffmann was to regret his estrangement from his father. Nevertheless, he remembered his aunts with great affection, especially the younger, Charlotte, whom he nicknamed Tante Füßchen ("Aunt Littlefeet"). Although she died when he was only three years old, he treasured her memory (e.g. see Kater Murr) and embroidered stories about her to such an extent that later biographers sometimes assumed her to be imaginary, until proof of her existence was found after World War II.
Between 1781 and 1792 he attended the Lutheran school or Burgschule, where he made good progress in classics. He was taught drawing by one Saemann, and counterpoint by a Polish organist named Podbileski, who was to be the prototype of Abraham Liscot in Kater Murr. Ernst showed great talent for piano-playing, and busied himself with writing and drawing. The provincial setting was not, however, conducive to technical progress, and despite his many-sided talents he remained rather ignorant of both classical forms and of the new artistic ideas that were developing in Germany. He had, however, read Schiller, Goethe, Swift, Sterne, Rousseau and Jean Paul, and wrote part of a novel titled Der Geheimnisvolle.
Around 1787 he became friends with Theodor Gottlieb von Hippel the Younger (1775–1843), the son of a pastor, and nephew of Theodor Gottlieb von Hippel the Elder, the well-known writer friend of Immanuel Kant. During 1792, both attended some of Kant's lectures at the University of Königsberg. Their friendship, although often tested by an increasing social difference, was to be lifelong.
In 1794, Hoffmann became enamored of Dora Hatt, a married woman to whom he had given music lessons. She was ten years older, and gave birth to her sixth child in 1795. In February 1796, her family protested against his attentions and, with his hesitant consent, asked another of his uncles to arrange employment for him in Glogau (Głogów), Prussian Silesia.
From 1796 Hoffmann obtained employment as a clerk for his uncle, Johann Ludwig Doerffer, who lived in Glogau with his daughter Minna. After passing further examinations he visited Dresden, where he was amazed by the paintings in the gallery, particularly those of Correggio and Raphael. During the summer of 1798, his uncle was promoted to a court in Berlin, and the three of them moved there in August—Hoffmann's first residence in a large city. It was there that Hoffmann first attempted to promote himself as a composer, writing an operetta called Die Maske and sending a copy to Queen Luise of Prussia. The official reply advised to him to write to the director of the Royal Theatre, a man named Iffland. By the time the latter responded, Hoffmann had passed his third round of examinations and had already left for Posen (Poznań) in South Prussia in the company of his old friend Hippel, with a brief stop in Dresden to show him the gallery.
From June 1800 to 1803 he worked in Prussian provinces in the area of Greater Poland and Masovia. This was the first time he had lived without supervision by members of his family, and he started to become "what school principals, parsons, uncles, and aunts call dissolute."
His first job, at Posen, was endangered after Carnival on Shrove Tuesday 1802, when caricatures of military officers were distributed at a ball. It was immediately deduced who had drawn them, and complaints were made to authorities in Berlin, who were reluctant to punish the promising young official. The problem was solved by "promoting" Hoffmann to Płock in New East Prussia, the former capital of Poland (1079–1138), where administrative offices were relocated from Thorn (Toruń). He visited the place to arrange lodging, before returning to Posen where he married "Mischa" (Maria, or Marianna Tekla Michalina Rorer, whose Polish surname was Trzcińska). They moved to Płock in August 1802.
Hoffmann despaired because of his exile, and drew caricatures of himself drowning in mud alongside ragged villagers. He did make use, however, of his isolation, by writing and composing. He started a diary on 1 October 1803. An essay on the theatre was published in Kotzebue's periodical, Die Freimüthige, and he entered a competition in the same magazine to write a play. Hoffmann's was called Der Preis ("The Prize"), and was itself about a competition to write a play. There were fourteen entries, but none was judged worthy of the award: 100 Friedrichs d'or. Nevertheless, his entry was singled out for praise. This was one of the few good times of a sad period of his life, which saw the deaths of his uncle J. L. Hoffmann in Berlin, his Aunt Sophie, and Dora Hatt in Königsberg.
At the beginning of 1804 he obtained a post at Warsaw. On his way there, he passed through his hometown and met one of Dora Hatt's daughters. He was never to return to Königsberg.
Hoffmann assimilated well with Polish society; the years spent in Prussian Poland he recognized as the happiest of his life. In Warsaw he found the same atmosphere he had enjoyed in Berlin, renewing his friendship with Zacharias Werner, and meeting his future biographer, a neighbour and fellow jurist called Julius Eduard Itzig (who changed his name to Hitzig after his baptism). Itzig had been a member of the Berlin literary group called the Nordstern, or "North Stars," and he gave Hoffmann the works of Novalis, Ludwig Tieck, Achim von Arnim, Clemens Brentano, Gotthilf Heinrich von Schubert, Carlo Gozzi and Calderón. These relatively late introductions marked his work profoundly.
He moved in the circles of August Wilhelm Schlegel, Adelbert von Chamisso, Friedrich de la Motte Fouqué, Rahel Levin and David Ferdinand Koreff.
As chief Prussian administrator of the city from 1795 to 1806, Hoffmann was responsible for assigning surnames to Warsaw's Jewish community — a duty he executed based on whims. The names Hoffmann doled out would apparently depend on the day of the week — Monday the names of flowers, Friday the names of fish, or hung-over after drinking with a Prussian army officer military names like Festung, Fojer, Pistolet, and Trompeter. 
But Hoffmann's fortunate position was not to last: on 28 November 1806, during the War of the Fourth Coalition, Napoleon Bonaparte's troops captured Warsaw, and the Prussian bureaucrats lost their jobs. They divided the contents of the treasury between them and fled. In January 1807, Hoffmann's wife and two-year-old daughter Cäcilia returned to Posen, while he pondered whether to move to Vienna or go back to Berlin. A delay of six months was caused by severe illness. Eventually the French authorities demanded that all former officials swear allegiance or leave the country. As they refused to grant Hoffmann a passport to Vienna, he was forced to return to Berlin.
He visited his family in Posen before arriving in Berlin on 18 June 1807, hoping to further his career there as an artist and writer.
Berlin and Bamberg
The next fifteen months were some of the worst in Hoffmann's life.
The city of Berlin was also occupied by Napoleon's troops. Obtaining only meagre allowances, he had frequent recourse to his friends, constantly borrowing money and still going hungry for days at a time; he learned that his daughter had died. Nevertheless, he managed to compose his Six Canticles for a cappella choir: one of his best compositions, which he would later attribute to Kreisler in Lebensansichten des Katers Murr.
Hoffmann's portrait of Kapellmeister Kreisler
On 1 September 1808 he arrived with his wife in Bamberg, where he began a job as theatre manager. The director, Count Soden, left almost immediately for Würzburg, leaving a man named Heinrich Cuno in charge. Hoffmann was unable to improve standards of performance, and his efforts caused intrigues against him which resulted in him losing his job to Cuno. He began work as music critic for the Allgemeine musikalische Zeitung, a newspaper in Leipzig, and his articles on Beethoven were especially well received, and highly regarded by the composer himself. It was in its pages that the "Kapellmeister Johannes Kreisler" character made his first appearance.
Hoffmann's breakthrough came in 1809, with the publication of Ritter Gluck, a story about a man who meets, or believes he has met, the composer Christoph Willibald Gluck (1714–87) more than twenty years after the latter's death. The theme alludes to the work of Jean Paul, who invented the term Doppelgänger the previous decade, and continued to exact a powerful influence over Hoffmann, becoming one of his earliest admirers. With this publication, Hoffmann began to use the pseudonym E. T. A. Hoffmann, telling people that the "A" stood for Amadeus, in homage to the composer Wolfgang Amadeus Mozart (1756–91). However, he continued to use Wilhelm in official documents throughout his life, and the initials E. T. W. also appear on his gravestone.
The next year, he was employed at the Bamberg Theatre as stagehand, decorator, and playwright, while also giving private music lessons.
He became so enamored of a young singing student, Julia Marc, that his feelings were obvious whenever they were together, and Julia's mother quickly found her a more suitable match. When Joseph Seconda offered Hoffmann a position as musical director for his opera company (then performing in Dresden), he accepted, leaving on 21 April 1813.
Dresden and Leipzig
Prussia had declared war against France on 16 March during the War of the Sixth Coalition, and their journey was fraught with difficulties. They arrived on the 25th, only to find that Seconda was in Leipzig; on the 26th, they sent a letter pleading for temporary funds. That same day Hoffmann was surprised to meet Hippel, whom he had not seen for nine years.
The situation deteriorated, and in early May Hoffmann tried in vain to find transport to Leipzig. On 8 May, the bridges were destroyed, and his family were marooned in the city. During the day, Hoffmann would roam, watching the fighting with curiosity. Finally, on 20 May, they left for Leipzig, only to be involved in an accident which killed one of the passengers in their coach and injured his wife.
They arrived on 23 May, and Hoffmann started work with Seconda's orchestra, which he found to be of the best quality. On 4 June an armistice began, which allowed the company to return to Dresden. But on 22 August, after the end of the armistice, the family was forced to relocate from their pleasant house in the suburbs into the town, and during the next few days the Battle of Dresden raged. The city was bombarded; many people were killed by bombs directly in front of him. After the main battle was over, he visited the gory battlefield. His account can be found in Vision auf dem Schlachtfeld bei Dresden. After a long period of continued disturbance, the town surrendered on 11 November, and on 9 December the company travelled to Leipzig.
On 25 February Hoffmann quarrelled with Seconda, and the next day he was given notice of twelve weeks. When asked to accompany them on their journey to Dresden in April, he refused, and they left without him. But during July his friend Hippel visited, and soon he found himself being guided back into his old career as a jurist.
Grave of E. T. A. Hoffmann. Translated, the inscription reads: E. T. W. Hoffmann, born on 24 January 1776, in Königsberg, died on 25 June 1822, in Berlin, Councillor of the Court of Justice, excellent in his office, as a poet, as a musician, as a painter, dedicated by his friends.
At the end of September 1814, in the wake of Napoleon's defeat, Hoffmann returned to Berlin and succeeded in regaining a job at the Kammergericht, the chamber court. His opera Undine was performed by the Berlin Theatre. Its successful run came to an end only after a fire on the night of the 25th performance. Magazines clamoured for his contributions, and after a while his standards started to decline. Nevertheless, many masterpieces date from this time.
During the period from 1819 Hoffmann was involved with legal disputes, while fighting ill health. Alcohol abuse and syphilis eventually caused weakening of his limbs during 1821, and paralysis from the beginning of 1822. His last works were dictated to his wife or to a secretary.
Prince Metternich's anti-liberal programs began to put Hoffmann in situations that tested his conscience. Thousands of people were accused of treason for having certain political opinions,
and university professors were monitored during their lectures.
King Frederick William III of Prussia appointed an Immediate Commission for the investigation of political dissidence; when he found its observance of the rule of law too frustrating, he established a Ministerial Commission to interfere with its processes. The latter was greatly influenced by Commissioner Kamptz. During the trial of "Turnvater" Jahn, the founder of the gymnastics association movement, Hoffmann found himself annoying Kamptz, and became a political target. When Hoffmann caricatured Kamptz in a story (Meister Floh), Kamptz began legal proceedings. These ended when Hoffmann's illness was found to be life-threatening. The King asked for a reprimand only, but no action was ever taken. Eventually Meister Floh was published with the offending passages removed.
Hoffmann died of syphilis in Berlin on 25 June 1822 at the age of 46. His grave is preserved in the Protestant Friedhof III der Jerusalems- und Neuen Kirchengemeinde (Cemetery No. III of the congregations of Jerusalem Church and New Church) in Berlin-Kreuzberg, south of Hallesches Tor at the underground station Mehringdamm.