MDUtil

Footnotes in Markdown

Put [^1] where the note belongs and [^1]: Note text. anywhere below. This guide covers labels, longer notes, repeated references and which apps support footnotes.

Quick answer

How do you add a footnote in Markdown?

Write a caret and a label in square brackets after the word, [^1], and define the note on its own line with the same label and a colon: [^1]: Note text. The notes are numbered and listed at the end of the document, with links back to each reference.

Markdown
Markdown was created in 2004.[^1]

[^1]: By John Gruber, with help from Aaron Swartz.

Result

Markdown was created in 2004.1

Footnotes
  1. By John Gruber, with help from Aaron Swartz. ↩

Footnote syntax and examples

Footnotes come from GitHub Flavored Markdown and Pandoc. The reference and the definition only need to share a label.

Named footnotes

A label can be a word. The rendered notes are numbered in order of their first reference anyway.

Markdown
The spec covers every edge case.[^spec]

[^spec]: See the CommonMark specification.

Result

The spec covers every edge case.1

Footnotes
  1. See the CommonMark specification. ↩

Several paragraphs in one note

Indent the following paragraphs of a note by four spaces.

Markdown
See the note.[^long]

[^long]: The first paragraph of the note.

    A second paragraph, indented four spaces.

Result

See the note.1

Footnotes
  1. The first paragraph of the note.

    A second paragraph, indented four spaces. ↩

One note, several references

Reuse a label to point to the same note again. The note gets a back link for each reference.

Markdown
First mention.[^src] Second mention.[^src]

[^src]: Both references point here.

Result

First mention.1 Second mention.1

Footnotes
  1. Both references point here. ↩ ↩2

Where definitions go

A definition can sit anywhere, for example right after its paragraph. The notes always render at the end.

Markdown
First paragraph.[^a]

[^a]: Defined right after the paragraph.

This paragraph still comes before the notes.

Result

First paragraph.1

This paragraph still comes before the notes.

Footnotes
  1. Defined right after the paragraph. ↩

Formatting in a note

Notes can hold links, code and emphasis like any paragraph.

Markdown
Install it with npm.[^npm]

[^npm]: Run `npm install`, or see the [npm docs](https://docs.npmjs.com).

Result

Install it with npm.1

Footnotes
  1. Run npm install, or see the npm docs. ↩

Inline footnotes

Pandoc and Obsidian accept the note text right in the sentence. Other renderers show it as typed.

Markdown
Water boils at 100 °C.^[At sea level.]

Pandoc and Obsidian only. Other Markdown apps display this differently, so there is no preview.

Footnotes in popular apps

Footnotes are an extension, so support is wide but not universal.

AppSupportNotes
GitHubSupportedFootnotes in files, issues, pull requests and comments, with back links.
GitLabSupportedFootnotes in files, issues and merge requests.
ObsidianSupportedFootnotes, and inline footnotes written ^[text].
Hugo / JekyllSupportedSupported by their default Markdown engines.
Discord / SlackNot supportedNo footnotes; the brackets are shown as typed.

Questions and answers

Does GitHub support footnotes?

Yes, in files, issues, pull requests and comments. The notes appear at the end with links back to each reference.

Why does my footnote not appear?

A footnote shows only when the reference [^1] and the definition [^1]: text both exist with the same label. The definition must start a line, with the colon right after the bracket.

Can I choose where the footnotes appear?

No. Renderers collect all notes at the end of the document, in the order of their first reference.

Do footnote labels have to be numbers?

No. Any label without spaces works, such as [^source]. The rendered notes are numbered anyway.

Can a footnote contain links, code or lists?

Yes. Inline formatting works, and lines indented by four spaces add paragraphs, lists or code blocks to the note.

Are footnotes part of standard Markdown?

No. CommonMark has no footnotes; GitHub Flavored Markdown, Pandoc, Obsidian and most site generators add them.

How do I write an inline footnote?

Pandoc and Obsidian accept ^[note text] right in the sentence. GitHub does not.

Do footnotes survive a Word or PDF export?

Markdown to Word turns them into real Word footnotes at the bottom of the page, and Markdown to PDF prints them at the end of the document.