Eisler was born in Leipzig, the son of Marie (née Fischer) and Rudolf Eisler, a professor of philosophy at Leipzig. His father was Jewish and his mother was Lutheran. In 1901, the family moved to Vienna. His brother was a Communist journalist, Gerhart Eisler. His sister was Ruth Fischer (born Elfriede Eisler), a leader of the German Communist Party (KPD) during the 1920s, and an author. According to secret information declassified in 2010, Ruth Fischer was a key agent of the American intelligence service known as "The Pond".
During World War I, Hanns Eisler served as a front-line soldier in the Austro-Hungarian army and was wounded several times in combat. Returning to Vienna after Austria's defeat, he studied from 1919 to 1923 under Arnold Schoenberg. Eisler was the first of Schoenberg's disciples to compose in the twelve-tone or serial technique. He married Charlotte Demant in 1920; they separated in 1934. In 1925, he moved to Berlin—then a hothouse of experimentation in music, theater, film, art and politics. There he became a member of the Communist Party of Germany and became involved with the November Group. In 1928, he taught at the Marxist Worker's School in Berlin and his son Georg Eisler, who would grow up to become an important painter, was born. His music became increasingly oriented towards political themes and, to Schoenberg's dismay, more "popular" in style with influences drawn from jazz and cabaret. At the same time, he drew close to Bertolt Brecht, whose own turn towards Marxism happened at about the same time. The collaboration between the two artists lasted for the rest of Brecht's life.
In 1929, Eisler composed the song cycle Zeitungsausschnitte, Op. 11. The piece is dedicated to Margot Hinnenberg-Lefebre. Though not written in the twelve-tone technique, the piece was perhaps the forerunner of a musical art style later known as "News Items" – musical compositions that parodied a newspaper's content and style, or that included lyrics lifted directly from newspapers, leaflets, magazines, and other written media of the day. Eisler's piece parodies a newspaper's layout and content, with songs in the cycle given titles similar to headlines. The piece offers evidence of Eisler's socialist leanings, as its lyrics indicate the struggles of ordinary Germans who, after World War I, encountered hardship.
Eisler wrote music for several Brecht plays, including The Decision (1930), The Mother (1932) and Schweik in the Second World War (1957). They also collaborated on protest songs that intervened in the political turmoil of Weimar Germany in the early 1930s. Their Solidarity Song became a popular militant anthem sung in street protests and public meetings throughout Europe, and their Ballad of Paragraph 218 was the world's first song protesting laws against abortion. Brecht-Eisler songs of this period tended to look at life from "below"—from the perspective of prostitutes, hustlers, the unemployed and the working poor. He worked with Brecht and the director Slatan Dudow on the film Kuhle Wampe which was banned by the Nazis in 1933.
After 1933, Eisler's music and Brecht's poetry were banned by the Nazi Party. Both artists fled, first to Moscow, where The Decision was produced and staged. Eventually, Eisler and Brecht sought refuge in the United States, along with other exiles fleeing Nazi Germany. In New York City, Eisler taught composition at the New School and wrote experimental chamber and documentary music. Moving shortly before World War II to Los Angeles, he composed several Hollywood film scores, two of which—Hangmen Also Die! and None but the Lonely Heart—were nominated for Oscars.
Also working on Hangmen Also Die! was Bertolt Brecht, who wrote the story along with director Fritz Lang. In 1947, he wrote the book Composing for the Films with Theodor W. Adorno. In several chamber and choral compositions of this period, Eisler returned to the twelve-tone method he had abandoned in Berlin. His Fourteen Ways of Describing the Rain—composed for Arnold Schoenberg's 70th birthday celebration—is considered a masterpiece of the genre.
Eisler's works of the 1930s and 1940s included Deutsche Sinfonie (1935–57)—a choral symphony in eleven movements based on poems by Brecht and Ignazio Silone—and a cycle of art songs published as the Hollywood Songbook (1938–43). With lyrics by Brecht, Eduard Mörike, Friedrich Hölderlin and Goethe, it established Eisler's reputation as one of the 20th century's great composers of German lieder.
Eisler's promising career in the U.S. was interrupted by the Cold War. He was one of the first artists placed on the Hollywood blacklist by the movie studio bosses. In two interrogations by the House Committee on Un-American Activities, the composer was accused of being "the Karl Marx of music" and the chief Soviet agent in Hollywood. Among his accusers was his sister Ruth Fischer, who also testified before the House Committee that her other brother, Gerhart, was a major Communist agent. The Communist press denounced her as a "German Trotskyite." Among the works that Eisler composed for the Communist Party was the "Comintern March", "The Comintern calls you/Raise high Soviet banner/In steeled ranks to battle/Raise sickle and hammer."
Eisler's supporters—including his friend Charlie Chaplin and the composers Igor Stravinsky, Aaron Copland and Leonard Bernstein—organized benefit concerts to raise money for his defense fund, but he was deported early in 1948. Folksinger Woody Guthrie protested the composer's deportation in his lyrics for "Eisler on the Go"—recorded fifty years later by Billy Bragg and Wilco on Mermaid Avenue album (1992). In the song, an introspective Guthrie asked himself what he would do if called to testify before the House Committee on Un-American Activities, "I don't know what I'll do/I don't know what I'll do/Eisler's on the come and go/and I don't know what I'll do."
Eisler returned to Austria and later moved to Berlin, GDR. Back in Germany, he composed the national anthem of the German Democratic Republic, a cycle of cabaret-style songs to satirical poems by Kurt Tucholsky, and incidental music for theater, films and television, and party celebrations. His most ambitious project of the period was the opera Johannes Faustus on the Faust theme. The libretto, written by Eisler himself, was published in the fall of 1952.It portrayed Faust as an indecisive person who betrayed the cause of the working class by not joining the German Peasants' War. In May 1953, Eisler's libretto was attacked by a big article in Neues Deutschland, the SED organ.
All of these disapproved of the negative depiction of Faust as a renegade and accused the work of being "a slap in the face of German national feeling" and of having "formalistically deformed one of the greatest works of our German poet Goethe" (Ulbricht). Eisler's opera project was discussed in three of the bi-weekly meetings "Mittwochsgesellschaft" [Wednsday club] of a circle of intellectuals under the auspices of the Berlin Academy of Arts beginning 13 May 1953. The last of these meetings took place on Wednesday, 10 June 1952.
A week later the workers rebellion of 17 June 1953 pushed those debates from the agenda. Eisler fell into a deep depression and did not write the music for the opera. In his last work "Ernste Gesänge" (Serious Songs) written between spring 1961 and August 1962, Eisler worked on his depression, taking up the 20th Congress of the Communist Party of the Soviet Union with its demise of the Stalin cult, as a sign of hope for a future enabling to "live without fear". Although he continued to work as a composer and to teach at the East Berlin conservatory, the gap between Eisler and the cultural functionaries of East Germany grew wider in the last decade of his life. During this period, he befriended musician Wolf Biermann, whose critical attitude towards the GDR government later led him to be stripped of the GDR citizenship while he was on a concert tour in West Germany.
Eisler collaborated with Brecht until the latter's death in 1956. He never recovered completely from his friend's demise and his remaining years were marred by depression and declining health. He died of a heart attack (his second) in East Berlin and is buried near Brecht in the Dorotheenstadt cemetery.