Syntax Reference
GitHub Flavored Markdown
GitHub Flavored Markdown (GFM) is a strict superset of CommonMark that adds 5 features: tables, task lists, strikethrough, autolinks, and fenced code blocks. It is the Markdown dialect used on GitHub, GitLab, and most developer tools.
Key facts
- Extends
- CommonMark (strict superset)
- Added features
- Tables, task lists, strikethrough, autolinks, fenced code blocks
- Strikethrough output
- ~~text~~ → <del>
- Used by
- GitHub, GitLab, Bitbucket, most developer tools
What is GitHub Flavored Markdown?
GitHub Flavored Markdown (GFM) is a formal specification that extends CommonMark with 5 added features. It defines how GitHub parses Markdown into HTML, and the same rules apply across GitLab and most developer tools.
GFM is a strict superset of CommonMark: every valid CommonMark document is also valid GFM, but GFM recognizes 5 syntax additions that plain CommonMark ignores. To convert GFM source into HTML directly, use GitHub Flavored Markdown to HTML.
What 5 features does GFM add to CommonMark?
GFM adds 5 features to CommonMark: tables, task lists, strikethrough, autolinks, and fenced code blocks. Each converts to a dedicated HTML element. Standard CommonMark supports none of these 5 extensions.
Tables convert to <table>, task lists to checkbox <input> elements, strikethrough to <del>, autolinks to <a> anchors, and fenced code to <pre><code>. See Markdown Tables for table syntax and Markdown Code Blocks for fenced code blocks.
How does GFM strikethrough convert to HTML?
GFM strikethrough wraps text in double tildes and converts to a <del> element. This syntax does not exist in CommonMark, where double tildes are treated as literal text characters.
~~deleted text~~<p><del>deleted text</del></p>How do GFM autolinks convert to HTML?
GFM autolinks turn a bare URL into a clickable <a> anchor automatically, with no brackets or link syntax. CommonMark requires angle brackets or explicit link syntax to produce an anchor.
Visit https://github.com today<p>Visit <a href="https://github.com">https://github.com</a> today</p>Where is GitHub Flavored Markdown used?
GFM is used on GitHub, GitLab, Bitbucket, and most developer tools, including README files, issues, pull requests, and documentation sites. Its 5 extensions are widely supported wherever Markdown renders.
Because GFM is the de facto standard dialect, content authored in it renders identically across these platforms. The HTML output for tables and fenced code matches how GitHub itself renders the source.
Is GitHub Flavored Markdown a superset of CommonMark?
Yes. GFM is a strict superset of CommonMark. Every CommonMark document is valid GFM, and GFM adds 5 features on top: tables, task lists, strikethrough, autolinks, and fenced code blocks. Nothing in CommonMark is removed.
This superset relationship means GFM parsers handle plain CommonMark correctly, then layer the 5 extensions over it. That guarantee is why GitHub, GitLab, and developer tools standardized on GFM as their Markdown dialect.
Frequently Asked Questions
- What is the difference between GFM and CommonMark?
- GitHub Flavored Markdown adds 5 features absent from CommonMark: tables, task lists, strikethrough, autolinks, and fenced code blocks. GFM is a strict superset, so every CommonMark document is also valid GFM.
- Does strikethrough use one tilde or two in GFM?
- GFM strikethrough uses two tildes around text, like ~~text~~, which converts to a <del> element. A single tilde is treated as a literal character and produces no strikethrough.
- Do GFM autolinks require angle brackets?
- No. GFM autolinks detect bare URLs automatically and convert them to <a> anchors without angle brackets. CommonMark requires angle brackets, like <https://example.com>, to produce an automatic link.
- Does GFM work outside GitHub?
- Yes. GFM is supported by GitLab, Bitbucket, and most developer tools and static site generators. Its HTML output is standards-compliant and renders the same way in any browser, independent of GitHub.