Syntax is the arrangement of words, phrases, symbols, or code elements according to rules that define valid structure. In language and computing, syntax shapes how expressions are formed and can affect interpretation, execution, or meaning.