Semantics and pragmatics are both related to the way meaning is derived from language. Semantics studies the meaning that words and certain combinations of words hold for both the speaker and listener. Pragmatics deals with how the context in which words are used can dictate their true meaning at that particular time. Semantics and pragmatics are closely related as they both are attempts to understand the meaning of language beyond the literal definition of words.
Theories of semantics attempt to describe the meaning of words and how they can change in different situations. There is a denotation for every word that is its direct or literal meaning, but words can also have connotation, or implied meaning. Some words or phrases create a feeling that goes beyond literal meaning. For example, the phrase "sitting on a beach" has a simple literal meaning but might also conjure up thoughts of relaxation, warm sunshine, and happy memories of vacations for the listener. In this way, the meaning of the phrase is expanded and changed by the connotation that goes along with it.
Pragmatics is a way of looking at how communication goes beyond what is literally said. For instance, if someone speaks with a tone of sarcasm, the overall meaning that is communicated by what they are saying is completely different than what the words alone would mean. People often misunderstand words that are taken out of context. This too is a part of pragmatics, as the meaning that is communicated changes depending on the context in which it is used. Saying, "Way to go" to someone after they have completed a task has a positive meaning, while the same phrase said after someone drops and breaks something can be taken as patronizing.
It can be difficult to distinguish between semantics and pragmatics because they cover such similar concepts. Much communication takes place outside of what is literally spoken because connotation, context, and tone all play a part in how words are interpreted. Semantics and pragmatics are both attempts to understand how people process and use these functions of language as part of the overall communication process. Semantics and pragmatics work together to decipher the complex process of communication through language.