The action takes place at the beginning of the XX century (in the years immediately preceding the First World War) in Switzerland, in the located near Davos tuberculous sanatorium.
The protagonist, a young German Hans Castorp, comes from Hamburg to "Berggof" sanatorium to visit his cousin Joachim Ziemssem. Hans Castorp intends to spend in the resort no more than three weeks, but by the end of the planned period he feels himself not very well. As a result of the medical examination signs of tuberculosis have been revealed, and at the insistence of the chief doctor Behrens, Hans Castorp stays in the sanatorium for a longer period. Ever since the arrival Hans Castorp finds that time in the mountains flows not like on the plain, and therefore it is virtually impossible to determine how many days, weeks, months, years passed between the described the events and the time covers the action of the novel. At the very end of the novel, however, it is said that Hans Castorp spent in a sanatorium seven years, but even this figure can be seen as a certain artistic convention.
Strictly speaking, the story and events happening in the novel are not important for an understanding of its meaning. They are just an excuse to oppose the different life positions of the characters and give the author the opportunity to express their mouths for many exciting challenges: life, death and love, sickness and health, progress and conservatism, the fate of human civilization on the threshold of the XX century. There are few dozens of characters in the novel - mostly patients, doctors and support staff of the sanatorium: someone recovers and leaves "Berggof" someone dies, but in their place constantly come new.
Among those with whom Hans Castorp gets acquainted with in the first days of his stay in a sanatorium, a special place is occupied by Mr. Ludovico Settembrini - a descendant of the Carbonari, a mason, humanist and a staunch supporter of progress. At the same time, like a true Italian, he passionately hates Austro-Hungary. His unusual, sometimes paradoxical ideas expressed also in a bright, often sarcastic form, have a tremendous impact on the mind of a young man who begins to consider Mr. Settembrini a mentor.
An important role in the history of the life of Hans Castorp plays his love o the Russian patient Madame Clavdia Chauchat - love, which he opposed with all forces because of virtue obtained by of his upbringing in a strict Calvinist family. It takes many months before Hans Castorp speaks with his lover - this happens during the carnival before Lent and Clavdia’s departure from the sanatorium.
During the time spent in a sanatorium Hans Castorp seriously became interested in a variety of philosophical and natural scientific ideas. He attended lectures on psychoanalysis, seriously studies medical literature, got interested in issues of life and death, studied contemporary music, using for his own purposes the latest advances in technology - gramophone recording. In fact, he no longer thinks of his life on the plains, he forgets that his work is waiting for him, almost broke ties with his few relatives and begins to see life in a sanatorium as the only possible form of existence.
With his cousin Joachim situation is just the opposite. He has been persistently preparing himself for a career of the military, and therefore considers every extra month spent in the mountains, as an annoying obstacle on the way of his dreams. At some point, he does not stand up and, ignoring the warnings of doctors, leaves the sanatorium, enters the military service and receives a commission. However, very little time passes, and his illness aggravates, so he is forced to return to the mountains, but this time the treatment does not help him and he soon dies.
Shortly before that, in the circle of friends of Hans Castorp gets a new character - a Jesuit Naphtha, eternal and unchanging Mr. Settembrini’s opponent. Naphta idealizes the medieval past of Europe, condemns the very notion of progress and all embodied in this concept modern bourgeois civilization. Hans Castorp is in some disarray - listening to the many disputes of Settembrini and Napha, he agrees sometimes with the one, then with another, then he finds contradictions, so he no longer knows who is right. However, the impact of Settembrini oo Hans Castorp is so great, and the innate distrust of the Jesuits so high that he is entirely on the side of the first.
Meanwhile to the resort comes back for a while Madame Chauchat, not alone, but accompanied by her new friend - a wealthy Dutchman Peperkorna. Almost all the inhabitants of "Berggof" fall under the influence of this magnetic, definitely strong, mysterious, if somewhat tongue-tied, individual, Hans Castorp feels some kind of a kinship with him, because they share a love for the same woman. Once incurably ill Peperkorn arranges a walk to the waterfall, in every way entertains his companions, in the evening he with Hans Castorp drink brotherhood and pass on "you", despite the difference in age, and at night Peperkorn takes poison and dies. Soon Madame Chauchat leaves the resort - and this time perhaps forever.
From a certain point some anxiety starts to grow in the souls of the inhabitants of "Berggof". This coincides with the arrival of a new patient - Danish Ally Brand, who has some supernatural powers, in particular knows how to read minds at a distance and call the spirits. Patients get addicted to spiritualism, arrange sessions. This involves Hans Castorp, despite the stinging taunts and warnings from his mentor Settembrini. It was after these sessions, and perhaps as a result of them, that their former measured passage of time in a sanatorium got violated. Patients quarrel and then there are conflicts in the most trifling occasion.
During one of the dispute Settembrini declares to Naphta that the last with his ideas corrupts the youth. Verbal altercation leads to mutual insults, and then to a duel. Settembrini refuses to shoot, and then Naphta shot himself in the head.
And then a thunder of the World War clapped. Residents are beginning to disperse to their homes. Hans Castorp also leaves for the plain, addressed by Mr. Settembrini with words of encouragement to fight where are the close to him by blood, though Mr. Settembrini himself in this war is going to support another side.
In the final scene Hans Castorp is depicted running, crawling, falling with the same as he is, with young men in soldiers' uniforms, trapped in the meat grinder of the World War I. The author deliberately says nothing about the further fate of his hero - a story about him is over, and his life is interested only as a backdrop for the story. However, as noted in the last paragraph, Hans Castorp’s hopes to survive are not very promising.