Does a space go before or after a comma?
In English prose, put the comma next to the word it follows, then add a space before the next word. That works for a comma in a list or a comma after a short lead-in. Commas inside numbers do a different job. They can separate groups of digits without spaces.
What Harper flagged
Measured with Harper 3.3.0 on , on this page’s own sentences.
Rule CommaFixes
| Sentence | Words flagged | Harper’s message | First suggestion |
|---|---|---|---|
| We bought soap,rice, and tea. | , | Use a space after a comma. | Insert “ ” |
| At noon , we took the ferry. | Don't use a space before a comma. | Remove error | |
| She put the blue,green, and yellow cups on the shelf. | , | Use a space after a comma. | Insert “ ” |
| We bought soap, rice, and tea. | No flag from this rule | ||
| At noon, we took the ferry. | No flag from this rule | ||
| She put the blue, green, and yellow cups on the shelf. | No flag from this rule | ||
| The group raised $1,250 for the school trip. | No flag from this rule | ||
Why it happens
In the soap example, the space separates the name of one item from the next. Keeping the comma close to the first item helps you read the two parts.
In the ferry example, a comma marks the end of “at noon.” The word “we” starts the rest of the sentence.
Check it by hand
Check each comma by looking one character to either side. Before it, remove a stray space. After it, make room for the next word.
Questions people ask
Does a comma need a space before a closing quote?
No. A closing mark can sit directly next to the comma if the comma belongs inside the quote.
Is there a space in “1,250”?
No. In that number the comma divides the digits into groups.
Harper’s own description
Harper’s words under Apache-2.0Fix common comma errors such as no space after, erroneous space before, etc., Asian commas instead of English commas, etc.
More rules
Try it
Try a sentence in the free checker. Your text stays on the page.
Grammarnest is being built to check your writing in every app on your computer. Your writing will stay on your computer and will never be sent.
Sources
- Harper project and its Apache-2.0 licence
- Harper v3.3.0 release
- Run on . Full results