To link to a heading in a GitHub README, copy the heading link from the rendered file. GitHub chooses the section fragment, so check that destination before adding it to a navigation list or sharing it with another reader.
Copy the link from the rendered README
- Open the README in its rendered view on the intended branch or revision.
- Find the heading you want. The Outline menu can help locate sections in a longer file.
- On desktop, hover over that heading and select its link icon.
- Copy the resulting browser address, including the part beginning with
#.
GitHub’s README guidance describes the outline and heading-link controls. Copy the link for the specific heading you intend to reference.
Compare a page slug with an actual heading link
The heading at the top of this recorded version of the ASP.NET Core README reads:
ASP.NET Core
Try that text in Heading or title in the Text to Slug Generator. Select Hyphen, keep Force lowercase and Keep numbers checked, and leave Strip stop words unchecked. Set Max length to 0 and leave the base URL empty.
The tool produces:
asp-net-core
The actual GitHub heading link uses #aspnet-core. The internal period disappears instead of becoming a separator. Adding # to the generated page slug would give #asp-net-core, which does not match that README’s heading anchor.
Use the copied fragment in a Markdown link
Inside the same Markdown file, a link to that heading can use the fragment alone:
[Project overview](#aspnet-core)
The words in square brackets are the visible link text. The destination in parentheses must match the intended heading link. For a link from another page or a shared message, retain the copied full file address and its fragment.
A general slug generator does not inspect the rendered README or determine GitHub’s heading anchors. Use the generated page slug for its intended page-address workflow. Our page slug guide covers that separate choice.
Recheck links after changing headings
GitHub’s section-link documentation explains its lowercase, space and punctuation rules. It also describes suffixes used when generated anchors repeat. Editing a heading, or reordering headings with identical anchors, can change the destination you need.
After saving the intended README revision, open the file from its base address and follow your section link. Confirm that it reaches the intended heading and nearby content, then check the relevant navigation entries again. Opening the correct file alone does not confirm that its section fragment is correct.