A grammatical gender is a property of a word, or more precisely of a noun and some other words. In many languages, each of these words, such as "woman", "house" or "man", belongs to such a group. Grammatical gender is also called "genus".
A grammatical gender is not the same as a biological gender. In biology, i.e. the study of living beings, we know male, female and neuter. These terms are also used in grammar, the study of language forms.
Sometimes the grammatical and biological gender coincide: One says "the man", "the woman". Often, however, things that have a gender in grammar do not have a gender in reality. For example, we say "the sun" and "the moon", although these celestial bodies are neither female nor male. Or one says "the person", even though this refers to a man.
The German language has three grammatical genders. In other languages there are more or less than three. Moreover, a word can have a different gender in one language than in another. In French, for example, it is "la lune" and "le soleil", meaning the moon and the sun.
In German and other languages, grammatical gender shows which words belong together in a sentence. A noun like "house" can be accompanied by a property word and an article: "a beautiful house". The grammatical gender of "house" determines which article to use and how the adjective ends.