A paradoxical "riddle" or "puzzle" used in Zen to shock the mind into awareness.
The kanji for "koan" (公案) is an abbreviation for "ko-fu no an-toku". In ancient China, this was a signpost on which new laws were announced to the public. In much the same sense, a koan states a realized principle, or law of reality.
Koans are used almost exclusevly in Ch'an (Chinese) and Zen (Japanese) schools of Buddhism. There are compilations and commentary written with respect to koan. Two notable collections of koan are the Gateless Gate and the Blue Cliff Record.
In Ch'an and Zen schools koans are given to students with respect to difficulty and ability of the student to "break through" and directly perceive reality with the "wisdom eye", which is the foundation of the Ch'an school.
Not all koans actually have an "answer" or "explanation", which can be frustrating to people who are used to looking for them. Instead, they sometimes are intended only to prompt you to ask the right questions, or to question your previous assumptions.
Not to be confused with random nonsense or "cleverness".