The set of rules that govern how words are put together to form sentences in a language
Examples:
The teacher explained the basic rules of grammar to the class.Grammar is the set of rules that govern how words are used.She studied grammar extensively to improve her writing skills.
Synonyms:
Antonyms:
Syntax
The arrangement of words and phrases to create well-formed sentences in a language.
Examples:
The syntax of the programming language was elegant.Syntax rules differ between spoken and written forms.He struggled to grasp the syntax of ancient texts.
Synonyms:
Antonyms:
Ways to tell them apart:
Syntax refers to the arrangement of words and phrases to create well-formed sentences.
Syntax is more about the structure of language as a whole rather than the correctness of individual forms.
Grammar deals with the rules that determine how sentences are constructed, specifically concerning word forms and their relationships with one another.
Grammar can be seen as a broader concept which includes syntax as one of its components.
While syntax focuses on the formal arrangement of words, grammar includes syntax as well as morphology, which concerns word forms and inflections.