---
title: "freeCodeCamp's Writing Style Guide"
---

> Documentation Index
> Fetch the complete documentation index at: https://contribute.freecodecamp.org/llms.txt
> Use this file to discover all available pages before exploring further.

# freeCodeCamp's Writing Style Guide

This guide covers punctuation, hyphenation, and title capitalization, including punctuation in sentences with backticks, quotes, or ellipses. Use this in addition to the [Formatting challenge text](/how-to-work-on-coding-challenges/#formatting-challenge-text) guidelines.

---

## 1. Do Not Alter Backticked Content Regardless of Where It Is in the Sentence

Before adding punctuation, check the content inside the backticks.

- If it **already contains punctuation**, keep it exactly as written.
- If it **does not**, do **not** add punctuation inside.

**Examples**

- \`Does this work?\` → keep the `?`
- \`assigning tasks ...\` → keep the ellipses
- \`assigning tasks\` → leave as-is

---

## 2. Periods and Commas

### Backticks

Periods and commas go **outside** the backticks unless the backticked content already ends with the punctuation needed by the surrounding sentence. Punctuation elsewhere inside the backticks does not replace punctuation outside them.

**Correct**
- The file is `index.html`.
- Run `npm install`, then restart.
- She paused at `assigning tasks ...`, unsure what to say next.
- `I reviewed the requirements. Next, I shared my thoughts with the team.`

**Incorrect**
- It's usually the direct answer to the question `¿De dónde eres?`.
- `I reviewed the requirements. Next, I shared my thoughts with the team.`.

:::note[Exception]
If the final dot is part of the code or domain syntax rather than sentence-ending punctuation, add a period outside the backticks.

Other examples of subdomains include `blog.`, `shop.`, `support.`, and `api.`.
:::

<br />

If the quoted or backticked text ends with a comma, do not add a duplicate comma immediately after.

**Incorrect**
- If the sentence starts with "She said,", or "He said,", expect it to be classified as hearsay.

**Correct**
- If the sentence starts with "She said," or "He said," expect it to be classified as hearsay.

<br />

Do not add a duplicate period if an ellipsis is quoted or backticked at the end of the sentence. (Exceptions below in the section for question marks and exclamation marks)

**Correct**
- Focus on the sentence that starts with `One important task is ...`
- `Me llamo ...` means "My name is ..."

**Incorrect**
- Focus on the sentence that starts with `One important task is ...`.

<br />

Do not add a period at the end of a sentence if the final quoted or backticked phrase already ends with sentence-ending punctuation, such as a period, question mark, or exclamation mark.

**Correct**
- This question is equivalent to "How old are you?"

**Incorrect**
- Ángela is asking Sebastián `¿Cuántos años tienes?`.

### Double Quotes

Periods and commas go **inside** the double quotes when their presence coincides grammatically with the requirements of the sentence. Different rules apply to exclamation marks and question marks, see below.

**Correct**
- The error says "File not found."
- She whispered, "I'm not sure ...," then walked away.

### Oxford Comma

Use a comma before the conjunction in a list of three or more items.

**Correct**
- Save your file on your computer, on Google Drive, or to a Gist.

### Commas Before Dialogue

Use a comma before a direct quotation (or backticked quotation) of only a few words following an introductory phrase.

**Correct**
- She's using a simple and very common phrase to say, "Hi, good morning!"
- Sebastián is asking Ángela, `¿A qué te dedicas?`

### Trailing Whitespace

Do not add a space after the last punctuation mark in a standalone paragraph or sentence.
(A diff will show the additional space and should be removed)

---

## 3. Question Marks and Exclamation Marks

### A. Only the backticked/quoted text is a question

- Keep the `?` or `!` **inside** (if they are already there).
- Do **not** add a duplicate.

<br />

**Correct**
- She asked, `Does this work?`
- She asked, "Does this work?"
- He shouted, "Let me go!"

**Incorrect**
- She asked, `Does this work?`?
- He said, "how come"?

---

### B. Only the sentence is a question

- The `?` goes **outside**.

  **Correct**
  - What does she mean by `assigning tasks`?
  - What does she mean by "assigning tasks"?

  **Examples With Ellipses**
  - What does she mean by `assigning tasks ...`?
  - What does she mean by "assigning tasks ..."?

---

### C. Both the sentence AND the backticked/quoted text are questions

#### If the content already has a question mark

Use **only one**, placed **inside**.

**Correct**
- What does Tom mean when he asks, `Does Maria assign tasks?`
- What does Tom mean when he asks, "Does Maria assign tasks?"

#### If the content does _not_ have a question mark

The sentence's `?` goes **outside**.

**Correct**
- What does Tom mean when he asks, `Does Maria assign tasks ...`?
- What does Tom mean when he asks, "Does Maria assign tasks ..."?

---

## 4. Exclamation Points

Follow the same logic as question marks.

- If the content includes `!` → keep it inside.
- If only the sentence is exclamatory → `!` goes outside.
- If both are exclamations and the content has `!` → do not add another.

---

## 5. Ellipses

Write ellipses as three consecutive periods (`...`), without spaces between the dots. If they are quoted or back-ticked and come at the end of the sentence, do not add additional periods after them.

**Correct**
- What does Tom mean when he asks, `Does Maria assign tasks ...`?
- You should include the paragraph that starts with `A miracle ...`

---

## 6. Quoted Text and Backticked Text

Separate long quotes from the preceding paragraph with a blank line. This keeps the quoted or backticked text visually discernable and helps the learner easily copy it for pasting into the editor.

```
**Example**

Within your `.image-quote` element, nest an `hr` element, a `p` element, and a second `hr` element. Give the `p` element a class set to `quote` and the text:

`The millions of people who are learning to code through freeCodeCamp will have an even better resource to help them learn these fundamentals.`
```

Use a comma after a reporting phrase that introduces dialogue. Omit it when a short quotation fits directly into the sentence, as in `Ask "What's your name?"`.

```
**Example**

She's using a simple and very common phrase to say, "Hi, good morning!"
```

---

## 7. Colons (vs. Commas vs. None)

In some cases, when quoting or presenting backticked text in a sentence, it is up to the author's judgement to decide whether to separate the quoted text from the preceding sentence with a colon or a comma or nothing at all. However, we can try to follow some rules of thumb when deciding between these.

- Use a colon if the quoted text illustrates something in the preceding text. The part before the colon must be a complete sentence.

  ```
  **Correct**

  - Your `console` statement should output the message: `Here is an example of accessing the second letter in the word [subject].`

  - The expected output is the following: "Success."

  **Incorrect**

  - The question is: `¿De dónde eres?`

  The colon separates the verb `is` from its complement; `The question is` is not a complete sentence.

  ```

:::note
Although in the above example, it would be better if we said: Your console statement should output the _following_ message:
:::

- Use a colon to introduce a quotation after a complete introductory sentence.

  ```
  **Correct**

  - Sebastián asks the following question: `¿A qué te dedicas?`

  **Incorrect**

  - Sebastián's question is: `¿A qué te dedicas?`

  The colon separates the verb `is` from its complement.

  ```

- Use a comma before quoted text if the sentence prior is acting as a reporting phrase. A reporting phrase 'reports' what the person said.

  ```
  **Correct**

  - Sebastián is asking Ángela, `¿A qué te dedicas?`

  - To figure out if the app is working now, look at the last part of James' explanation where he says, `I fixed...`

  **Incorrect**

  - Focus on the sentence starting with, `We hadn't updated...`

  ```

- Use a comma before a quotation that adds nonessential detail identifying a previously mentioned question or statement.

  ```
  **Correct**

  - The correct answer should provide information that directly responds to Bob's question, `What do we have to deal with now?`

  - Which sentence best follows Brian's statement, `We touch on it, but perhaps not in enough detail.`?

  ```

- Use nothing if the sentence preceding and the quoted text are both short and/or if the quote flows from the sentence.

  ```
  **Example**

  - Ask "What's your name?"

  - Which option means "I'm Chinese. I'm a developer."?

  ```

---

## 8. Hyphenated Compound Words

When referring to front-end, back-end or full-stack, use the hyphenated form.

```
**Incorrect**
- Front End Libraries

**Correct**
- Front-End Libraries

```

---

## 9. Title Case

Use title case for titles and headings. Capitalize the first and last word and follow these rules for the other words:

- Capitalize nouns, pronouns, verbs, adjectives, and adverbs, subject to the exceptions below. This includes short verbs such as **Is**, **Are**, **Be**, and **Do**.
- Lowercase articles: **a**, **an**, and **the**.
- Lowercase coordinating conjunctions: **and**, **but**, **or**, **nor**, **for**, **so**, and **yet**.
- Lowercase prepositions, such as **with**, **of**, **in**, **on**, **at**, **by**, **for**, **from**, **to**, **into**, and **through**. Word length does not determine capitalization.
- Lowercase **out**.
- Lowercase the infinitive **to**, as in "How to Use CSS."

### Hyphenated Words

Apply the same rules to each component of a hyphenated word. The first-or-last-word exception refers to the whole title, not each hyphenated compound.

**Examples**

- Client-Side
- User-Centered
- Pseudo-Classes
- Tree-Structural
- Step-by-Step
- Up-to-Date

### Technical Spelling

Preserve technical spelling even at the start or end of a title. This includes `iframe`, `aria-label`, `font-size`, `calc()`, JavaScript, HTML, and CSS.

Source: https://contribute.freecodecamp.org/writing-style-guide/index.mdx
