Markdown Checkbox Syntax: `- [ ]` and `- [x]` (and Why Yours Isn't Rendering)
How to write a checkbox in Markdown, the five mistakes that stop it from rendering, the HTML fallback for renderers without task lists, and a free generator for whole checklists.
A Markdown checkbox is a list item that starts with [ ] for unchecked or [x] for checked:
- [ ] Write the draft
- [x] Outline the post
- [ ] Publish
Rendered, where task lists are supported:
- Write the draft
- Outline the post
- Publish
Checkboxes are not part of original Markdown or CommonMark. They come from GitHub Flavored Markdown, which calls them task lists, and most other tools copied the syntax. That is why the same text can be a clickable box in one app and literal brackets in another.
Need a whole checklist fast? The Markdown Checklist generator turns a plain list of lines into task list syntax.
The exact rules
A task list item has four parts, and all of them matter:
- A list marker:
-,*or+, or a number like1. - A space after the marker
- Square brackets containing exactly one character: a space for unchecked,
xorXfor checked - A space after the closing bracket, then the text
Ordered lists work too:
1. [x] Install the package
2. [ ] Run the migration
3. [ ] Deploy
Nested items are indented under their parent, and you can mix checkboxes with normal bullets:
- [ ] Release 2.0
- [x] Update the changelog
- [ ] Tag the commit
- Note: tags must be signed
Five reasons a checkbox does not render
| Symptom | Cause | Fix |
|---|---|---|
You see [ ] as text |
The renderer has no task list support | Use the HTML fallback below, or switch renderer |
[] with nothing inside |
The brackets need a space: [ ] |
Add the space |
[ ] or [ x ] |
Extra characters inside the brackets | Exactly one character: [ ] or [x] |
-[ ] |
No space after the list marker | - [ ] |
| Box appears but is not clickable | Static render, such as a file view | See the section on clicking below |
If you paste a checklist into a chat app, the answer is usually the first row. Slack and Discord do not support task lists, so the brackets stay literal.
Can you click it?
Syntax and interactivity are separate things. On GitHub the boxes are clickable in issue and pull request descriptions and comments, and clicking edits the underlying text. In a .md file viewed in the repository, they render as boxes you cannot toggle. Obsidian writes the change back to the file. Notion converts the line into a native to-do block. The platform by platform breakdown is in Markdown Task Lists and Checkboxes Across Platforms, and the project management angle is covered in the complete guide to task lists.
HTML fallback
If your renderer passes raw HTML through but has no task list support, write the input element yourself:
<ul>
<li><input type="checkbox" disabled> Write the draft</li>
<li><input type="checkbox" checked disabled> Outline the post</li>
</ul>
The disabled attribute keeps readers from toggling something that will not save. Some sanitizers strip input tags, so test where the content will actually be displayed. The Markdown to HTML converter shows what your renderer produces for the standard syntax.
Checkboxes in tables
Task list syntax does not work inside table cells in most renderers. People get around it with the Unicode characters ☐ and ☑, which are plain text and show up everywhere, but are not interactive:
| Task | Done |
|---|---|
| Write the draft | ☑ |
| Publish | ☐ |
Escaping a checkbox
To show - [ ] literally, for example in documentation, put it in inline code or a fenced code block. Outside code, a backslash before the bracket (\[ \]) stops the list item from being converted.
Related
- Markdown Checklist generator for building lists from plain text
- Markdown Linter to catch malformed list syntax
- How to make a table in Markdown for the table case