The smallest unit in written language
capable of causing a contrast in meaning. In English
they are letters
and punctuation marks
Often A, a and a are all considered the same grapheme, as all are recognized as having the same meaning when put into like contexts. (Cat, CAt, and Cat all have the same meaning). They are allographs.
Other languages (Chinese for example) use logograms. These symbols are both graphemes and morphemes.
The counterpart used in speech is a phoneme.