Fluent speakers of a language variety or lect have a set of internalized rules for using that form of speech. This rule set constitutes the lect's grammar. The vast majority of the information in the grammar is – at least in the case of one's native language – acquired not by conscious study or instruction but by hearing other speakers. Much of this work is done during early childhood; learning a language later in life usually involves a greater degree of explicit instruction. Thus, grammar is the cognitive information underlying language use.
The term "grammar" can also be used to describe the rules that govern the linguistic behavior of a group of speakers. For example, the term "English grammar" might have several meanings. It may refer to the whole of English grammar; that is, to the grammars of all the speakers of the language, in which case the term encompasses a great deal of variation. Alternatively, it may refer only to what is common to the grammars of all or of the vast majority of English speakers (such as subject–verb–object word order in simple declarative sentences). It may also refer to the rules of a particular, relatively well-defined variety of English (such as standard English for a region).
A description, study or analysis of such rules may also be referred to as a grammar. A reference book describing the grammar of a language is called a "reference grammar" or simply "a grammar" (see History of English grammars). A fully explicit grammar that exhaustively describes the grammatical constructions of a particular speech variety is called a descriptive grammar. This kind of linguistic description contrasts with linguistic prescription, an attempt to actively discourage or suppress some grammatical constructions, while codifying and promoting others, either in an absolute sense or in reference to a standard variety. Preposition stranding occurs widely in Germanic languages, has a long history in English and is generally considered standard usage. John Dryden (13 April 1668 – January 1688) objected to it (without explanation), leading other English speakers to avoid the construction and discourage its use.
Outside linguistics, the term grammar is often used in a rather different sense. It may be used more broadly to include rules of spelling and punctuation, which linguists would not typically consider to form part of grammar but rather as a part of orthography, the conventions used for writing a language. It may also be used more narrowly to refer to a set of prescriptive norms only, excluding those aspects of a language's grammar that are not subject to variation or debate on their normative acceptability. Jeremy Butterfield claimed that, for non-linguists, "Grammar is often a generic way of referring to any aspect of English that people object to."
The word grammar is derived from Greekγραμματικὴ τέχνη (grammatikē technē), which means "art of letters", from γράμμα (gramma), "letter", itself from γράφειν (graphein), "to draw, to write". The same Greek root also appears in graphics, grapheme, and photograph.