punct-001 should GuidesAPI docsMarketingBlog Use the Oxford (serial) comma before the final conjunction in a list of three or more items.
These rules cover the punctuation marks that come up most in developer docs — commas, colons and semicolons, dashes and hyphens, quotation marks, ellipses, and slashes — plus the spacing and font styling around them. Two hyphenation exceptions for compound modifiers (-ly adverbs and predicate position) live on the compound modifiers page.
punct-001 should GuidesAPI docsMarketingBlog Use the Oxford (serial) comma before the final conjunction in a list of three or more items.
Examples
Rationale
The final comma keeps the last two items distinct, preventing a reading where they merge into one.
punct-018 should GuidesAPI docsMarketingBlog Use one space, not two, after a period.
Examples
Rationale
One space after a period is the current typesetting standard; two is a typewriter holdover.
punct-009 should GuidesAPI docsMarketingBlog The introductory phrase before a colon that introduces a list must be a grammatically complete sentence.
Examples
punct-014 should GuidesAPI docsMarketingBlog Use semicolons sparingly; prefer breaking sentences into shorter ones or converting to lists, but permit semicolons between closely related independent clauses and in complex series with internal punctuation.
Examples
Rationale
Semicolons join dense clauses that a reader often parses more easily as separate sentences or a list.
punct-002 should GuidesAPI docsMarketingBlog Use em dashes without spaces on either side to set off parenthetical phrases or interruptions.
Examples
punct-003 should GuidesAPI docsMarketingBlog Do not use a hyphen or double hyphen in place of an em dash.
Examples
punct-010 should GuidesAPI docsMarketingBlog Do not use en dashes; use a hyphen or the word ‘to’ for number ranges.
Examples
Rationale
En dashes are easy to confuse with hyphens and minus signs and are hard to type, so a hyphen or “to” is clearer for ranges.
punct-023 should GuidesAPI docsMarketingBlog Do not place spaces on either side of a hyphen, except in suspended hyphens where a space may follow (but not precede) the hyphen.
Examples
punct-004 should GuidesAPI docsMarketingBlog When two or more words together modify a noun, hyphenate them (a 30-second timeout, a high-priority task). Don’t hyphenate when the unit is an abbreviation or symbol (a 16 GB drive) or when the compound follows the noun in predicative position.
Examples
Rationale
A hyphen signals that two or more words act as a single modifier, so “a 30-second timeout” reads as one idea rather than separate words. Abbreviated units already read as a unit and take no hyphen (“a 16 GB drive”), and the hyphen is unneeded after the noun.
punct-020 should GuidesAPI docsMarketingBlog Hyphenate a compound modifier when its unit is spelled out (a 5-foot cable), but not when the unit is an abbreviation or symbol (a 5 ft cable).
Examples
Rationale
The hyphen marks a spelled-out unit as part of a single modifier (“a 5-foot cable”), while an abbreviation already reads as a unit and needs none (“a 5 ft cable”).
punct-021 should GuidesAPI docsMarketingBlog Hyphenate location compounds such as ‘lower-left corner’ and ‘top-right portion’.
Examples
Rationale
“Lower-left” acts as a single modifier, so the hyphen keeps it reading as one direction.
punct-005 should GuidesAPI docsMarketingBlog Write prefixed words as a single closed-up word when the closed form is established usage (email, runtime, subdomain, nonprofit). Use a hyphen when the prefix is cross-, self-, all-, or ex-; when the base word is a proper noun; when the closed form is ambiguous, hard to read, or a different word; or when the compound isn’t well established yet. When in doubt, check the word list.
Examples
Rationale
Established prefixed words read as single words (“email”, “runtime”, “subdomain”), so closing them up matches how developers already write them. A hyphen stays where the closed form is ambiguous, hard to read, or a different word, or where the prefix is cross-, self-, all-, or ex-.
punct-024 should GuidesAPI docsMarketingBlog Prefer the closed (one-word) form for compound nouns unless a hyphenated or open form is established by convention or the word list.
Examples
Rationale
Established compounds read as one word, so closing them up matches convention; the word list settles contested cases.
punct-006 should GuidesAPI docsMarketingBlog Use straight quotation marks in code samples and code font regardless of the convention used in body text.
Examples
print("Hello")print(“Hello”)Rationale
Straight quotes in code are what compilers and shells expect; a curly quote copied from docs breaks the code.
punct-007 should GuidesAPI docsMarketingBlog Place periods and commas inside closing quotation marks in body text.
Examples
punct-008 should GuidesAPI docsMarketingBlog When a literal string or keyword is in quotation marks, place any surrounding punctuation outside the quotation marks.
Examples
Rationale
Keeping punctuation outside a quoted literal prevents a reader from thinking the period is part of the value.
punct-022 should GuidesAPI docsMarketingBlog Do not use single quotation marks in body text except when nesting a quotation inside another quotation or in code examples that require them.
Examples
Rationale
Single quotes in body text are easily confused with apostrophes, so double quotes are unambiguous, with single quotes reserved for nesting and code.
punct-011 should GuidesAPI docsMarketingBlog Avoid ellipses in technical documentation; use them only in quoted text to indicate omitted material, and do not use them at the beginning or end of a quotation.
Examples
Rationale
Ellipses are vague in technical writing, so they belong only in quotations to mark omitted text.
punct-012 should GuidesAPI docsMarketingBlog When an ellipsis appears in UI, do not reproduce it in instructions describing that UI element.
Examples
Rationale
The ellipsis on a UI label is not part of the label’s name, so instructions omit it.
punct-013 should GuidesAPI docsMarketingBlog In quoted material, insert one space before and after an ellipsis that replaces text within a sentence.
Examples
punct-015 should GuidesAPI docsMarketingBlog Do not use slashes as a substitute for ‘or’ in body text; write out ‘or’ or ‘and’ instead.
Examples
Rationale
A slash between words is ambiguous about whether it means and, or, or a ratio, while the word is clear.
punct-016 should GuidesAPI docsMarketingBlog Do not use slashes in date formats; use a dedicated date format instead.
Examples
Rationale
Slash dates are region-ambiguous, while a dedicated date format is not.
punct-025 should GuidesAPI docsMarketingBlog Do not use abbreviations that rely on slashes (c/o, w/); spell the words out.
Examples
Rationale
Slash abbreviations like “w/” are informal and easy to miss, so spelling them out is clear.
punct-017 should GuidesAPI docsMarketingBlog Use exclamation points sparingly; avoid them in concept and reference documentation; they are acceptable in tutorials to mark major milestones and in code when required by syntax.
Examples
Rationale
Exclamation points read as hype in reference material, so reserving them keeps their emphasis meaningful.
punct-026 should GuidesAPI docsMarketingBlog Avoid placing important information in parentheses; consider whether parentheses are necessary and whether commas, dashes, or separate sentences would serve better.
Examples
Rationale
Parentheses signal that content is skippable, so important information hidden there may be missed.
punct-019 should GuidesAPI docsMarketingBlog Format punctuation in the same font style as the surrounding body text, not the style of the element it follows, unless the punctuation is part of what the user must type or is part of the element itself.
Examples
timeout, then restart the service.timeout, then restart the service.Rationale
Punctuation styled like the code element beside it looks like part of that element, so matching the surrounding text keeps it clearly punctuation.
punct-027 should GuidesAPI docsMarketingBlog Hyphenate z- prefixed terms such as z-index, z-order, and z-axis rather than closing them up.
Examples
z-index so the modal stacks above the toolbar.zindex so the modal stacks above the toolbar.Rationale
The single-letter z- prefix reads as part of the following word when closed up, so the hyphen keeps the term legible and matches its conventional form.