Sanity considered as a legal term denotes that an individual is of sound mind and therefore can bear legalresponsibility for his or her actions. It is generally defined in terms of the absence of insanity. It is not a medical term, although the opinions of medical experts are often important in making a legal decision as to whether someone is sane or insane. It is also not the same concept as mental illness. One can be acting under profound mental illness
and yet be sane, and one can also be ruled insane without an underlying mental illness.

Sanity outside of legal definitions has been little explored by science and medicine, as the concentration has been on illness. Dr. P.S. Graven suggested the term "un-sane" to describe a condition that is not exactly insane, but not quite sane either.

A theory of sanity was proposed by Alfred Korzybski in his general semantics. Basically he believed that sanity was tied to the structural fit or lack of it between our reactions to the world and what is actually going on in the world. He expressed this notion in a map-territory analogy: "A map is not the territory it represents, but, if correct, it has a similar structure to the territory, which accounts for its usefulness." Given that science continually seeks to adjust its theories structurally to fit the facts, i.e., adjusts its maps to fit the territory, and thus advances more rapidly than any other field, he believed that the key to understanding sanity would be found in the study of the methods of science (and the study of structure as revealed by science). The adoption of a scientific outlook and attitude of continual adjustment by the individual toward his or her assumptions was the way, so he claimed. In other words, there were "factors of sanity to be found in the physico-mathematical methods of science."