Do you know how to use the Oxford comma?

Last updated by Lee Hawkins [SSW] over 1 year ago.See history

The "Oxford comma" (so-called because the Oxford University Press style guidelines require it) has the distinction of being one of the most hotly debated elements of the English language.

oxford comma debate
Figure: Some people love Oxford commas, some hate them

Knowing when to use the Oxford comma helps to create more consistent and easier to read documentation.

Also referred to as a series comma or serial comma, an Oxford comma is placed in a series of three or more items before the conjunction. It can be used in both "and" and "or" lists as the last comma separating a series of items. It works to help order these items and provide a distinction between the items on the list, particularly the last two items. An Oxford comma is often unnecessary, though.

oxford comma
Figure: A sentence with quite different meaning depending on whether an Oxford comma is used or not

The rule is that a comma should only be used between the last two items of a list if it removes potential ambiguity, otherwise no comma is required.

Let's look at some examples to illustrate the rule in action.

Adam, Matt, and Lee got on a call to discuss the use of the Oxford comma

Figure: Bad example - the extra comma after "Matt" is unnecessary and just adds clutter

The ice cream comes in an assortment of flavours including banana and strawberry, strawberry and mango, and blueberry.

Figure: Good example - without the Oxford comma, it's not clear whether the flavour is strawberry and mango or mango and blueberry

This short TED Ed talk covers the topic well.

We open source. Powered by GitHub