In Japanese, the word baka means "idiot," "fool," or "dimwit"; it can also refer to the condition of being stupid. The word is widely used in conversation and, while derogatory, is not taboo. It is more common in Tokyo and other parts of eastern Japan; in Osaka and elsewhere in western Japan, the usual equivalent is aho.
When used as an adjective in Japanese, baka (na) can mean "absurd" or "crazy" in addition to "idiotic."
Baka is written with the Chinese characters 馬鹿, which literally mean "horse-deer". The word may come from a story mentioned in Records of the Grand Historian, a 1st century BC historical book from China, written by Sima Qian. The story is about how Zhao Gao, who conspired a coup d'etat, tested his servants' loyalty. He referred to his deer offering to Emperor Qin Er Shi as a horse. Some followed suit and called it a horse, while others called it a deer. Zhao Gao had those who disagreed with him executed.
A related idiom is Shika o sashite uma to nasu. (Point at a deer and call it a horse. 指鹿為馬/指鹿为马) which comes from the same story. It means to push one's agendas using one's authority, despite having contradictions; also, to make fun of others.
Another Japanese idiom is, "Demo baka wa shinanakya naoranai." (However, only death can cure a fool.)
Another theory states that the word baka was first used by Buddhist monks, and the word originated from a Sanskrit word moha. This theory states that the Chinese characters were merely a transcription.