Unlike many solemn thinkers, Kierkegaard saw philosophic significance in humor and its closely related irony. Irony for Kierkegaard is the expression of the gap in the attempt to attain the moral or religious ideal. In his discussion of his three spheres of existence (the aesthetic, ethical and religious faith). Irony in Kierkegaard's stands at the boundary between the ethical and the religious. Humor is the result of moving into the religious sphere since “Humor is the last stage of existential awareness before faith” (Kierkegaard, Concluding Unscientific Postscript). The person who has (Christian) faith is likely to develop a humorous approach to life. This is because humor (and irony) have a favorable attitude towards the contradictions of existence. In addition, humor and irony themselves express the accepted tension and contradiction between earthly aesthetic or ethical and divine religious faith.
Kierkegaard ties humor with what he calls "the comic" which lies in the gap between what is expected and what actually happens (similar to Schopenhauer). Kierkegaard calls this gap a contradiction which violates expectations (like the tragic, on the other hand, with the difference being that the tragic causes suffering while the comic is painless). This is why humor goes along with faith, since humor is the ability to painlessly bear contradiction.
Finally, Kierkegaard distinguished romantic irony from Socratic irony. Romantic irony is negative in emptying the ironic subject from all content and meaning, thus bringing him to terminal desperation (think of Goethe's Werther, for example). On the other hand, for Kierkegaard Socratic irony longingly seeks to attain divine apprehension and is therefore the doorway to the truth that lies in faith.