Quotation marks

Commas and periods with quotation marks

Commas and periods go inside quotation marks, in the standard American style, despite it being inconsistent with the way things are done in code, and inconsistent with the standard British style.

Examples

British: See the section titled "Care and feeding of the emu".

American (and Google): See the section titled "Care and feeding of the emu."

Exception: When you put a keyword or other literal string in quotation marks, put any other punctuation outside the quotation marks. In those cases, the quotation marks indicate an exact literal string, so don't add anything extraneous inside the quotation marks. But in general, don't put quotation marks around an item that's in code font, unless the quotation marks are part of the item.

Examples

Not recommended: If you enter "foo," the program crashes.

Better: If you enter "foo", the program crashes.

Recommended: If you enter foo, the program crashes.

Single quotation marks

The only times to use single quotation marks in our documentation are the following:

  • In code examples, in languages that use single quotation marks.
  • When nesting a quotation inside another quotation.

In the latter case, put the primary speaker's quote in double quotation marks and the quote inside the primary speaker's quote in single quotation marks, in the standard American style. (This is opposite to the standard British style.)

Examples

British: She said, 'I heard him shout "Help", and saw him floundering in the water.'

American (and Google): She said, "I heard him shout 'Help,' and saw him floundering in the water."

Send feedback about...

Google Developer Documentation Style Guide
Google Developer Documentation Style Guide