How to use the markdown inline to reference links converter
- Paste the Markdown.
- Choose Inline to references, or References to inline to go the other way.
- Read the number of links changed and the number of different addresses.
- Copy the converted Markdown or download it as an .md file.
Formula
To references: [text](address "title") becomes [text][1] and a definition [1]: address "title" is added at the end
Numbers follow the order of first use, and the same address with the same title shares one number
To inline: [text][id], [text][] and [text] are replaced with [text](address "title") from the definition
Code blocks and code spans are left alone, so examples of link syntax are not changed.
Three links and two addresses
The sample has a link to a guide, a link to a FAQ with the title Questions and a second link to the guide. The converter changes 3 links with 2 different addresses. The text becomes "Read the [guide][1] and the [FAQ][2]. The [guide again][1] is the same page," and two definitions are added: [1] for the guide and [2] for the FAQ with its title.
The link-like text inside the code span and the fenced block is not touched. Going back with References to inline, the converter writes the full addresses into the sentences again and drops the definition lines it used.
Why use reference links
A long address in the middle of a sentence makes the source hard to read and to edit. With reference links, the sentence stays short and all the addresses sit together at the end, where you can see them, update them in one place and reuse them. If the same address appears ten times, you fix it once.
The rendered page looks identical in both styles, so you can switch freely. Inline links are handy for short notes, and reference links suit long documents and files that many people edit.
Checks before you replace your file
Compare the result with the original in a preview, particularly if your text has links inside lists, tables or HTML. The numbers always start at 1, so a file that already has numbered definitions should be checked for clashes. To list every link first use the Markdown Link Extractor. Edit and preview with the Markdown Editor and Previewer, add a contents list with the Markdown TOC Generator, tidy addresses with the URL List Cleaner, and make other line edits with the Text Line Tools.
Assumptions and limits
- Links use common Markdown syntax with a title in double quotes.
- Numbers are assigned in order of first use, starting at 1.
- The sample is an example. Use your own Markdown.
- Everything is processed in your browser and nothing is uploaded.
Frequently asked questions
Does it change images?
Images are not converted. Only links that a reader can click are turned into reference links.
What happens to a title on a link?
It moves to the definition line. Two links with the same address but different titles get separate numbers.
Can I undo the conversion?
Yes. Paste the result and choose References to inline. The links are written out in full again.
Will it break my code examples?
No. Text inside fenced blocks and code spans is left exactly as typed.