The place that books are most alive and forage the most direct connection with readers. It is also where we as writers discover our characters and allow them to become real. — Laini Taylor, author of Daughter of Smoke and Bone
Dialogue is an important part of a fiction author's tool kit. It is a great way to get to know characters, give information to readers (without it feeling like an info dump), break up long sections of prose, and make a story more believable. Knowing the conventions of how to punctuate dialogue means that the focus is on what your characters are saying, not the mechanics of writing. Writing good dialogue is hard, but punctuating it doesn't have to be.
Dialogue is anything that is spoken by a character. It is usually signalled by quotation marks and is often followed by attributive text so the reader knows who is speaking.
"Who goes there?" she said.
"It's just me." I rolled my eyes.
Note: In North American English, double quotation marks are the standard. In British English, single quotation marks are the standard. The important thing is consistency.
For dialogue that is speech adjacent (such as thoughts and telepathy), the text is usually presented without quotation marks and set in italics.
I wonder who that was, he thought.
There are two types of text that can follow dialogue: dialogue tags and action beats. How dialogue is punctuated depends on what kind of text follows it. It is also possible for dialogue to stand on its own without associated text, in which case the dialogue is punctuated like any sentence; it is just contained within quotation marks.
"Tomorrow, we duel!"
Punctuation that follows dialogue is always placed inside quotation marks, never outside.
Note: This is specific to dialogue. Quotations are handled differently.
Dialogue tags tell the reader who is speaking and how they are speaking. They are made up of two parts: a speech verb and a subject. The most common speech verb is said. Said is so common that it almost disappears, making for a seamless read. Other speech verbs should be used sparingly as they can pull the reader out of the story. The subject is whoever (or whatever) is speaking. This can be a noun or a pronoun.
It is important to make sure that the verb is a speech verb. Speech verbs include:
said, answered, called, shouted, yelled, babbled, exclaimed
Note: Speak is not a speech verb.
If words cannot be formed while doing the action, then it is an action beat, not a dialogue tag. Commonly misused non-speech verbs include:
scoffed, laughed, giggled, snorted, smiled, gasped, sneered
If you are unsure if a verb is a speech verb, try to speak while completing the action. If it can't be done, you have an action beat, not a dialogue tag.
Punctuating Dialogue Tags
The dialogue tag and the dialogue combine to create a single sentence. They are connected with a comma.
"Don't go in there," she said.
She said, "Don't go in there."
The first word of the dialogue is always capitalized (unless it is a word that is never capitalized such as iPod). The dialogue tag is capitalized at the beginning of the sentence but not if it follows the dialogue (unless it starts with a proper noun). If the sentence ends with the dialogue tag, it always ends with a period. If the sentence ends with the dialogue, then the terminal punctuation can also be an exclamation point or a question mark.
She said, "Don't go in there!"
Sue asked, "Why not?"
Question marks and exclamation points can replace the comma when followed by a dialogue tag.
"Don't go in there!" she said.
"Why not?" Jerry asked.
An action beat is a line of text that follows, precedes or interrupts dialogue describing what a character is doing either before, after or during their speech. It does not describe the dialogue. Unlike dialogue tags, action beats are a separate sentence from the dialogue.
Punctuating Action Beats
Because an action beat is a separate sentence from the dialogue it precedes or follows, both the dialogue and the action beat capitalize the first letter and end with terminal punctuation.
"I've got you." She reached out her hand.
She reached out her hand. "I've got you."
Because both parts form a complete sentence, they are punctuated independently of each other. Therefore, the punctuation is not dependent on the position.
When a complete sentence of dialogue is interrupted by a dialogue tag, there is a comma on either side.
"Why," she said, "would I ever leave you?"
However, when the tag is inserted at the end of a complete sentence of dialogue, even if the dialogue continues past the tag, then the first piece of dialogue is treated independently from the second, with the terminal punctuation coming after the tag and the second piece of dialogue existing as its own sentence.
"Don't go in there," they said. "It smells like something died."
When an action beat interrupts dialogue, punctuation depends on the timing of the action and the dialogue. There are two kinds of interrupting action beats. In the first, the dialogue and the action happen one after the other. In the second, the action and dialogue happen at the same time. In most cases, the first interrupts two complete sentences of dialogue, while the second interrupts the dialogue mid-sentence. But there is some wiggle room depending on if the dialogue and action are simultaneous or not.
"I've got you." She reached out her hand. "Don't give up."
Here, the character speaks, reaches out her hand, and speaks again. Each piece is its own, complete sentence.
"I'm sorry"—she looked away as tears filled her eyes—"I didn't get to know him better."
Here, the character says "I'm sorry" and then looks away at the same time she says "I didn't get to know him better."
Note: The convention in North America is to use a closed-up em dash (—) (as seen above), but in Britain, you are more likely to see a spaced en dash ( - ). Either is fine as long as you are consistent.
There usually is no punctuation before the quotation mark. The exception is for something like an ellipsis that shows a pause before the action beat.
"I'm sorry..."—she looked away as tears filled her eyes—"I didn't get to know him better."
Note: The interrupting action beat is lowercase (unless it's a proper noun) since it is interrupting the dialogue in the middle of the sentence. It is therefore part of the same sentence.
Dialogue is an important part of fiction. Punctuating it properly means that the reader can focus on the words being said and the actions that accompany them. The correct punctuation also gives the reader subtle hints on how to interpret the text, leaving no doubt as to what is speech, what is action and what is happening when. Mastering these rules means that the reader will be sucked into the narrative as the mechanical process of writing disappears and all that's left is the story.