Writing clean, maintainable markdown is an art. Follow these best practices to create professional, readable, and maintainable markdown documents that work well across different platforms and tools.
Choose one style for headers and stick with it throughout your document:
# Use ATX-style headers
## They're more consistent
### And easier to maintain
# ATX header
Setext header
=============
### Another ATX
Use dashes (-) for unordered lists consistently:
- Item one
- Item two
- Item three
Add blank lines between sections, paragraphs, and list items for better readability:
## Section Title
This is a paragraph with some content.
- List item one
- List item two
Another paragraph here.
## Section Title
This is a paragraph with some content.
- List item one
- List item two
Another paragraph here.
Wrap lines at 80-100 characters for better readability in editors and code reviews. Most markdown parsers handle wrapped lines correctly.
For long documents with many links, use reference-style links at the bottom:
Check out our [documentation][docs] and [API reference][api].
[docs]: https://example.com/docs
[api]: https://example.com/api
Reference links make your content more readable and easier to maintain. Update URLs in one place instead of throughout the document.
Always specify the language for code blocks to enable syntax highlighting:
```javascript
function example() {
return "Hello, World!";
}
```
```
function example() {
return "Hello, World!";
}
```
Use triple backticks (```) instead of indented code blocks. They're more reliable and support syntax highlighting:
```python
def hello():
print("Hello, World!")
```
Use proper alignment in tables for better readability:
| Feature | Status | Priority |
|---------|:------:|---------:|
| Login | Done | High |
| Logout | Done | High |
| Profile | Pending| Medium |
Keep tables simple and avoid complex formatting. If you need complex tables, consider using HTML or splitting into multiple simpler tables.
Always provide descriptive alt text for accessibility:




Maintain a clear document hierarchy:
# Main Title (H1 - use once per document)
## Major Section (H2)
### Subsection (H3)
#### Sub-subsection (H4 - use sparingly)
For long documents, include a table of contents at the top using links to headers:
## Table of Contents
- [Introduction](#introduction)
- [Installation](#installation)
- [Usage](#usage)
- [API Reference](#api-reference)
Use ordered lists for sequential steps:
1. First, install the dependencies
2. Then, configure the settings
3. Finally, run the application
Use unordered lists for features, benefits, or non-sequential items:
- Feature one
- Feature two
- Feature three
Choose one style and stick with it:
**Bold text** and *italic text*
***Bold and italic***
Asterisks (*) are more common than underscores (_) and work better in most contexts.
Use blockquotes for quotes, important notes, or callouts:
> **Note:** This is an important note that stands out.
>
> It can span multiple paragraphs.
Use horizontal rules (---) sparingly to separate major sections. Overuse makes documents look cluttered.
Use lowercase, descriptive filenames with hyphens:
getting-started.md
api-reference.md
installation-guide.md
Getting Started.md
api_reference.md
InstallationGuide.md
When committing markdown changes, write clear commit messages:
docs: Add installation guide
docs: Update API reference with new endpoints
docs: Fix typo in getting started guide
GitHub supports extended markdown features like task lists, tables, and strikethrough. Use them when appropriate:
- [x] Completed task
- [ ] Incomplete task
- [x] Another completed task
Stick to CommonMark-compliant syntax when possible for maximum compatibility across platforms.
For complex formatting needs, you can use HTML directly in markdown (if your parser supports it):
<details>
<summary>Click to expand</summary>
Hidden content here
</details>
Following these best practices will help you create professional, maintainable markdown documents that work well across different platforms and tools. Remember:
Use our Markdown Formatter to automatically format your markdown according to best practices, and our Live Editor to preview your work in real-time.