For more about commas see our Punctuation Overview page.
Commas can be used like brackets – to separate off a part of the sentence that is an ‘aside’ or comment and not really part of the main thrust of the sentence…
When in Spain, naturally, I enjoy the local cuisine.
Money, of course, does not grow on trees.
In these examples, the commas work in a similar way to those that are put round non-restrctive relative clauses (scary stuff!), which is simply to say that they separate off information that is not essential to the overall meaning of the sentences.
However there are occasions when the use of commas changes or clarifies what the writer intended, for example:
My brother, John, is a professional footballer.
The writer’s use of commas suggests that he only has one brother. The fact that this brother’s name is John is offered as an aside, a little extra,unnecessary information.
In the end the meaning of the sentence is not altered by the addition of the extra fact…
My brother is a professional footballer.
…conveys the same meaning.
However, if the sentence is written without the commas its meaning is somewhat different…
My brother John is a professional footballer.
The lack of commas suggests that the writer has more than one brother and that the one that is the professional footballer is John. Because ‘John’ is integral to the meaning, no commas are needed.
So, if you are unsure about whether or not you need these types of commas then try replacing them with a pair of brackets or just leaving out the information that is between them.
If the meaning of the sentence remains the same then the information inside the commas is an aside so you can keep the commas; if the meaning of the sentence changes then maybe no brackets or commas were needed…