Sentence Case or Title Case for Headings? A Style Guide Answer
Quick answer
For technical docs and Markdown notes, use sentence case. Google's developer documentation style guide says to use sentence case for all headings and titles, and that is the safest default when no house style tells you otherwise. Title case isn't wrong. Mixing the two in one project is.
Below: the rule, its exceptions, a few related heading rules worth settling now, and how to enforce the choice automatically.
Sentence case and title case, defined
Sentence case capitalizes a heading the way you would capitalize a sentence: the first word and any proper nouns, nothing else. Title case capitalizes most of the words and leaves small ones such as "a", "of" and "the" in lowercase.
## Create a project from a template <!-- sentence case -->
## Create a Project From a Template <!-- title case -->Markdown doesn't care which you type. An ATX heading is just # marks followed by text, and the renderer shows whatever you wrote.
What Google's style guide says
The capitalization page is direct. In document titles and headings, use sentence case: capitalize only the first word, the first word in a subheading after a colon, and any proper nouns or other terms that are always capitalized a certain way.
A few details from the same page:
- Don't put a period at the end of a title or heading, even in sentence case.
- When a hyphenated word starts a heading, capitalize only its first element, unless a later element is a proper noun or proper adjective.
- Use sentence case for captions, for every element of a table, and for items in all types of lists.
- When you refer to a heading from a document that follows the guide, use sentence case even if the heading itself is in title case, so the reference still matches after the heading is updated. When you cite a work that doesn't follow the guide, keep its original capitalization.
The practical result is one rule that is easy to remember: capitalize like a sentence, and let proper nouns keep their capitals.
Exceptions: proper nouns, product names, and code
Sentence case doesn't mean lowercase everything. Names that are always capitalized a certain way keep that spelling, so a heading about a language, a company or a file format keeps its capitals mid-heading.
The guide also asks you not to use unnecessary capitalization, and not to use all-uppercase except in official names, abbreviations that are always written in capitals, or when referring to code that uses capitals. Camel case follows the same pattern: only in official names or when you are referring to code that uses it.
Code in a heading needs care. The headings page says to avoid code items in headings, and if you must mention one, add a descriptive noun next to the item in code font. A heading such as `## The fetch function reads better than a bare ## fetch `.
Related heading rules worth settling at the same time
Capitalization is one choice among several. The same headings page covers the rest. If you're deciding on a style anyway, decide these too:
- Task headings start with a bare infinitive: "Create an instance", not "Creating an instance".
- Conceptual headings use a noun phrase that doesn't start with an -ing verb: "Migration to Google Cloud", not "Migrating to Google Cloud".
- Punctuation should stay simple. The guide points out that heavy punctuation can be a sign the heading is too complicated.
- No numbers to show a sequence of sections; heading order already does that.
- No links in headings, because a link can be mistaken for styling.
- No skipped levels: put an
h3only under anh2, and use a singleh1per page.
If your docs are organized by purpose, the same thinking applies to the sections themselves; see sorting docs into four kinds.
Case is a style choice, not a Markdown rule
Nothing in the format enforces capitalization. If you want the background on what Markdown does and doesn't define, read what RFC 7763 registers for Markdown. Capitalization lives in your own style guide, so it drifts unless something checks it. Notes written over several years, or a README edited by several people, tend to collect both styles.
Enforce the choice with a linter
If you keep Markdown in a repository, a linter can do the checking. The rumdl rule MD063 checks heading capitalization and supports title-case, sentence-case and all-caps.
Two details matter. First, the style option defaults to title-case, and the rule is disabled by default, because capitalization preferences vary between style guides and people. So a project that wants sentence case has to turn the rule on and set the style:
[MD063]
enabled = true
style = "sentence-case"The rule also has ignore-words for brand names you want preserved exactly, preserve-cased-words (on by default) to keep words with internal capitals, and min-level and max-level to limit which heading levels are checked. Running rumdl fix yourfile.md applies the fix.
How Carets fits in
Headings are what you scan when you open a long Markdown file, so a consistent style pays off quickly. Carets is a native notes and code editor for iPhone, iPad and Mac, and it keeps everything as plain Markdown and text files, so the heading rule you pick stays portable and works with any linter or style guide you run later.
Your notes and docs are organized into files, projects and tags, which makes it simple to keep a style-guide note next to the project it applies to. Markdown and plain text are first-class, and code and config files get syntax highlighting, so the same editor handles the notes and the README.
Get Carets for iPhone, iPad and Mac on the App Store.
Frequently Asked Questions
Should every heading in a Markdown file use sentence case?
If you follow Google's developer documentation style guide, yes. It says to use sentence case for all headings and titles, and the same for captions, table elements and list items. Whatever you pick, apply it to every heading in the project.
Do proper nouns and product names stay capitalized in sentence case?
Yes. Sentence case keeps capitals on the first word, the first word after a colon, and any proper noun or term that is always capitalized a certain way.
Should a heading end with a period?
No. Google's guide says not to put a period at the end of a title or heading, even in sentence case.
Does Markdown care about heading capitalization?
No. Capitalization is a style decision, so a linter such as rumdl's MD063 rule is what enforces it, and that rule is off until you turn it on.