Kafka was born into a middle-class, German-speaking Jewish family in Prague, the capital of Bohemia, a kingdom that was then part of the Austro-Hungarian Empire. His father, Hermann Kafka (1852–1931), was described by Kafka himself as "a true Kafka in strength, health, appetite, loudness of voice, eloquence, self-satisfaction, worldly dominance, endurance, presence of mind, [and] knowledge of human nature ...". Hermann was the fourth child of Jacob Kafka, a butcher, and came to Prague from Osek, a Jewish village near Písek in southern Bohemia. After working as a traveling sales representative, he established himself as an independent retailer of men's and women's fancy goods and accessories, employing up to 15 people and using a jackdaw (kavka in Czech) as his business logo. Kafka's mother, Julie (1856—1934), was the daughter of Jakob Löwy, a prosperous brewer in Poděbrady, and was better educated than her husband.
Kafka was the eldest of six children. He had two younger brothers, Georg and Heinrich, who died at the ages of fifteen months and six months, respectively, before Kafka was six, and three younger sisters, Gabriele ("Elli") (1889–1941), Valerie ("Valli") (1890–1942), and Ottilie ("Ottla") (1892–1943). On business days, both parents were absent from the home. His mother helped to manage her husband's business and worked in it as much as 12 hours a day. The children were largely reared by a succession of governesses and servants.
Kafka's sisters were sent with their families to the Łódź ghetto and died there or in concentration camps. Ottla is believed to have been sent to the concentration camp at Theresienstadt and then to the death camp at Auschwitz.
Kafka learned German as his first language, but he was also almost fluent in Czech. Later, Kafka also acquired some knowledge of French language and culture; one of his favorite authors was Flaubert. From 1889 to 1893, he attended the Deutsche Knabenschule, the boys' elementary school at the Fleischmarkt (meat market), the street now known as Masná Street in Prague. His Jewish education was limited to his Bar Mitzvah celebration at 13 and going to the synagogue four times a year with his father.  After elementary school, he was admitted to the rigorous classics-oriented state gymnasium, Altstädter Deutsches Gymnasium, an academic secondary school with eight grade levels, where German was also the language of instruction, at Staroměstské náměstí, within the Kinsky Palace in the Old Town. He completed his Matura exams in 1901.
Admitted to the Charles University of Prague, Kafka first studied chemistry, but switched after two weeks to law. This offered a range of career possibilities, which pleased his father, and required a longer course of study that gave Kafka time to take classes in German studies and art history. At the university, he joined a student club, named Lese- und Redehalle der Deutschen Studenten, which organized literary events, readings and other activities. In the end of his first year of studies, he met Max Brod, who would become a close friend of his throughout his life, together with the journalist Felix Weltsch, who also studied law. Kafka obtained the degree of Doctor of Law on June 18, 1906 and performed an obligatory year of unpaid service as law clerk for the civil and criminal courts.
On November 1, 1907, he was hired at the Assicurazioni Generali, an aggressive Italian insurance company, where he worked for nearly a year. His correspondence, during that period, witnesses that he was unhappy with his working time schedule - from 8 p.m until 6 a.m - as it made it extremely difficult for him to concentrate on his writing. On July 15, 1908, he resigned, and two weeks later found more congenial employment with the Worker's Accident Insurance Institute for the Kingdom of Bohemia. However, he did not show any signs of indifference towards his job, as the several promotions that he received during his career prove that he was a hard working employee. In parallel, Kafka was also committed to his literary work. Together with his close friends Max Brod and Felix Weltsch these three were called "Der enge Prager Kreis", the close Prague circle.
In 1911, Karl Hermann, spouse of his sister Elli, proposed Kafka collaborate in the operation of an asbestos factory known as Prager Asbestwerke Hermann and Co. Kafka had to dedicate much of his free time to the business. During that period, he also found interest and entertainment in the performances of Yiddish theatre, despite the misgivings of even close friends such as Max Brod, who usually supported him in everything else. Those performances also served as a starting point for his growing relationship with Judaism.
In 1912, at the home of his lifelong friend Max Brod, Kafka met Felice Bauer, who lived in Berlin and worked as a representative for a dictaphone company. Over the next five years they corresponded a great deal, met occasionally, and twice were engaged to be married. Their relationship finally ended in 1917.
In 1917, Kafka began to suffer from tuberculosis, which would require frequent convalescence during which he was supported by his family, most notably his sister Ottla. Despite his fear of being perceived as both physically and mentally repulsive, he impressed others with his boyish, neat, and austere good looks, a quiet and cool demeanor, obvious intelligence and dry sense of humor.
In the early 1920s he developed an intense relationship with Czech journalist and writer Milena Jesenská. In 1923, he briefly moved to Berlin in the hope of distancing himself from his family's influence to concentrate on his writing. In Berlin, he lived with Dora Diamant, a 25-year-old kindergarten teacher from an orthodox Jewish family, who was independent enough to have escaped her past in the ghetto. Dora became his lover, and influenced Kafka's interest in the Talmud.
It is generally agreed that Kafka suffered from clinical depression and social anxiety throughout his entire life. He also suffered from migraines, insomnia, constipation, boils, and other ailments, all usually brought on by excessive stresses and strains. He attempted to counteract all of this by a regimen of naturopathic treatments, such as a vegetarian diet. However, Kafka's tuberculosis worsened; he returned to Prague, then went to a sanatorium near Vienna for treatment, where he died on June 3, 1924. His body was ultimately brought back to Prague where he was interred on June 11, 1924, in the New Jewish Cemetery in Prague-Žižkov.