Use commas to separate items in a series, and use commas to separate certain kinds of
clauses.
In a series of three or more items, use a comma before the final and or
or to avoid potentially changing the meaning of the sentence. This comma is called a serial
comma or an Oxford comma. Recommended: Locations are divided into
zones, regions, and multi-regions. Not recommended: Locations are divided into
zones, regions and multi-regions. In general, place a comma after an introductory word or phrase. Recommended: Finally, only groups that
contain parameters appear in this list. Recommended: Based on the requirements of
your game, you can implement this method to update game information. When a coordinating conjunction (and, but, or,
nor, for, so, or yet) separates two independent
clauses, insert a comma after the first clause (before the conjunction) unless
both clauses are very short. Recommended: The libraries make
feed creation easier, and they ensure that only valid feeds are produced. Not recommended: The libraries make
feed creation easier and they ensure that only valid feeds are produced. Recommended: Type your ID and click OK. Not recommended: Type your ID, and click
OK. When an independent clause and a dependent clause are separated by a
coordinating conjunction, insert a comma only if the sentence could
be misunderstood without one. Recommended: Direct-access flags are
plain variables and can be read directly. Not recommended: Direct-access flags are
plain variables, and can be read directly. Recommended: The manager acknowledged the
last team member who entered the room, and started the meeting. Not recommended: The manager acknowledged
the last team member who entered the room and started the meeting. It's often a good idea to set off certain kinds of clauses with a comma or
other punctuation for clarity. A couple of specific places where commas are a good idea: In general, don't use a comma before the causal conjunction because unless it starts a nonrestrictive clause. For more information,
see the Chicago Manual of Style Q&A entry on
using
commas with because. For information about punctuating numbers, see Commas and decimal
points in numbers. For information about punctuating examples, see Format examples.Serial commas
Commas after introductory words and phrases
Commas separating two independent clauses
Commas separating independent from dependent clauses
Set off other kinds of clauses
Recommended
Not recommended
Name of the group, which has a maximum length of 200 characters.
Name of the group which has a maximum length of 200 characters.
The variable must have a value; otherwise, the server returns an error.
The variable must have a value otherwise the server returns an error.
You can use the same key name in multiple backend services and backend buckets, because
each set of keys is independent of the others.
You can use the same key name in multiple backend services and backend buckets because
each set of keys is independent of the others.
Punctuate numbers
Punctuate examples
Commas
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-05 UTC.
[null,null,["Last updated 2025-08-05 UTC."],[[["\u003cp\u003eUse the serial (or Oxford) comma in a list of three or more items to avoid ambiguity.\u003c/p\u003e\n"],["\u003cp\u003ePlace a comma after introductory words and phrases, and between independent clauses joined by a coordinating conjunction.\u003c/p\u003e\n"],["\u003cp\u003eUse a comma before \u003cem\u003ewhich\u003c/em\u003e in nonrestrictive clauses and after conjunctive adverbs like \u003cem\u003ehowever\u003c/em\u003e or \u003cem\u003etherefore\u003c/em\u003e.\u003c/p\u003e\n"],["\u003cp\u003eGenerally avoid a comma before \u003cem\u003ebecause\u003c/em\u003e unless it starts a nonrestrictive clause.\u003c/p\u003e\n"],["\u003cp\u003eRefer to specific sections for guidance on punctuating numbers and examples.\u003c/p\u003e\n"]]],["Commas are used in series, before the final *and* or *or* (serial comma). They follow introductory words/phrases and separate independent clauses joined by coordinating conjunctions, unless very short. Commas may clarify meaning between independent and dependent clauses. Commas should be used before *which* in nonrestrictive clauses. Punctuation, like semicolons or periods and commas, is needed around conjunctive adverbs. Usually, avoid a comma before *because* in restrictive clauses.\n"],null,["# Commas\n\nUse commas to separate items in a series, and use commas to separate certain kinds of\nclauses.\n\nSerial commas\n-------------\n\nIn a series of three or more items, use a comma before the final *and* or\n*or* to avoid potentially changing the meaning of the sentence. This comma is called a serial\ncomma or an Oxford comma.\n\nRecommended: Locations are divided into\nzones, regions, and multi-regions.\n\nNot recommended: Locations are divided into\nzones, regions and multi-regions.\n\nCommas after introductory words and phrases\n-------------------------------------------\n\nIn general, place a comma after an introductory word or phrase.\n\nRecommended: Finally, only groups that\ncontain parameters appear in this list.\n\nRecommended: Based on the requirements of\nyour game, you can implement this method to update game information.\n\nCommas separating two independent clauses\n-----------------------------------------\n\nWhen a coordinating conjunction (*and* , *but* , *or* ,\n*nor* , *for* , *so* , or *yet*) separates two independent\nclauses, insert a comma after the first clause (before the conjunction) unless\nboth clauses are very short.\n\nRecommended: The libraries make\nfeed creation easier, and they ensure that only valid feeds are produced.\n\nNot recommended: The libraries make\nfeed creation easier and they ensure that only valid feeds are produced.\n\nRecommended: Type your ID and click **OK**.\n\nNot recommended: Type your ID, and click\n**OK**.\n\nCommas separating independent from dependent clauses\n----------------------------------------------------\n\nWhen an independent clause and a dependent clause are separated by a\ncoordinating conjunction, insert a comma *only if* the sentence could\nbe misunderstood without one.\n\nRecommended: Direct-access flags are\nplain variables and can be read directly.\n\nNot recommended: Direct-access flags are\nplain variables, and can be read directly.\n\nRecommended: The manager acknowledged the\nlast team member who entered the room, and started the meeting.\n\nNot recommended: The manager acknowledged\nthe last team member who entered the room and started the meeting.\n\nSet off other kinds of clauses\n------------------------------\n\nIt's often a good idea to set off certain kinds of clauses with a comma or\nother punctuation for clarity.\n\nA couple of specific places where commas are a good idea:\n\n- In general, put a comma before the word *which* at the start of a nonrestrictive clause. For more information about this topic, see this guide's section on [relative pronouns](/style/pronouns#relative-pronouns) and Grammar Girl's page on [*which* versus *that*](https://www.quickanddirtytips.com/articles/which-versus-that/).\n- In general, put a semicolon or a period or a dash before a conjunctive adverb, such as *otherwise* , *however* , or *therefore*, and put a comma after the conjunctive adverb.\n\nIn general, don't use a comma before the causal conjunction *because* unless it starts a nonrestrictive clause. For more information,\nsee the *Chicago Manual of Style* Q\\&A entry on\n[using\ncommas with *because*](https://www.chicagomanualofstyle.org/qanda/data/faq/topics/Commas/faq0018.html).\n\n| Recommended | Not recommended |\n|----------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|\n| Name of the group, which has a maximum length of 200 characters. | Name of the group which has a maximum length of 200 characters. |\n| The variable must have a value; otherwise, the server returns an error. | The variable must have a value otherwise the server returns an error. |\n| You can use the same key name in multiple backend services and backend buckets, because each set of keys is independent of the others. | You can use the same key name in multiple backend services and backend buckets because each set of keys is independent of the others. |\n\nPunctuate numbers\n-----------------\n\nFor information about punctuating numbers, see [Commas and decimal\npoints in numbers](/style/numbers#commas-and-decimal-points-in-numbers).\n\nPunctuate examples\n------------------\n\nFor information about punctuating examples, see [Format examples](/style/format-examples)."]]