Capitalization of titles and headers is a style choice; Markdown syntax determines document structure, not letter case. Capitalize the opening word of each Markdown heading, preserve proper names, and apply the chosen style consistently.
The easiest approach is to choose one house style before editing, then apply it throughout your document. Separate Markdown formatting rules from case rules.
Key takeaways
- Markdown syntax creates heading levels, but it doesn't require title case or sentence case.
- Sentence case capitalizes the opening term and proper names, while the alternative style capitalizes major words under its chosen rules.
- Automation helps enforce consistency, but product names, identifiers, and heading links still need attention.
Markdown syntax controls structure, not case
Use number signs to set heading levels
Markdown headings use ATX-style syntax, with one number sign per heading level: # creates H1, ## creates H2, and so on through ###### for H6. Put a space after the number signs.
For example, ## Install dependencies and ## Install Dependencies both create H2 headings. Their case differs, but their structural meaning is identical.
The CommonMark heading tutorial demonstrates this syntax. Changing a heading's case won't change its level, and adding capitals won't make ordinary text a heading.

Keep nesting and spacing consistent
Use a single H1 for the document title, H2 for main sections, and H3 for subsections. Don't skip levels to get a preferred font size.
Put blank lines before and after headings for compatibility and readable source files. Although the specification permits headings without surrounding blank lines, Markdown applications and Markdown processors can behave differently.
Markdown also supports Setext headings: text followed by an underline of == creates H1, while -- creates H2. Google's Markdown style guide advises against this underline style. Number-sign headings make levels easier to recognize and edit.
Choose sentence case or title case
Sentence case suits technical documentation
Sentence case capitalizes the first word, proper nouns, and established acronyms. Ordinary words remain lowercase, even when they describe important features.
The Google Developer Documentation Style Guide points case questions to its developer documentation guidance. The Google style guide highlights recommend sentence case for document titles and section headings.
These examples compare sentence casing with an editorial style while preserving heading levels.
| Before | Sentence case | AP-style editorial case |
|---|---|---|
# project setup guide |
# Project setup guide |
# Project Setup Guide |
## working with github |
## Working with GitHub |
## Working With GitHub |
### enable two-factor authentication |
### Enable two-factor authentication |
### Enable Two-Factor Authentication |
The AP-style examples capitalize "With." The same hierarchy works with either style.
Title case needs a named rule set
The style capitalizes major words, but AP, APA, Chicago, and MLA differ on some smaller words. For example, prepositions don't follow identical rules across these systems.
Our title case rules and examples explain the major-word distinction. If your publication requires a particular guide, use that guide throughout.
For technical documentation without an existing policy, sentence case is a practical default. For editorial titles, we recommend AP as a general starting point. Neither choice comes from Markdown itself.

