Markdown for GitHub Comments
Format GitHub issue and pull request comments with task lists, code blocks, mentions, and collapsible sections.
Direct answer
GitHub comments use GitHub Flavored Markdown: - [ ] for task lists, triple backticks with a language for code, > for quoting a reply, and a <details> block for collapsible sections. Draft the comment in a live editor first so the formatting is correct before you post it on an issue or pull request.
Open the Markdown EditorWhen to use this
- You are writing a GitHub issue, pull request, or review comment.
- You want a task-list checklist reviewers can tick off.
- You need a collapsible section to hide long logs or output.
Steps
- Use - [ ] for an unchecked task and - [x] for a checked one.
- Wrap code in triple backticks with a language name for syntax highlighting.
- Quote the message you are replying to with a > at the start of the line.
- Hide long output in a <details><summary>Label</summary> ... </details> block.
- Preview the comment in the editor, then paste it into the GitHub box.
Example
## Review checklist - [x] Tests pass - [ ] Docs updated - [ ] Changelog entry added ```bash npm test ``` > Replying to your earlier question about coverage. <details> <summary>Full test log</summary> ``` 42 passing ``` </details>
Review checklist (H2)
[x] Tests pass (checkbox, ticked)
[ ] Docs updated (checkbox, empty)
[ ] Changelog entry added
npm test (highlighted code box)
| Replying to your earlier question about coverage.
> Full test log (click to expand)
42 passingCommon mistakes
- Task list syntax needs a space inside the brackets: - [ ] and - [x], not -[] or -[x].
- Leave a blank line before and inside a <details> block or the Markdown inside it will not render.
- Indenting a code block with four spaces creates a different block; prefer triple backticks with a language.
FAQ
- How do I add a checkbox list in a GitHub comment?
- Start each line with - [ ] for an empty checkbox or - [x] for a checked one. GitHub turns them into clickable checkboxes on issues and pull requests.
- How do I make a collapsible section on GitHub?
- Wrap the content in <details><summary>Label</summary> and </details>. Keep a blank line after the summary so the Markdown inside still renders.
- Does GitHub support the same Markdown as a README?
- Comments and READMEs both use GitHub Flavored Markdown, so tables, task lists, and fenced code work in both. Draft either in a live editor to catch formatting issues first.
Related Markdown guides
Related tools
Related Markdown editor guides
Markdown Syntax Cheat Sheet
A copy-ready Markdown cheat sheet covering headings, bold, italics, lists, links, images, code, tables, and blockquotes.
How to Write a README in Markdown
Structure a clear README.md with a title, badges, install and usage sections, and a live preview before you commit.
Markdown Table Syntax
Write Markdown tables with pipes and dashes, set column alignment, and keep them readable in the editor before you paste.
Markdown Editor With Live Preview Online
Edit Markdown on the left and see the rendered result on the right in real time, with no login and browser-only drafts.
How to Add Links and Images in Markdown
Add inline links, reference links, and images in Markdown, including titles and clickable image links.
Markdown Task List and Checkboxes
Create checkbox task lists in Markdown for READMEs, GitHub issues, and personal to-do notes with live preview.
Markdown Code Blocks and Syntax Highlighting
Add fenced code blocks with a language for syntax highlighting, plus inline code, in Markdown.
Desk gear for long writing sessions
A few things that help if you write docs, tickets, and specs on a laptop all day.
Anker 5-in-1 USB-C Hub
One cable turns a laptop into a desk setup. Drives a 4K display, charges at up to 85W, and adds three data ports.
- 4K HDMI output
- 85W max power delivery
- 1x USB-C + 2x USB-A, 5Gbps each
- MacBook Pro, MacBook Air, Dell
Dell 27" S2725QC 4K
The monitor I write and review documents on. 163 PPI keeps small text sharp, and USB-C carries video and power on one cable.
- 3840x2160 IPS, 163 PPI
- 120Hz, 4ms, FreeSync Premium
- 99% sRGB
- USB-C, HDMI, DisplayPort
Apple MacBook Neo 13" (A18 Pro)
The cheapest way into an Apple-silicon machine that runs local models. Fanless, and the Liquid Retina panel holds small text at a full day of reading.
- A18 Pro chip, built for Apple Intelligence
- 8GB unified memory, 256GB SSD
- 13-inch Liquid Retina display
- 1080p FaceTime HD camera
Amazon affiliate links. We earn a commission on qualifying purchases at no extra cost to you.