For more about commas see our Punctuation Overview page.
On occasions when a writer quotes the exact words that have been spoken we say that ‘direct speech’ has been used. Often, Information about who is speaking comes just before the direct speech.
When this happens a comma is used to indicate that the narrative is about to give way to the direct speech.
Jane said, “Hello.”
Note that the initial comma comes before the opening quotation mark and the full stop at the end of the quotation comes before the closing quotation mark. It is a pretty good rule of thumb that any punctuation associated with quotation marks are usually to the left of the inverted commas as you look at them on the page.
If the piece of direct speech comes before any information about who is speaking, then a comma is placed inside the quotation marks.
“You must be joking,” remarked George.
“Have a drink,” he said.
Again, the ‘punctuation to the left’ rule of thumb works.
If the direct speech is in the form of a question or an exclamation, then instead of a comma, a question mark or an exclamation mark is used.
“Go away!” she screamed.
“Do you have any change?” asked the bus conductor.
Often, a piece of direct speech is broken up by the information about who is speaking. In this case, a comma ends the first section of direct speech and is inserted before the second section of direct speech begins.
Note that our rule about keeping punctuation to the left of quotation marks still works here too …
“Don’t do that,” said dad, “you’ll get hurt.”
“Go quickly,” she said, “it will soon be dark.”