Apply the remark-lint title case rules
The remark-lint heading-capitalization plugin applies a particular title-case rule set. Don't treat it as a universal implementation of AP, APA, Chicago, or MLA.
Capitalize major words, including short verbs
The plugin capitalizes the opening term, plus nouns, pronouns, verbs, adjectives, and adverbs. Articles, conjunctions, and prepositions stay lowercase elsewhere.
Articles include a, an, and the. Common conjunctions include and, but, and or; common prepositions include at, by, in, of, on, and to.
Shortness alone doesn't make a word lowercase. Verbs such as "Is," "Be," and "Do" still take capitals. Likewise, the first word takes a capital even when it's an article, as in "An Apple."
These examples show the plugin's expected corrections.
| Invalid heading | Valid heading |
|---|---|
## Where To Ask questions |
## Where to Ask Questions |
## an Apple |
## An Apple |
## Enable 2FA On GitHub |
## Enable 2FA on GitHub |
## Flight-Or-fight |
## Flight-or-Fight |
The differences follow word roles rather than visual symmetry.
Treat hyphenated compounds word by word
Capitalize the first element of a hyphenated compound. Generally capitalize later elements unless they're articles, conjunctions, or prepositions.
That gives you ## State-of-the-Art Tools: "State" starts the compound, "Art" and "Tools" are nouns, and "of" and "the" remain lowercase.
In sentence case, the same heading becomes ## State-of-the-art tools. The hyphens don't create fresh sentence beginnings.
Preserve product names, acronyms, and identifiers
Keep established capitalization in both styles. Write GitHub, iPhone, iOS, and JavaScript, rather than changing their internal letters to fit a visual pattern.
Google's Markdown style guide gives the same instruction for product, tool, and binary names. Its example preserves gShoe rather than changing it to GShoe.
This exception can affect the first word, too. A heading beginning with iPhone should retain that spelling. If it looks awkward, rewrite the heading as "Configure iPhone settings."
The remark plugin checks only the first letter of words that require capitalization. It automatically skips words written entirely in uppercase.
A passing capitalization check doesn't prove that a product name is spelled correctly. It also doesn't justify writing an entire heading in uppercase.
Preserve command names and package identifiers, too. Capitalizing npm or a case-sensitive identifier can alter the text readers need to recognize or copy. Configure exceptions rather than changing these names.
Automate title case with remark-lint
Install and run the checker
Install the checker with npm install remark-lint-heading-capitalization. For a project without a remark command-line setup, also run npm install --save-dev remark-cli remark-lint.
Register the plugin in .remarkrc.json, just as you would another remark-lint plugin:
{
"plugins": [
"remark-lint",
"remark-lint-heading-capitalization"
]
}
Then run npx remark . --ext md --frail from the project directory. The command processes Markdown files, reports diagnostics, and fails when warnings occur.
Use the same command in continuous integration so contributors receive consistent feedback. Treat diagnostics as editing instructions rather than assuming this plugin automatically rewrites every heading.
Add lowercase words and ignored patterns
The lowerCaseWords option extends the default lowercase list. For example, ["die", "der", "und"] adds those words.
The ignorePattern option accepts either one regular-expression string or an array. Replace the basic configuration with:
{
"plugins": [
"remark-lint",
[
"remark-lint-heading-capitalization",
{
"lowerCaseWords": ["die", "der", "und"],
"ignorePattern": ["package-[a-z]+", "node-[0-9]+"]
}
]
]
}
These patterns exempt matching items such as package names and numbered identifiers.
Keep exceptions narrow because broad patterns can hide errors. Adding German words also doesn't make this English-oriented checker a complete German capitalization system.
Most importantly, use this plugin only when its title-case rules match your policy. It will flag correctly written sentence-case headings.
Follow a document-wide editing workflow
Apply the same process whenever you create or revise a Markdown document.
- Record the capitalization style in your contributor guide, including exceptions for brands, identifiers, hyphens, and subtitles.
- Review the document outline. Keep a single H1 heading, nest subsections logically, and use unique complete names for headings.
- Convert heading text without changing number signs, inline code, or established product capitalization.
- Read only the headings, run compatible lint checks, and review links affected by renamed sections.
A converter can help with ordinary text. However, avoid applying capitalization commands to an entire Markdown file, where they could damage code, URLs, or identifiers.
Keep heading anchors stable
Many processors build link anchors from heading text. Use unique headings such as "Configure GitHub authentication" rather than repeating "Configuration" throughout a document.
GitHub lowercases generated heading IDs, so a case-only edit normally leaves its anchor unchanged. Other processors can use different rules. Changes to wording, punctuation, duplicate headings, or visible section numbering can affect generated IDs.
Separate stable IDs from display text
Where your processor supports heading attributes, ## Install dependencies {#install} assigns a fixed target. The heading can then change without changing that explicit ID.
However, generated heading IDs and custom-ID syntax aren't standardized by the CommonMark specification. Use your publishing system's supported anchor mechanism for headings that other documents link to.
Frequently asked questions
Why does iOS skip the first word after a heading symbol?
A Drafts forum discussion describes a script inserting a Markdown heading symbol before the user types. In that workflow, iOS may auto-capitalize the symbol rather than the heading text, leaving the opening term lowercase.
Adjust the script to capitalize the heading text, or apply a sentence-case or chosen heading style action after insertion.
Should the word after a colon be capitalized?
In title case, major style guides generally capitalize the opening term of a subtitle after a colon. Sentence-case conventions differ, so define this exception in your house style.
Don't assume the remark plugin reproduces every guide's punctuation rules. A colon doesn't create a new Markdown heading level.
Keep structure and capitalization consistent
Markdown heading capitalization becomes easier when you separate structure from style. Number signs establish the outline; your house style determines the letters.
Choose sentence case or a defined title-case system, preserve technical names, and automate only the rules your checker supports. Finish with a headings-only review and attention to stable links.
