links, headings as bold lines, tables as code grids — with a list of what was approximated.
---
# Markdown to Discord converter
URL: https://docs-md.com/markdown-to-discord
Category: Convert
Updated: 2026-10-15
Turn standard markdown into Discord markdown — headings to ###, masked links, code blocks with languages, tables as code grids — with every approximation listed.
---
# Markdown to Jira converter
URL: https://docs-md.com/markdown-to-jira
Category: Convert
Updated: 2026-10-15
Turn standard markdown into Jira wiki markup — h1. headings, *bold*, {code:lang} blocks, ||header|| tables, [text|url] links, ** nested lists — ready for issue fields.
---
# Markdown to plain text converter
URL: https://docs-md.com/markdown-to-plain-text
Category: Convert
Updated: 2026-10-15
Strip every markdown marker and keep the words, lists, code and paragraph structure — links optionally kept as "text (url)". For email, SMS, and form fields.
---
# Markdown table generator
URL: https://docs-md.com/markdown-table-generator
Category: Generate
Updated: 2026-09-01
Build tables in a visual grid — set column alignment, paste CSV/TSV from a spreadsheet, and copy clean padded markdown.
## Can a Markdown table cell contain a list or an image?
URL: https://docs-md.com/markdown-table-generator/markdown-table-cell-lists-images
Updated: 2026-10-17
An image, yes. A real list, no. In GitHub Flavored Markdown a table cell holds inline content only, and an image is inline, so `` works in a cell. A list is a block element, so `- item` stays literal text. Fake a list with `•` and `
`, or use HTML or a different layout.
The rule behind both answers is short. A pipe table is one line per row, and each cell is the text between two pipes on that line. The [GFM specification](https://github.github.com/gfm/#tables-extension-) says the cells contain text "in which inlines are parsed" and that "block-level elements cannot be inserted in a table". Inline means anything that can sit inside a sentence: emphasis, links, inline code, images, line breaks written as HTML. Block means anything that needs lines of its own: paragraphs, lists, fenced code, quotes, headings.
## Which content can go in a Markdown table cell?
Here is the practical split for GitHub, GitLab and most renderers that follow GFM:
| Content | In a pipe-table cell? | How |
|---|---|---|
| Bold, italic, strikethrough | Yes | `**bold**`, `*italic*`, `~~old~~` |
| Links | Yes | `[docs](https://example.com)` |
| Inline code | Yes | `` `npm test` `` (escape any pipe inside with a backslash) |
| Images | Yes | `` |
| Line breaks | Yes, as HTML | `first
second` |
| Bulleted or numbered list | No, as Markdown | Fake it with `•` and `
`, or use HTML |
| Fenced code block | No | Inline code, or put the block under the table |
| Several paragraphs | No | `
` gives the look, not the structure |
The details of line breaks, bullet workarounds and code in cells are in [line breaks in a Markdown table cell](/guides/markdown-table-line-break). The rest of this page is about choosing between those workarounds and keeping images readable.
## How do I put an image in a table cell?
Type the normal image syntax into the cell:
```markdown
| Status | Meaning |
|---|---|
|  | All checks green |
|  | At least one check failed |
```
Images in cells follow the same rules as images anywhere else, which the [image syntax guide](/guides/markdown-image) covers in full. Three points matter more inside a table:
- **Size.** Markdown image syntax has no width, and a large image stretches the column. On GitHub, use an HTML tag with a width instead: `
`. Keep the tag on the same line as the rest of the row.
- **Alt text.** In a table, the alt text often stands in for a whole cell when the image does not load or a screen reader reads the row. Write what the image means, not what file it is.
- **Pipes in URLs.** A literal `|` in an image URL ends the cell. Percent-encode it as `%7C`.
## What is the most reliable way to fake a list in a cell?
Use a bullet character and `
` between items: `• Fast
• Free
• Offline`. It is plain text plus one HTML tag, so it renders wherever `
` is allowed and degrades to a single readable line where it is not. Writing `- item` with `
` looks similar in the source, but the hyphens show as hyphens and some editors escape them. For a numbered list, type the numbers: `1. Install
2. Configure`.
This is the right choice when a few cells need two to four short items. The source stays readable, the table still works in a plain text editor, and the [table generator](/markdown-table-generator) handles it: type the items into a cell with `
` between them and the generated Markdown keeps them on one line, with any pipes escaped for you.
## When should I use an HTML table instead?
When the cells need real structure: proper `` lists, multiple paragraphs, a `
` code block, or merged cells. GitHub and GitLab render HTML tables, and inside `` you can use list tags. The costs are a much longer source, Markdown syntax that GitHub does not parse inside the HTML, and a table that disappears in renderers that strip HTML. The [Markdown table guide](/guides/markdown-table) shows where HTML tables render and where they do not.
If you write for Pandoc rather than GitHub, there is a third option. Pandoc's [grid tables](https://pandoc.org/MANUAL.html#extension-grid_tables) draw the borders with `+`, `-` and `|`, and their cells "may contain arbitrary block elements (multiple paragraphs, code blocks, lists, etc.)":
```markdown
+-----------+--------------------+
| Plan | Includes |
+===========+====================+
| Basic | - 1 project |
| | - Email support |
+-----------+--------------------+
```
GitHub does not render grid tables, so use them only for documents that Pandoc converts, such as Word or PDF output.
## Should the content be a table at all?
Often not. If most cells need a list, the data is usually a list of items with details, and a table squeezes it. Two alternatives read better:
- **Headings with lists under them.** One heading per row of the would-be table, then the list. Long content gets room, and every item can link to its own anchor.
- **A narrow table plus details below.** Keep the table to short comparable values (name, status, version) and move the long text into sections under it.
A good test: if you need ` ` in more than a third of the cells, change the layout. Tables work best when every cell is a short value a reader compares across rows.
## Can I put a checkbox or task list in a table cell?
Not as an interactive task list. GitHub's `- [ ]` syntax is a list item, so it has the same problem as any other list: inside a pipe-table cell it stays literal text and nothing becomes clickable. For a status column, use characters that read correctly as text, such as `☐` and `☑`, or words like Done and Open, which also sort and search better. If the checkboxes need to be ticked on GitHub, put the task list under the table, one item per row, and reference it from the table.
## Do images and lists in cells survive conversion to Word or PDF?
Images do, when the converter can reach the file. Inline formatting and ` ` line breaks also come through with converters that parse the Markdown first. HTML tables convert as tables in tools that render HTML, and Pandoc grid tables become Word tables with real lists in the cells. Faked lists stay faked: the `•` characters convert as text. For the full Word workflow see [turning a Markdown table into a Word table](/markdown-to-word/markdown-table-to-word-table).
## Why does my list in a table cell show as dashes?
Because the list marker is not parsed inside a pipe-table cell, so `- item` is the literal text "- item". Nothing is broken; the syntax does not apply there. Replace the hyphens with `•` and join the items with ` `, or move the list out of the table.
## Should I give an LLM a Markdown table or CSV?
URL: https://docs-md.com/markdown-table-generator/markdown-table-vs-csv-for-llm
Updated: 2026-10-17
For small tables that a person will also read, a Markdown table is a sound default: every cell boundary is marked and the table renders in chat interfaces. For larger data, CSV is more compact and usually the better choice. Either way, test on your own data, because no format is right for every model and task.
Both formats carry the same information: rows, columns and a header. The differences are in how many tokens they cost, how they handle awkward values such as commas and line breaks, and how readable they are to the person checking the prompt and the answer. None of these differences is large for a ten-row table. They start to matter when the table is hundreds of rows long or when the values are messy.
## How many more tokens does a Markdown table use than CSV?
It depends on the data and the tokenizer, but Markdown always adds characters: pipes between and around cells, spaces, and a delimiter row. As one measured example, here is the same seven-row, four-column table in three forms, counted with OpenAI's [tiktoken](https://github.com/openai/tiktoken) library and its `o200k_base` encoding:
| Format | Characters | Tokens (o200k_base) |
|---|---|---|
| CSV | 139 | 61 |
| Markdown table, compact (`\| a \| b \|`) | 235 | 96 |
| Markdown table, padded to align columns | 311 | 120 |
The table was:
```text
Region,Quarter,Revenue,Units
North,Q1,12400,310
North,Q2,13150,322
South,Q1,9800,255
South,Q2,10275,268
West,Q1,15020,401
West,Q2,14790,389
```
Treat the ratio as an illustration, not a constant. Other models use other tokenizers, longer text values dilute the overhead of the pipes, and short numeric values like these show it at its largest. The useful conclusion is narrower: padding spaces cost tokens and add nothing for a model, so if you send Markdown, send it compact. Count with your own provider's tokenizer before you decide on cost grounds.
## When is a Markdown table the better choice?
When the table is small to medium, and a person will read the prompt or the answer. A few reasons:
- **Explicit boundaries.** Every cell is enclosed in pipes, including empty ones, so `| North | | 310 |` shows clearly that the middle value is missing.
- **Rendering.** Chat interfaces that render Markdown show the table as a table, which makes it easy to check that the model saw what you meant to send.
- **Matching output.** If you want a table back, giving one in the same format shows the shape you expect.
- **Mixed documents.** A table inside a Markdown document (a spec, a README, meeting notes) can stay as it is, with headings and prose around it.
The [Markdown table generator](/markdown-table-generator) builds a correctly escaped table in compact or padded form, and the [CSV to Markdown converter](/csv-to-markdown) turns existing CSV into one, with a Pad columns option you can switch off to save tokens.
## When is CSV the better choice?
When the table is large, when cost or context length is the constraint, or when the data already exists as CSV and converting it adds a step where things can go wrong. CSV has a published convention for awkward values: [RFC 4180](https://www.rfc-editor.org/rfc/rfc4180) says fields containing commas, double quotes or line breaks are enclosed in double quotes, and a double quote inside such a field is doubled. A cell with a comma or a multi-line address is therefore unambiguous in well-formed CSV.
Markdown tables have no equivalent for line breaks. A cell must stay on one line, so line breaks become ` ` and every pipe inside a value must be escaped as `\|`. That is fine for a handful of cells and fragile for messy text exports. If your values contain many commas, a tab-separated file avoids most quoting.
## What goes wrong with either format?
The same handful of problems show up in prompts regardless of format:
- **Unlabelled columns.** A header like `q2_adj_v3` means nothing to a model. Rename columns to plain words, and add units: `Revenue (USD)`.
- **Inconsistent values.** Dates in two formats, numbers with and without thousands separators, `N/A` next to empty cells. Clean them before sending; the model will otherwise guess.
- **Broken rows.** An unescaped pipe in Markdown or an unquoted comma in CSV shifts every following value one column to the right. Check the row count and column count after conversion.
- **Too many columns.** Very wide rows make it hard to keep a value attached to its header at the far end of a long row. Drop columns the task does not need.
## When should I use neither?
When the data is large enough that the model does not need to read every row, or when the answer requires exact arithmetic. Pasting thousands of rows into a prompt to ask for a total or an average asks the model to do in its head what a few lines of code do exactly. If your setup offers file upload with code execution or a database tool, give it the file and ask for the computation. Paste a table only when the model needs to read and reason over the rows themselves: compare a few options, spot an outlier, write a summary.
For nested or record-like data, a third shape is often clearer than either: one JSON object per row, or `key: value` lines per record. Each value then carries its own label, at the cost of repeating the keys. The [JSON to Markdown table converter](/json-to-markdown-table) goes the other way when you need a table for a person.
## Does sorting or ordering the rows matter?
It can help. If the question is about the largest values or a date range, sort the rows by that column first so the relevant rows are together, and say in the prompt how the table is ordered. See [how to sort a Markdown table](/markdown-table-generator/sort-markdown-table) for ways to do it without retyping.
## What should the prompt say around the table?
Say what the table is, where it came from, what each row represents, and any column whose meaning is not obvious. Put the instruction before or after the table rather than in the middle, and state the output format you want. Those few sentences usually matter more than the choice between pipes and commas. The [Markdown table guide](/guides/markdown-table) covers the syntax rules if you write the table by hand.
## How do I sort a Markdown table?
URL: https://docs-md.com/markdown-table-generator/sort-markdown-table
Updated: 2026-10-17
Markdown has no sort feature: rows appear in the order they are written. To sort, reorder the lines. The simplest way is a round trip: convert the table to CSV, sort it in a spreadsheet, and convert it back. On the command line, `sort` with `|` as the field separator works, as long as you keep the header out of it.
A pipe table is just lines of text. The renderer does not reorder anything, and GitHub Flavored Markdown has no attribute for a sort column or a default order. Sorting is something you do to the source before you commit or publish it. The methods below go from the most forgiving (any data, any platform) to the fastest (one command, clean data only).
## How do I sort a Markdown table with a spreadsheet?
This works for any table and handles text, numbers and dates the way a spreadsheet does.
1. Paste the table into the [CSV to Markdown converter](/csv-to-markdown) and switch the direction to Markdown → CSV. Choose Tab as the output delimiter; it pastes most cleanly into a spreadsheet.
2. Copy the output and paste it into Excel, Google Sheets, Numbers or LibreOffice Calc. Escaped pipes (`\|`) come out as plain `|` characters, and the header lands in the first row.
3. Select the data, use the spreadsheet's sort command with "data has header row" turned on, and pick the column and direction.
4. Copy the sorted range, including the header, and paste it back into the CSV to Markdown converter in the normal direction. It detects the tab separator and rebuilds the table.
Column alignment is not carried through CSV, so set it again in the converter (click a column's alignment control) if your table had right-aligned numbers. This round trip is also the moment to fix anything else: rename a header, delete a column, or correct a value. If your data started in a spreadsheet, see [converting an Excel sheet to a Markdown table](/csv-to-markdown/excel-to-markdown-table).
## How do I sort a Markdown table on the command line?
Keep the first two lines (header and delimiter row) as they are and sort the rest with pipes as the field separator. The [GNU sort manual](https://www.gnu.org/software/coreutils/manual/html_node/sort-invocation.html) documents `-t` for the separator and `-k` for the key:
```bash
(head -n 2 table.md; tail -n +3 table.md | sort -t '|' -k 2,2) > sorted.md
```
The field numbers are one higher than you might expect. A row like `| axios | 105000 |` starts with a pipe, so field 1 is the empty text before it, field 2 is the first column, field 3 the second, and so on. Common variations:
```bash
# second column, numeric, largest first
(head -n 2 table.md; tail -n +3 table.md | sort -t '|' -k 3,3 -n -r)
# third column, ignoring upper and lower case
(head -n 2 table.md; tail -n +3 table.md | sort -t '|' -k 4,4 -f)
```
`-n` compares numbers by value instead of character by character, so `9800` comes before `10275`. `-r` reverses the order and `-f` treats `b` and `B` as equal. If the order of letters looks wrong, it is the locale: the manual notes that sort follows your `LC_COLLATE` setting, and suggests setting `LC_ALL=C` for plain byte order, for example `LC_ALL=C sort -t '|' -k 2,2`.
## When does the command-line method break?
When a cell contains an escaped pipe. `sort` does not know Markdown, so `\|` inside a cell counts as a field separator, the rest of that row shifts one field to the right, and the row is sorted on the wrong value. It also breaks on tables that span several sections or have blank lines, and on numbers with currency symbols, units or a leading `+`, which the manual says `-n` does not recognise (thousands separators depend on the locale's `LC_NUMERIC` setting). For any of those, use the spreadsheet round trip, which parses the table properly.
The table itself is never damaged by a wrong sort; only the order is. Still, write to a new file (`> sorted.md`) and compare before you replace the original.
## How do I sort by two columns?
In a spreadsheet, add a second level in the sort dialog: for example Language first, then Stars within each language. On the command line, give `sort` more than one key. The manual says it compares the keys in the order they appear on the command line, so the second key only decides between rows that tie on the first:
```bash
(head -n 2 table.md; tail -n +3 table.md | sort -t '|' -k 4,4 -k 3,3nr)
```
Here the letters after a key (`n` for numeric, `r` for reverse) apply to that key alone, so the table is sorted by the third column alphabetically and, within each group, by the second column from largest to smallest.
## Can the Markdown table generator sort rows?
No. The [Markdown table generator](/markdown-table-generator) builds and edits tables: cells, alignment, adding and removing rows and columns, and pasting CSV or TSV data. It does not sort or reorder rows. To sort a table you are building there, sort the data before pasting it in with Paste CSV / TSV, or finish the table, then sort it with one of the methods above. The generator's paste splits on tabs or commas without reading quotes, so for data with commas inside values, paste tab-separated text.
## Should I sort in a text editor?
Many code editors have a command to sort selected lines alphabetically, and that works for a quick sort on the first column: select the data rows only (not the header or the delimiter row) and run it. It compares whole lines as text, so it effectively sorts by the first column and cannot sort numbers by value. For any other column, or for numbers, use a spreadsheet or `sort -k`.
## How do I keep a table sorted as it grows?
Pick a rule and write it down where contributors will see it, for example in a comment above the table: ``. HTML comments are not rendered, so the note stays in the source only; the [comment guide](/guides/markdown-comment) covers the syntax. Alphabetical order by the first column is the easiest rule to keep, because new rows can be inserted by eye without any tool. For tables generated from data, such as a list of releases or benchmark results, sort in the script that writes the table rather than by hand.
## What order should a table be in?
The order a reader needs. Alphabetical suits reference lists that people scan for a name. Descending by a metric suits rankings and comparisons. Chronological suits changelogs and timelines; decide once whether newest goes first. If you hand the table to an AI assistant, say in the prompt how it is sorted, as covered in [Markdown table or CSV for an LLM](/markdown-table-generator/markdown-table-vs-csv-for-llm). The [Markdown table guide](/guides/markdown-table) covers the rest of the syntax.
---
# GitHub README and docs viewer
URL: https://docs-md.com/github-readme-viewer
Category: Edit & share
Updated: 2026-10-13
Paste a repository URL and read its README and docs folder as a clean, linked site — relative links and images resolved, no cloning.
## How do I format a README.md?
URL: https://docs-md.com/github-readme-viewer/how-to-format-readme-md
Updated: 2026-10-17
Format a README.md with GitHub Flavored Markdown: `#` headings for sections, a blank line between paragraphs, fenced code blocks with a language name for commands, `-` for lists, pipes for tables, and relative paths for images and links to other files. GitHub renders the file on the repository's front page, so check the rendered result before you commit.
This page is about the formatting itself. What a README should contain (sections, order, length) is covered in [What is a README file?](/readme-generator/what-is-a-readme-file). Here, the question is how to write each part so it renders the way you expect on GitHub, which runs its own variant of markdown and its own cleanup step on the result.
## What markdown syntax does a README use?
Ordinary markdown plus the GitHub Flavored Markdown (GFM) extensions: tables, task lists, strikethrough and autolinks. These are the elements almost every README uses:
| Element | Syntax | Notes |
|---|---|---|
| Title | `# Project name` | One H1 at the top |
| Section | `## Installation` | H2 for sections, H3 for subsections |
| Bold, italic | `**bold**`, `_italic_` | |
| Inline code | `` `npm install` `` | For names, flags, file paths |
| Code block | three backticks plus a language | See the next section |
| Bulleted list | `- item` | Indent two spaces to nest |
| Numbered list | `1. step` | Good for setup steps |
| Link | `[docs](docs/setup.md)` | Relative paths for repo files |
| Image | `` | Alt text is required in practice |
| Table | `\| a \| b \|` rows with a `\|---\|---\|` divider | GFM extension |
| Task list | `- [ ] todo`, `- [x] done` | GFM extension |
Use headings in order without skipping levels, because GitHub builds the file's outline menu and the anchor for every section link from them. The [headings guide](/guides/markdown-headings) covers the syntax and common mistakes.
## How should I format code and commands in a README?
Put every command and code sample in a fenced code block with a language name after the opening backticks, so GitHub applies syntax highlighting:
````markdown
```bash
npm install my-package
```
```js
import { convert } from 'my-package';
console.log(convert('# Hello'));
```
````
Keep one command per line and leave out the shell prompt (`$`), so readers can copy the block and run it. Use inline backticks for short names in a sentence, such as `--verbose` or `config.json`. The [code block guide](/guides/markdown-code-block) lists the language names and how to show backticks inside a block.
## Why does my README put two lines on one line?
Because a single line break inside a paragraph is ignored in `.md` files. GitHub's docs point out that issues and comments show a line break where you press Enter, but a README does not ([GitHub Docs, line breaks](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#line-breaks)). To force a break inside a paragraph, end the line with two spaces, a backslash (`\`), or ` `. To start a new paragraph, leave a blank line. The backslash is the easiest to see when you read the source, so it is the safest choice; the [new line guide](/guides/markdown-new-line) compares all three.
## How do I add images, badges and links to other files?
Use paths relative to the README for anything inside the repository. GitHub's docs say it rewrites relative links and image paths "based on whatever branch you're currently on, so that the link or path always works", that paths starting with `/` resolve from the repository root, and that `./` and `../` work as usual ([GitHub Docs, relative links](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-readmes#relative-links-and-image-paths-in-markdown-files)).
```markdown

See the [contribution guide](CONTRIBUTING.md) before opening a pull request.
```
Badges are images wrapped in links and usually sit in one line under the title. Keep the link text of any link on a single line; GitHub notes that link text split across lines does not work. Resizing, captions and dark-mode variants need HTML, which the [image guide](/guides/markdown-image) explains. If an image does not appear after you push, the [README images guide](/github-readme-viewer/readme-images-not-showing) goes through the causes.
## How do I add notes and warnings to a README?
Use GitHub's alert syntax, a blockquote whose first line is a type in brackets:
```markdown
> [!WARNING]
> Version 2 changes the config file format. Read the migration notes first.
```
GitHub supports five types: `NOTE`, `TIP`, `IMPORTANT`, `WARNING` and `CAUTION`. Its docs advise using alerts only when they are crucial and limiting them to one or two per article, and say alerts cannot be nested inside other elements. Other sites that display your README may show an alert as a plain quote with `[!WARNING]` in it; the [alerts guide](/guides/markdown-alerts) covers where they render and a portable alternative.
## What HTML can I use in a README on GitHub?
A limited set. GitHub converts the markdown and then sanitizes the HTML, "aggressively removing things that could harm you", including `script` tags, inline styles, and `class` or `id` attributes ([github/markup](https://github.com/github/markup#readme)). In practice that leaves layout to a few tags and attributes. When we sent a test file to GitHub's markdown rendering API on 2026-10-17, these survived: `align="center"` on a ``, `width` on an ` `, `` and ``, ``, `` and `` with a dark-mode ``. A `style` attribute was removed, a `` tag was dropped (its text kept), and an `id` was rewritten with a `user-content-` prefix.
So `` is the usual way to center a logo, colored text cannot be done with HTML, and collapsible sections work with ``. To hide a note from the rendered page, use an HTML comment, ``. The [collapsible section guide](/guides/markdown-collapsible-section) shows the blank lines `` needs for markdown inside it to render.
## Is there a size limit for a README on GitHub?
Yes. GitHub's docs say that when a README is viewed on GitHub, "any content beyond 500 KiB will be truncated". Very few READMEs come close, but generated ones (API references, long changelogs, embedded tables of data) can. Move long material to a `docs/` folder and link to it. GitHub also recognizes a README in the `.github` or `docs` folder, and picks `.github` first, then the root, then `docs` if there is more than one.
## How do I check the formatting before I commit?
Preview it. GitHub's file editor has a **Preview** tab, editors such as VS Code have a side-by-side preview, and once the file is pushed to a public repository you can read it in the [GitHub README viewer](/github-readme-viewer), which shows the README with the repository's other docs and resolves its relative links and images. Each method has gaps compared with GitHub's own rendering; the [README preview guide](/github-readme-viewer/preview-readme-before-push) compares them.
## How do I preview a README before pushing to GitHub?
URL: https://docs-md.com/github-readme-viewer/preview-readme-before-push
Updated: 2026-10-17
Open the README in your editor's markdown preview for quick checks, paste it into the Preview tab of GitHub's file editor to see GitHub's own rendering without committing, or push it to a separate branch and read it there before merging. Only the branch method shows images and relative links exactly as they will appear on the repository page.
The reason there is no single perfect answer is that GitHub renders a README with its own pipeline: GitHub Flavored Markdown, then a sanitizing step, then GitHub-specific features such as alerts and rewritten relative links. Any preview outside GitHub reproduces some of that, not all of it. The useful question is which differences matter for your file. The table summarizes the trade-offs before the details.
| Method | Uses GitHub's renderer | Unpushed images show | Needs a push |
|---|---|---|---|
| VS Code preview | No (CommonMark, markdown-it) | Yes, from disk | No |
| GitHub editor Preview tab | Yes | No | No |
| A separate branch | Yes | Yes, once pushed | Yes, not to main |
| GitHub markdown API | Yes, with gaps | No | No |
## How do I preview a README in VS Code?
Open the file and press Ctrl+Shift+V (Cmd+Shift+V on macOS) to switch to the preview, or Ctrl+K V (Cmd+K V) to open it beside the source, where it updates as you type ([VS Code docs, Markdown preview](https://code.visualstudio.com/docs/languages/markdown#_markdown-preview)). Images load from your disk, so screenshots you have not committed yet appear, and scrolling stays in sync between the two panes.
Know the gap. The VS Code docs state that it targets the CommonMark specification using the markdown-it library, not GitHub Flavored Markdown. In practice, check GitHub-only features such as [alerts](/guides/markdown-alerts) on GitHub itself. The preview also blocks scripts and, under its default "Strict" security setting, images served over plain `http`. Other editors and IDEs have similar previews with similar limits.
## How do I use GitHub's Preview tab without committing?
Open any markdown file in the repository on GitHub, click the pencil icon to edit it, paste your new README text into the editor, and click **Preview** above the content ([GitHub Docs, editing files](https://docs.github.com/en/repositories/working-with-files/managing-files/editing-files)). This is GitHub's own renderer, so headings, tables, task lists, alerts and allowed HTML look as they will on the repository page. When you are done, cancel the edit instead of clicking **Commit changes**, and nothing is saved.
Two limits. Images and files that exist only on your computer are missing, because GitHub cannot see them yet. And pasting into a browser editor is fine for checking the text but easy to get wrong for a long file, so treat it as a check, not the place you edit. Pressing `.` on a repository page opens github.dev, a web version of VS Code, but its markdown preview is VS Code's, with the same gap described above.
## Why push the README to a branch first?
Because a branch is the only preview that is exactly what readers will see. Create a branch, commit the README and its images, push, and open the branch on GitHub. GitHub's docs say relative links and image paths are rewritten "based on whatever branch you're currently on, so that the link or path always works", so images in the branch resolve to the branch's files ([GitHub Docs, About READMEs](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-readmes#relative-links-and-image-paths-in-markdown-files)).
```bash
git switch -c readme-update
git add README.md docs/images/
git commit -m "Rewrite README"
git push -u origin readme-update
```
If you open a pull request from the branch, GitHub can show the change as a rendered "rich diff" of the markdown, with added and removed text highlighted, which makes review easier ([GitHub Docs, prose diffs](https://docs.github.com/en/repositories/working-with-files/using-files/working-with-non-code-files#rendering-differences-in-prose-documents)). For a public repository you can also read the branch in the [GitHub README viewer](/github-readme-viewer) at an address like `docs-md.com/gh/owner/repo?ref=readme-update`, which shows the README together with the other markdown files in the repo and its `docs/` folder. The viewer does not read private repositories. Merge when it looks right.
## Can I render a README with GitHub's API?
Yes. GitHub's REST API has a `POST /markdown` endpoint that returns the HTML for any markdown you send ([GitHub Docs, Markdown API](https://docs.github.com/en/rest/markdown/markdown)). It works without a token for public use, within the unauthenticated limit of 60 requests per hour:
```bash
jq -Rs '{text: ., mode: "markdown"}' README.md \
| curl -s -X POST https://api.github.com/markdown -d @- > preview.html
```
Open `preview.html` in a browser to see the output, unstyled. In our tests on 2026-10-17 the endpoint did not match a repository README exactly. In `markdown` mode it left task lists and alerts as plain text. In `gfm` mode it rendered them but treated every single line break as a break, the way GitHub comments do, which READMEs do not. Relative image paths came back unchanged, so repository images do not load. The API is useful for scripts and checks in CI, less so as a visual preview.
## Which preview should I use for a quick check?
For most edits, the editor preview while you write, then one look at the branch or the Preview tab before you merge. If you only need to confirm the syntax of a single file, paste it into the [markdown viewer](/markdown-viewer), which renders GitHub Flavored Markdown in the browser without uploading anything. When you drop a local file in, only that file is read, so its relative images will not load; check those on GitHub.
## What usually looks different after the README is pushed?
The same handful of things, so check them first in any preview:
- **Line breaks.** A single newline does not break a line in a README; use a blank line, a trailing backslash or ` `.
- **Images.** Paths are case-sensitive on GitHub and relative to the README's folder; see [why README images are not showing](/github-readme-viewer/readme-images-not-showing).
- **HTML.** GitHub strips `style` attributes and scripts, so styled HTML that looked fine locally can lose its styling.
- **Alerts and task lists.** Non-GitHub previews may show them as plain quotes or bracketed text.
- **Mermaid and math.** VS Code's preview renders both, and GitHub documents support for [Mermaid diagrams](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-diagrams) and math in markdown files, but the two use separate renderers, so look at diagrams on GitHub too.
The [README formatting guide](/github-readme-viewer/how-to-format-readme-md) covers the syntax for each of these.
## Does the README preview show the same thing on npm or PyPI?
No. GitHub's preview shows GitHub's rendering, and package registries render the README with their own rules. Relative image paths are the usual casualty, because they are rewritten by GitHub but not necessarily by other sites. If the README will also be shown on a registry, use full image URLs that point at the raw file, as the [image guide](/guides/markdown-image) explains, and check the package page after publishing.
## Why are my README images not showing on GitHub?
URL: https://docs-md.com/github-readme-viewer/readme-images-not-showing
Updated: 2026-10-17
Usually the image is not on GitHub at the path the README gives: it was never committed or pushed, the letter case differs, or the relative path starts from the wrong folder. Less often, an external host blocks GitHub's image proxy. Open the image path on GitHub directly; a 404 there means a path problem.
The syntax itself is rarely the issue, since `` is hard to get wrong; the [image guide](/guides/markdown-image) covers it, along with resizing and dark-mode variants. This page is the GitHub-specific checklist, roughly in order of how often each cause turns out to be the answer.
## Is the image file actually in the repository?
Check this first, because it is the most common cause. An image that shows in your local preview is being read from your disk. GitHub can only show files that were committed and pushed to the branch you are looking at. Run these from the repository root:
```bash
git ls-files docs/images/ # tracked files in that folder
git status --short docs/images/ # untracked or changed files
git check-ignore -v docs/images/screenshot.png # is a .gitignore rule hiding it?
```
If `git ls-files` does not list the image, it was never committed. If `git check-ignore` prints a line, a `.gitignore` pattern (often a broad one like `*.png` or `docs/`) is excluding the file, and it names the rule. Commit the file, push, and reload the README. Also make sure you are viewing the branch you pushed to; the repository page shows the default branch.
## Could the letter case of the file name be wrong?
Yes, and it is the cause that is hardest to spot, because the image works on your computer. Paths on GitHub are case-sensitive: in our check, a raw file URL ending in `README.md` returned 200 and the same URL ending in `readme.md` returned 404. Common file systems on macOS and Windows are not case-sensitive, a fact Git's own documentation notes when it lists APFS, HFS+, FAT and NTFS ([git-config, core.ignoreCase](https://git-scm.com/docs/git-config#Documentation/git-config.txt-coreignoreCase)). So `` finds `images/logo.png` locally and fails on GitHub.
Compare the path in the README with the output of `git ls-files`, letter by letter, including folder names. Renaming only the case of a file needs `git mv` (for example `git mv images/Logo.png images/logo.png`) so that Git records the change on a case-insensitive disk.
## Is the relative path starting from the right folder?
A relative image path is resolved from the folder of the markdown file, not from the repository root. GitHub's docs describe the rules: paths are "relative to the current file", links starting with `/` are relative to the repository root, and `./` and `../` work as usual ([GitHub Docs, relative links and image paths](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-readmes#relative-links-and-image-paths-in-markdown-files)).
| README location | Image location | Path that works |
|---|---|---|
| `README.md` | `docs/img/a.png` | `docs/img/a.png` or `/docs/img/a.png` |
| `docs/README.md` | `docs/img/a.png` | `img/a.png` |
| `docs/README.md` | `assets/a.png` | `../assets/a.png` or `/assets/a.png` |
| `.github/README.md` | `assets/a.png` | `../assets/a.png` or `/assets/a.png` |
The last row catches people out: GitHub shows a README from the `.github` folder on the repository's front page, but relative paths still start from `.github/`. A path starting with `/` avoids the question, at the cost of not working in some other renderers.
## Does the file name contain spaces or special characters?
A space ends the image destination, so `` is not read as an image at all and shows up as text. Either rename the file (the simplest fix), write the space as `%20`, or wrap the path in angle brackets, which CommonMark allows for destinations that contain spaces ([CommonMark spec, link destination](https://spec.commonmark.org/0.31.2/#link-destination)):
```markdown

![Diagram]()
```
Parentheses, `#` and `?` in file names cause similar trouble because they have meaning in a URL. Lower-case names with hyphens avoid all of it.
## Why does an image from another website not load?
GitHub does not load external images directly in your reader's browser. It sends them through an image proxy called Camo, which fetches the image and serves it from a `githubusercontent.com` address ([GitHub Docs, About anonymized URLs](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/about-anonymized-urls)). That causes three kinds of failure:
1. **The host requires a login or is on a private network.** GitHub's docs say such an image "can't be viewed by GitHub" and advise moving it to a publicly available service.
2. **The server sends an unexpected content type.** Check with `curl -I https://example.com/image.png` and look at `Content-Type`; Camo only proxies the image types on its list.
3. **The image changed but GitHub shows the old one.** Camo caches images. The docs suggest serving them with `Cache-Control: no-cache` and describe how to purge one cached URL with `curl -X PURGE` as a last resort.
Hosts that refuse requests from other sites (hotlink protection) or delete files after a while also break images over time. Storing images in the repository and using relative paths avoids these problems entirely.
## Why do the images show on GitHub but not on npm or another site?
Because GitHub rewrites relative image paths for its own pages, and other sites that display your README may not. GitHub's docs say it transforms relative paths "based on whatever branch you're currently on"; a package registry or documentation site reading the same file has no such rule, so `docs/img/a.png` points nowhere. If the README is published elsewhere, use full URLs to the raw file, as the [image guide](/guides/markdown-image) shows. Images stored in a private repository fail there as well, since outside readers have no access to them; even on GitHub, its docs note that relative links to images in a private repository work only for viewers with at least read access.
## How can I check every image link at once?
For a public repository, open it in the [GitHub README viewer](/github-readme-viewer), which renders the README with the repository's relative images resolved; any image that is broken there is very likely broken on GitHub too, and the viewer links back to the file on GitHub. To list broken links and images in a markdown file, run it through the [markdown link checker](/markdown-link-checker). Before you push, the [README preview guide](/github-readme-viewer/preview-readme-before-push) explains which previews show unpushed images and which do not.
## Can a long README hide images?
Yes, at the very end. GitHub's docs say that when a README is viewed on GitHub, "any content beyond 500 KiB will be truncated", so images referenced after that point are not shown. Only very long READMEs reach that size; if yours does, move reference material into a `docs/` folder and link to it.
---
# README generator
URL: https://docs-md.com/readme-generator
Category: Generate
Updated: 2026-09-01
Fill in a form, get a professional README.md with live badges, install and usage sections, and a live preview.
## How do I open a README.md file?
URL: https://docs-md.com/readme-generator/how-to-open-readme-md
Updated: 2026-10-17
Open it with any text editor, because a README.md is plain text: Notepad on Windows, TextEdit on macOS, or any editor on Linux. You will see the markdown symbols as typed. To see it formatted, with real headings, lists and links, open it in a markdown viewer, in VS Code's preview, or on the project's GitHub page.
The `.md` extension means markdown, a way of writing formatting with ordinary characters: `#` before a heading, `*` around emphasis, `-` at the start of a list item. It was designed to read well even unformatted, so the raw file is usable. Nothing in it is executable or needs a special program, and opening it in a text editor is safe. The question is only whether you want to see the symbols or the formatted result. If you are not sure what the file is for, [what a README file is](/readme-generator/what-is-a-readme-file) explains the convention.
## How do I open a README.md file on Windows?
Right-click the file, choose **Open with**, and pick **Notepad**. If Windows asks how you want to open the file, choose Notepad and, if you like, tick the option to always use it for `.md` files. Any code editor you already have, such as VS Code or Notepad++, also works. Double-clicking may do nothing useful if no program is associated with `.md`, which is why the right-click route is more reliable the first time.
## How do I open a README.md file on a Mac?
Control-click the file, choose **Open With**, and pick **TextEdit**. TextEdit shows the raw markdown. If it opens the file in rich-text mode or the characters look wrong, it is still the same text; nothing is lost. For a formatted view, use one of the viewers below.
## How do I open a README.md file on Linux or in a terminal?
Any editor opens it (gedit, Kate, nano, vim). On Linux and macOS, these print the raw text or page through it in a terminal:
```bash
cat README.md
less README.md
```
On Windows, `type README.md` does the same in Command Prompt and `Get-Content README.md` in PowerShell.
For a formatted view inside the terminal, [Glow](https://github.com/charmbracelet/glow) renders markdown with styled headings, lists and code. Its README lists installs such as `brew install glow` and `winget install charmbracelet.glow`, and then:
```bash
glow README.md
```
## How do I see a README.md formatted instead of as raw text?
You have four options, from no installation to most control:
1. **In your browser.** Open the [markdown viewer](/markdown-viewer), click **Open .md file** (or drop the file on the panel, or paste its text), and it renders the file with headings, tables, code highlighting and Mermaid diagrams. You can also paste a raw or GitHub file URL to load it.
2. **On GitHub or GitLab.** If the README belongs to a repository, the project's front page already shows it formatted. GitHub's [README documentation](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-readmes) says it looks for the file in the `.github` folder, the root and the `docs` folder, in that order, and also adds an outline menu built from the headings. To read a repository's README and its docs folder as formatted pages, paste the repository URL into the [GitHub README viewer](/github-readme-viewer).
3. **In VS Code.** Open the file and press Ctrl+Shift+V (Cmd+Shift+V on macOS) to switch to the preview, or Ctrl+K V (Cmd+K V) to open the preview beside the text, per the [VS Code documentation](https://code.visualstudio.com/docs/languages/markdown).
4. **As an HTML file.** With Pandoc installed, convert it and open the result in any browser:
```bash
pandoc -s README.md -o README.html
```
## Why does my README look different in different places?
Because "markdown" covers several dialects. GitHub uses GitHub Flavored Markdown, which adds tables, task lists, strikethrough and alerts; a basic viewer may show those as plain text. Relative links and images such as `` only work where the viewer can see the rest of the repository, so they break when you open a single downloaded file in a browser tool. HTML inside the file is shown, stripped or escaped depending on the viewer. If something looks broken in one place, check it on the code host where the project lives, since that is what the author tested against.
## Can I edit a README.md file?
Yes, in the same text editor you opened it with. Save it as plain text with the `.md` extension, not as `.rtf` or `.docx`; TextEdit in particular may try to save rich text, so use **Format > Make Plain Text** first if it offers. Keep the markdown symbols intact, and preview the result before you commit it. If you are writing one from scratch, the [README generator](/readme-generator) fills in a standard layout from a form, shows a live preview and downloads a ready `README.md`; [headings](/guides/markdown-headings) and the other syntax guides cover the formatting by hand.
## What if the file is called README without .md, or README.rst?
`README` with no extension and `README.txt` are plain text; open them exactly the same way. `README.rst` is reStructuredText, a different markup language common in older Python projects: it is also readable as plain text, and GitHub renders it formatted, but markdown viewers will not interpret its syntax. `README.adoc` is AsciiDoc, which likewise reads fine raw. On the command line, Pandoc can convert reStructuredText to HTML in the same way as markdown.
## Is it safe to open a README.md file?
Yes. A markdown file is text and cannot run anything when you open it, in a text editor or in a viewer. The care needed is with what it tells you to do. A README often contains install commands and links, and those are only as trustworthy as the project. Before pasting a command such as `curl ... | sh` from the README of a project you do not know, read what it downloads and where from. Links in a rendered README can point anywhere, exactly like links on a web page, so check the address before you follow one that asks for a login.
## Why won't my README.md open on my phone?
Phones often have no app associated with `.md` files. The simplest fix is to open the repository page in your phone's browser, where the README is shown formatted. If you have only the file, a text-editor app opens it as plain text, or you can open the browser-based markdown viewer and choose the file from your device. Large READMEs with wide tables are easier to read in landscape.
## What is a README file?
URL: https://docs-md.com/readme-generator/what-is-a-readme-file
Updated: 2026-10-17
A README file is a plain-text introduction to a project, kept in its top folder. It tells a newcomer what the project is, why it exists, how to install and run it, and where to find help. Today it is usually `README.md`, written in markdown, and code hosts like GitHub show it on the project's front page.
The name is literal: it is the file you are meant to read first. The convention is decades older than GitHub. Software distributed on tapes, floppy disks and FTP servers shipped with a file called `README` so that whoever unpacked the archive had an obvious starting point, and the GNU coding standards still ask every package to include one with a general overview. What changed is where people read it. A README used to be opened in a terminal after downloading; now it is the landing page of a repository, a package page on npm or PyPI, and often the first thing an AI coding assistant reads when it is pointed at a codebase.
## What does a README file do?
A README answers the questions a stranger has in the first minute: what is this, is it for me, and how do I start? Everything else in a project (the source, the tests, the full documentation) assumes the reader already decided to engage. The README is where that decision is made.
In practice it does four jobs:
- **Orientation.** One or two sentences that say what the project does and for whom. If a reader cannot tell from the opening whether this solves their problem, the rest of the file does not get read.
- **Getting started.** The shortest path from nothing to a working result: requirements, the install command, and one example of real use.
- **Navigation.** Links to the places the README does not cover in depth, such as full documentation, the changelog, the issue tracker and the contribution guide.
- **Terms.** The license, and for many projects the support status (maintained, experimental, archived) so nobody builds on something that is abandoned.
A README is not a manual. Its job is to get someone to the second step, not to answer every question they will ever have.
## What should a README contain?
There is no required structure, but most good READMEs share the same skeleton, in roughly this order:
1. **Project name and a one-line description.** Plain language, no slogans.
2. **Badges (optional).** Build status, latest version, license. Useful when they are live; noise when they are not.
3. **What it does and why.** A short paragraph, sometimes a screenshot or a diagram.
4. **Installation.** Exact commands in a code block, plus prerequisites such as the runtime version.
5. **Usage.** The smallest example that does something real, with its output if that helps.
6. **Configuration.** Only the options most people need; link to the rest.
7. **Contributing.** How to report a bug, run the tests and open a pull request, or a link to `CONTRIBUTING.md`.
8. **License.** The license name and a link to the `LICENSE` file.
Commands and example code belong in fenced code blocks with a language tag so they get syntax highlighting; the [code block guide](/guides/markdown-code-block) covers the syntax. Long READMEs benefit from a table of contents near the top, which the [markdown TOC generator](/markdown-toc-generator) can build from your headings.
Which sections matter depends on the project. A library needs an installation command and an API example. An application needs a screenshot and a download link. A dataset needs its source, its schema and its license more than any install step. A course or a notes repository may need nothing more than what it is and how it is organised. If you would rather fill in a form than start from a blank file, the [README generator](/readme-generator) produces this skeleton with a live preview, and the [README templates](/readme-templates) page has copyable starting points for libraries, apps, CLIs and data projects.
## Where does a README file go?
Put it in the root folder of the project, next to the code it describes. That is where people look and where tools look. GitHub also recognises a README in a `.github` or `docs` folder and shows it on the repository's front page, and a README inside any subfolder is displayed when someone browses into that folder, which is a handy way to explain what a directory is for.
Package registries read the same file. npm includes the README in the published package and displays it on the package page; Python projects usually point their packaging metadata at the README so PyPI shows it as the project description. Writing one good README therefore covers the repository and the package listing at once.
## What format should a README be in?
Markdown, in a file named `README.md`, unless your ecosystem has a different habit. Markdown reads cleanly as raw text in a terminal and renders as formatted headings, lists, tables and links on every major code host. Other formats you will meet:
| File | Format | Where it is common |
|---|---|---|
| `README.md` | Markdown | GitHub, GitLab, npm, most new projects |
| `README.rst` | reStructuredText | Older Python projects, Sphinx-based docs |
| `README.txt` or `README` | Plain text | Older Unix software, archives, some C projects |
| `README.adoc` | AsciiDoc | Some Java and documentation-heavy projects |
The uppercase name is a convention, not a rule. One commonly cited reason for it is that in a plain ASCII sort, capital letters come before lowercase ones, so `README` floats to the top of a directory listing on systems that sort that way. Code hosts match the name case-insensitively, but `README.md` is what everyone expects to see. Use [headings](/guides/markdown-headings) to structure it, because many renderers turn them into anchor links and an outline.
## How do you open a README.md file?
A `.md` file is plain text, so any text editor opens it: Notepad, TextEdit, VS Code, vim. You will see the markdown symbols (`#` for headings, `*` for emphasis) rather than formatting, which is still readable by design. To see it rendered, open the repository on GitHub or GitLab, use the preview in an editor such as VS Code (the preview command opens it side by side), or paste a repository URL into the [GitHub README viewer](/github-readme-viewer) to read its README and docs folder as formatted pages.
## Is a README the same as documentation?
It is the front door of the documentation, not the whole house. Small projects can fit everything they need in the README. Once a project has many options, several audiences or a long API, the README should stay short and link out to a documentation site or a `docs/` folder. A useful test: if a section is something only an existing user would look up, it probably belongs in the full docs rather than the README.
Other conventional files take some load off it as well. `CONTRIBUTING.md` holds the contribution process, `CHANGELOG.md` the release history, `LICENSE` the legal text, `CODE_OF_CONDUCT.md` the community rules and `SECURITY.md` how to report vulnerabilities. GitHub links several of these automatically from the repository page, so the README only needs a line pointing to each.
## How long should a README be?
As long as it takes to get a new reader to a first working result, and no longer. For a small library that might be a screen and a half. Signs a README has grown too long: the install command is far below the fold, sections repeat what the full docs say, or the changelog lives inside it. Signs it is too short: no example of real use, no install instructions, or no indication of what the project actually does. Keep it current, because an outdated README with commands that no longer work does more harm than a brief one.
## What should a README contain?
URL: https://docs-md.com/readme-generator/what-should-a-readme-contain
Updated: 2026-10-17
A README should contain the project's name and a one-line description, what it does and who it is for, how to install it, a short usage example, how to get help or contribute, and the license. Those six parts answer a newcomer's first questions. Everything else, such as badges, screenshots and configuration, is optional and depends on the project.
GitHub's own [documentation on READMEs](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-readmes) puts it as five questions: what the project does, why it is useful, how users can get started, where they can get help, and who maintains and contributes to it. The same page adds that a README should hold only what people need to start using and contributing, with longer documentation kept elsewhere. If you are new to the file itself, start with [what a README file is](/readme-generator/what-is-a-readme-file); this page goes section by section.
## What is the minimum a README needs?
A title, one sentence saying what the project does, an install command and one example of use. A reader who gets those four things can decide whether the project fits and try it within a minute. A license line is the fifth item for anything public, because without a license other people have no clear permission to use the code. Everything beyond that is there to save the reader time, not to fill space.
```markdown
# csvtrim
Removes empty rows and trailing spaces from CSV files.
## Install
pip install csvtrim
## Usage
csvtrim input.csv -o clean.csv
## License
MIT
```
## What goes in each section?
Here is what good looks like in each common section, in the order most READMEs use:
- **Title and one-liner.** The project name as the only H1, then a plain sentence: "Removes empty rows and trailing spaces from CSV files." Not "a blazing-fast next-generation data tool." Say what it does, not how you feel about it.
- **Badges.** Optional. Build status, latest version and license are the useful ones, because they answer real questions (does it build, is it current, can I use it). The [badge generator](/markdown-badge-generator) writes the markdown for shields.io badges. Remove badges that point at services you no longer use.
- **Description.** Two to four sentences: the problem, who has it, and how this project handles it. A screenshot or a short animated capture belongs here for anything with a user interface.
- **Installation.** Prerequisites first (runtime version, system packages), then the exact command in a fenced code block that can be copied as it is. If there are several ways to install, give the most common one first.
- **Usage.** The smallest example that does something real, ideally with its output. Use realistic names, not `foo` and `bar`, so the example also shows what the project is for.
- **Configuration.** Only the options most people change, in a short table of name, default and meaning. Link to the full list.
- **Documentation and help.** Where the full docs live, where to ask questions, and where to report bugs.
- **Contributing.** How to set up a development copy, run the tests and open a pull request, or a link to `CONTRIBUTING.md`.
- **License.** The license name and a link to the `LICENSE` file.
## How does a README change by project type?
The core stays the same, but the weight shifts:
| Project type | Put first | Usually needs | Usually skip |
|---|---|---|---|
| Library | Install command, API example | Supported versions, link to API docs | Screenshots |
| Command-line tool | Install, one command with output | Common flags, exit codes if scripted | Long API reference |
| Web or desktop app | Screenshot, download or live link | System requirements, how to build from source | Package badges |
| Dataset | Source, schema, size | License and citation, how it was collected | Install steps |
| Internal service | Owner, how to run locally | Environment variables, deploy process, on-call contact | Marketing description |
A team's internal repository needs different answers from an open-source one: who owns it, how to run it, and what breaks if it goes down matter more than badges.
## What should a README leave out?
Leave out anything that has a better home. The full API reference belongs in documentation, release history in `CHANGELOG.md`, the contribution process in `CONTRIBUTING.md`, and vulnerability reporting in `SECURITY.md`. Leave out secrets, internal hostnames and real credentials, including in examples. Leave out instructions you have not tested, since a wrong install command costs more trust than a missing one. Also leave out walls of badges, long tables of contributors' avatars and sections that only say "coming soon".
On GitHub there is a practical limit too: the README documentation says content beyond 500 KiB is truncated when the file is viewed on the site. Few READMEs come close, but generated tables and embedded data can.
## How long should each section be?
Short enough that the install command is visible without much scrolling. The opening (title, one-liner, description) should fit in the first screen. Installation and usage are best at a few lines each. If any section needs subheadings of its own, it is probably documentation and should move to a `docs/` folder or a wiki with a link from the README. Long READMEs are easier to use with a table of contents; GitHub already shows an outline menu built from your headings, and the [TOC generator](/markdown-toc-generator) adds one inside the file for other sites and for raw text readers.
## How do I write a README quickly?
Fill in the [README generator](/readme-generator): it has fields for the name, tagline, description, features, install command, a usage example with its language, the license and author, optional badges from an npm package name or GitHub repository, and an optional contributing section. It shows a live preview and lets you copy or download `README.md`. It produces a solid general-purpose skeleton, not a finished file: it has no fields for screenshots, configuration tables or dataset details, so add those by hand. The [README templates](/readme-templates) page has longer starting points for specific project types.
## Is there an official README standard?
No. There is no required format or section list; GitHub, GitLab and package registries display whatever the file contains. What exists are conventions: the file name `README.md`, markdown formatting, the section order above, and community files such as `LICENSE` and `CONTRIBUTING.md` that code hosts link to automatically. Some ecosystems add expectations of their own, for example registries that show the README as the package description, so the opening sentence doubles as the package summary.
## How do I know if my README is good enough?
Hand it to someone who has never seen the project and watch them. If they can say what it does after the first paragraph and reach a working result using only the README, it is good enough. Any question they have to ask you is a missing sentence. Repeat the test after big changes, and run the install and usage commands yourself before each release so they do not drift out of date.
---
# Agent handoff document generator (HANDOFF.md)
URL: https://docs-md.com/handoff-generator
Category: Generate
Updated: 2026-10-15
Fill in goal, state, commands, key files, decisions and next steps; get a complete HANDOFF.md for the next developer or AI coding agent, with a live preview.
---
# Table of contents generator
URL: https://docs-md.com/markdown-toc-generator
Category: Generate
Updated: 2026-08-29
Paste a document, get a linked TOC with GitHub-exact anchor slugs — choose depth, insert it under your title.
## How do I add a table of contents to a GitHub README?
URL: https://docs-md.com/markdown-toc-generator/github-readme-table-of-contents
Updated: 2026-10-17
Add a nested bullet list near the top of the README in which every item links to a heading's anchor, for example `#installation` for the Installation section. GitHub gives every heading an anchor automatically, so you only write the list. GitHub's own generated outline sits in a menu, not in the page.
Here is what a finished table of contents looks like in the markdown source, placed under the project title:
```markdown
# my-project
A command-line tool that converts logs to CSV.
## Table of contents
- [Installation](#installation)
- [Usage](#usage)
- [Options](#options)
- [Examples](#examples)
- [Contributing](#contributing)
- [License](#license)
## Installation
...
```
Each link target is the heading text turned into a slug: lower case, spaces replaced by hyphens, punctuation removed. Indent child items by two spaces (or to line up under the parent's text) so that H3 headings nest under their H2.
## Does GitHub generate a table of contents automatically?
Yes, but not inside the file. For any rendered markdown file in a repository, including READMEs, GitHub builds a table of contents from the headings and shows it behind the "Outline" icon in the top corner of the file view ([GitHub Docs, About READMEs](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-readmes#auto-generated-table-of-contents-for-markdown-files)). You do not have to write anything to get it. Its limits are that a reader has to find and open the menu, and it exists only in GitHub's interface, so it does not travel with the file to package registries, documentation sites, or a clone opened in an editor. A written TOC appears wherever the markdown is rendered.
## How do I build the list without typing every anchor?
Paste the README into the [markdown TOC generator](/markdown-toc-generator). It reads the headings, creates the anchors with the same slug rules GitHub uses, and gives you a list you can copy or insert under the H1. You can limit the depth (H2 and H3 is usually enough for a README), choose a numbered or bulleted list, and leave the H1 out so the project name does not link to itself. The tool runs in the browser and does not upload the file.
If you prefer to write it by hand, GitHub documents the rules it uses to turn a heading into an anchor ([section links](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#section-links)):
- Letters are converted to lower case.
- Spaces become hyphens; other whitespace and punctuation are removed.
- Leading and trailing whitespace is removed.
- Markup is removed, so `_italics_` becomes `italics`.
- A heading whose anchor matches an earlier one gets `-1`, `-2` and so on appended.
So `## What's new in v2?` links as `#whats-new-in-v2`, and a second `## Examples` heading links as `#examples-1`. Non-English letters are kept rather than removed; GitHub's own example turns a heading ending in "Θ!" into an anchor ending in `-θ`. The [anchor link guide](/guides/markdown-anchor-link) covers the edge cases (emoji, dots in version numbers, links into other files) in more detail.
## Where should the table of contents go in a README?
Directly after the title and the one- or two-sentence description, before the first real section. Readers decide in the first screen whether the project is for them, so the description should stay above the TOC rather than be pushed down by it. A heading such as `## Table of contents` or `## Contents` above the list makes it easy to find and gives it its own anchor, which you can use for "back to top" links in very long files.
Only add one if the README needs it. A file with four short sections scrolls faster than it can be navigated, and the TOC becomes noise. A practical threshold is when the README runs past two or three screens or has more than five or six H2 sections.
## Why do some links in my README table of contents not work?
Almost always because the anchor no longer matches the heading. Common causes:
1. **The heading was renamed.** GitHub notes that if you edit a heading, links to it must be updated too, because the anchor changes.
2. **Punctuation was kept in the link.** `#what's-new` does not match; the apostrophe is dropped, so it is `#whats-new`.
3. **Capital letters.** `#Installation` may appear to work in some places but the generated anchor is `#installation`; use lower case.
4. **A duplicate heading.** The second `## Examples` is `#examples-1`, not `#examples`.
5. **The link text spans two lines.** GitHub's docs say link text should be on a single line, or the link breaks.
To check every link at once, open the repository in the [GitHub README viewer](/github-readme-viewer) or run the [markdown link checker](/markdown-link-checker) on the file. Regenerating the list from the current headings with the TOC generator is usually faster than hunting for the one stale link.
## Can I hide a heading from the table of contents?
In a hand-written or generated list, simply delete that item; nothing links to a heading unless you write the link. GitHub's automatic Outline is different: it lists every heading and cannot be configured from the file. If you need a jump target that is not a heading, GitHub supports a custom HTML anchor such as ``, and its docs note that custom anchors are not included in the document outline. Keep these to a minimum, since a plain [heading](/guides/markdown-headings) is easier to maintain.
## How do I keep the table of contents up to date?
The list is plain text, so it does not update itself when headings change. Three habits keep it accurate. Regenerate it whenever you add, remove or rename an H2 or H3 rather than editing single lines. Keep headings short and free of punctuation that matters, so anchors stay stable across edits. And if you edit the README in VS Code, an editor extension can rewrite the TOC on save; the [VS Code TOC guide](/markdown-toc-generator/vs-code-markdown-toc) explains how and what to configure so its anchors match GitHub's.
## Should the TOC be a numbered or bulleted list?
Bulleted is the usual choice and the safer one, because adding a section does not renumber the list. A numbered list makes sense when the README is a sequence, such as setup steps that must happen in order. Either way, nesting uses the same indentation rules as any other list; the [nested list guide](/guides/markdown-nested-list) shows how far to indent child items so they render as a sub-list instead of a paragraph.
## How do I make a table of contents in Obsidian?
URL: https://docs-md.com/markdown-toc-generator/obsidian-table-of-contents
Updated: 2026-10-17
Obsidian has no built-in command that writes a table of contents into a note. For navigation, use the Outline core plugin, which lists the note's headings in a side panel. For a TOC inside the note, write a list of heading links in the form `[[#Heading name]]`, or install a community plugin that generates and updates one for you.
Which one you want depends on who the TOC is for. If it is only for you while you work in the note, the Outline panel is enough and needs no upkeep. If the note will be read by others, exported, or published somewhere else, a list written into the note travels with the file. The sections below cover each route and the formats that keep working outside Obsidian.
## How do I use the Outline panel as a table of contents?
Outline is a core plugin that "lists the headings in the active note" ([Obsidian Help, Outline](https://obsidian.md/help/plugins/outline)). Click a heading in the panel to jump to that section. You can also drag a heading within the outline to move the whole section, which makes it a quick way to reorder a long note. If you do not see the Outline panel, open **Settings → Core plugins** and make sure Outline is turned on; Obsidian's help notes that some core plugins are disabled by default.
The outline updates as you type, and it reflects heading levels as nesting, so a clean heading hierarchy (H2 sections, H3 subsections, no skipped levels) gives you a clean outline. The [headings guide](/guides/markdown-headings) explains the levels and the syntax. The limit is that Outline is part of the app's interface, not of the note. It does not appear in the note's text, in an export, or on another device that opens the file in a different editor.
## How do I write a table of contents inside a note?
Write a bulleted list of internal links to the note's own headings. In Obsidian, a link to a heading in the same note is `[[#` followed by the heading text ([Obsidian Help, Internal links](https://obsidian.md/help/links#Link%20to%20a%20heading%20in%20a%20note)):
```markdown
## Contents
- [[#Goals]]
- [[#Plan]]
- [[#Plan#Timeline|Timeline]]
- [[#Plan#Budget|Budget]]
- [[#Open questions]]
```
You do not need to type the heading names exactly. Type `[[#` and Obsidian shows a list of the headings in the current note; pick one and it completes the link. The help page also documents linking to a subheading by chaining hashes, as in `[[#Plan#Timeline]]`, and changing the visible text with a vertical bar, as in `[[#Plan#Timeline|Timeline]]`, which keeps the list readable. Indent child items under their parent with a tab or spaces, as you would for any [nested list](/guides/markdown-nested-list).
Unlike GitHub, Obsidian does not turn headings into slugs. A link to a heading uses the heading's own text. If you rename a heading, Obsidian can update links to it automatically; that behavior is controlled by **Settings → Files and links → Automatically update internal links**, according to the same help page.
## Can I get a table of contents that updates itself in Obsidian?
Yes, with a community plugin. Several are listed in Obsidian's community plugin directory; one of them, Automatic Table Of Contents, renders a TOC from a code block and refreshes it when the note changes ([plugin README](https://github.com/johansatge/obsidian-automatic-table-of-contents)):
````markdown
```table-of-contents
title: **Contents**
minLevel: 2
maxLevel: 3
```
````
Options include `style` (`nestedList`, `nestedOrderedList` or `inlineFirstLevel`), `minLevel` and `maxLevel` for heading depth, and `include` and `exclude` patterns. To install any community plugin, open **Settings → Community plugins**, turn off Restricted mode, then browse, install and enable the plugin ([Obsidian Help, Community plugins](https://obsidian.md/help/community-plugins)).
Be clear about the trade-off. The plugin's README says the TOC "doesn't generate real Markdown in the document", so it "won't be visible when exporting, or on Obsidian Publish", and links might not work in PDFs. Outside Obsidian the code block is shown as a plain code block. Community plugins are also third-party code, which is why Obsidian keeps them off until you turn off Restricted mode.
## How do I make an Obsidian TOC that also works on GitHub?
Use standard markdown links with GitHub-style anchors instead of wikilinks. GitHub does not understand `[[#Heading]]` and will show it as plain text, so a note that will also live in a repository needs links like `[Open questions](#open-questions)`. You can generate that list by pasting the note into the [markdown TOC generator](/markdown-toc-generator), which builds anchors with GitHub's rules.
Check the result inside Obsidian as well. Obsidian's documented markdown form for heading links uses the heading text, for example `[Section name](Example.md#Details)`, with spaces written as `%20`, while GitHub uses lower-case slugs with hyphens. A TOC built for one may not navigate in the other, so test the links in both places before relying on them. The [anchor link guide](/guides/markdown-anchor-link) compares how GitHub, Obsidian and other platforms form heading anchors, and the [GitHub README TOC guide](/markdown-toc-generator/github-readme-table-of-contents) covers placement on GitHub.
## Should I switch Obsidian to markdown links instead of wikilinks?
Only if the notes need to be read outside Obsidian. Obsidian's help explains that it creates wikilinks by default because they are more compact, and that you can switch by turning off **Use [[Wikilinks]]** under **Settings → Files and links**. After that, typing `[[` still opens the suggestion list, but Obsidian inserts a markdown link instead. That makes new links more portable, but it does not convert links you already wrote, and wikilinks remain easier to type and read. The [Obsidian markdown reference](/obsidian-markdown) lists the other syntax that only Obsidian understands.
## Why is my Obsidian table of contents link not working?
The heading text in the link no longer matches the note. Common reasons are a heading that was edited by hand while automatic link updates were off, a typo or different spacing in the link, or a heading that contains characters Obsidian warns against in links, such as `#`, `|`, `^`, `:` or `[[ ]]`. Retyping the link with `[[#` and choosing the heading from the suggestion list is the quickest fix. For TOCs built with GitHub-style slugs, the cause is usually the anchor format, as described above.
## Is a written table of contents worth it for short notes?
Usually not. A note with three or four sections is faster to scroll than to navigate, and the Outline panel already covers it with no upkeep. A written list earns its place in long reference notes, notes that other people read, and notes you export or publish, where the Outline panel is not available.
## How do I generate a Markdown table of contents in VS Code?
URL: https://docs-md.com/markdown-toc-generator/vs-code-markdown-toc
Updated: 2026-10-17
VS Code cannot generate a table of contents on its own: its built-in Markdown support shows an outline of your headings but never writes one into the file. Install the Markdown All in One extension and run "Create Table of Contents" from the Command Palette, or paste the file into a browser TOC generator.
The difference matters because the two things look similar. VS Code's Outline view, at the bottom of the Explorer sidebar, shows "the Markdown file's header hierarchy" so you can jump around while editing ([VS Code docs, Markdown](https://code.visualstudio.com/docs/languages/markdown#_document-outline)). That outline lives in the editor. Readers of the rendered file on GitHub or elsewhere never see it. A table of contents is markdown text inside the file: a list of links to each heading's anchor.
## How do I create a TOC with Markdown All in One?
Install the extension, open the markdown file, and run its command. Step by step:
1. Open the Extensions view, search for **Markdown All in One** (identifier `yzhang.markdown-all-in-one`) and install it.
2. Put the cursor where the table of contents should go, usually on a blank line under the H1 title.
3. Open the Command Palette (Ctrl+Shift+P on Windows and Linux, Cmd+Shift+P on macOS) and run **Markdown All in One: Create Table of Contents**.
The extension inserts a nested list of links. By default it updates that list every time you save the file, so renamed or added headings are picked up without another command; turn this off with the `markdown.extension.toc.updateOnSave` setting. There is also an **Update Table of Contents** command for manual control. These commands and settings are documented in the extension's README ([Markdown All in One](https://github.com/yzhang-gh/vscode-markdown#table-of-contents)).
## Which settings control the generated TOC?
All of them are under `markdown.extension.toc` in `settings.json`. The ones most people change:
| Setting | Default | What it does |
|---|---|---|
| `markdown.extension.toc.levels` | `1..6` | Which heading levels are included; `2..3` suits most READMEs |
| `markdown.extension.toc.slugifyMode` | `github` | How anchors are built: `github`, `gitlab`, `gitea` or `vscode` |
| `markdown.extension.toc.orderedList` | `false` | Numbered list instead of bullets |
| `markdown.extension.toc.unorderedList.marker` | `-` | Bullet character: `-`, `*` or `+` |
| `markdown.extension.toc.updateOnSave` | `true` | Rewrite the TOC on every save |
| `markdown.extension.toc.omittedFromToc` | `{}` | Headings to leave out, per file |
```json
{
"markdown.extension.toc.levels": "2..3",
"markdown.extension.toc.slugifyMode": "github"
}
```
Set `slugifyMode` to match where the file will be read. The anchor rules differ slightly between platforms, and a TOC built with the wrong rules has links that work in one place and not in another. The [anchor link guide](/guides/markdown-anchor-link) lists how GitHub, GitLab and others turn headings into anchors.
## How do I leave a heading out of the TOC in VS Code?
Add the comment `` at the end of the heading line (or on the line above it), and Markdown All in One skips that heading. You can also narrow the levels with `markdown.extension.toc.levels`, or list headings to skip for a given file in `markdown.extension.toc.omittedFromToc`. If the extension mistakes an ordinary list of links for a table of contents and starts rewriting it, its README says to put `` above that list. Both comments are invisible in the rendered output on GitHub, as explained in the [markdown comment guide](/guides/markdown-comment).
## Can I write a TOC in VS Code without an extension?
Yes, by hand with the help of built-in link completions. In a markdown file, type `[Installation](#` and VS Code suggests every heading in the current file; picking one inserts its anchor. Typing `##` inside a link's target suggests headings from all markdown files in the workspace and inserts the full path, such as `docs/setup.md#requirements` (controlled by `markdown.suggest.paths.includeWorkspaceHeaderCompletions`). This works well for a short TOC, but you have to edit it yourself whenever a heading changes.
A faster route without installing anything is to copy the file into the [markdown TOC generator](/markdown-toc-generator), choose the depth and list style, and paste the result back. It builds anchors with GitHub's rules and runs in the browser, so nothing is uploaded. The trade-off is that it is a one-off copy: the TOC will not update on save.
## How do I check that the TOC links work?
Open the preview and click through them. **Markdown: Open Preview to the Side** (Ctrl+K V, or Cmd+K V on macOS) shows the rendered file next to the source; **Markdown: Open Preview** toggles to it with Ctrl+Shift+V or Cmd+Shift+V. For a check that does not involve clicking, turn on link validation with `"markdown.validate.enabled": true`. VS Code then reports links to headers that do not exist in the current file and in other markdown files. The docs note that it checks local links only, not external URLs.
One caveat: the VS Code preview is not GitHub. Its docs say it targets CommonMark using the markdown-it library rather than GitHub Flavored Markdown, so a link that works in the preview can still fail on GitHub if the anchor rules differ. If GitHub is the destination, keep `slugifyMode` on `github` and do a final check there, or in the [GitHub README viewer](/github-readme-viewer) once the file is pushed.
## Why did my TOC links break after renaming a heading?
Because the anchor is derived from the heading text, so a new heading means a new anchor. If Markdown All in One updates the TOC on save, the list is fixed for you, but links to that heading elsewhere in the file or in other files are not. VS Code's built-in **Rename Symbol** command helps here: run it on a heading and, according to the VS Code docs, it "updates the header and automatically updates all links to that header" across the workspace. Use it instead of retyping the heading when other files link to the section.
## Does the TOC work the same on GitHub?
Yes, if the anchors were built with GitHub's rules, which is the extension's default. GitHub also offers its own generated outline from a menu on every rendered markdown file, so a README there has two kinds of navigation. The [GitHub README TOC guide](/markdown-toc-generator/github-readme-table-of-contents) explains when the written list is still worth having and where to place it.
---
# Link, image & code block generator
URL: https://docs-md.com/markdown-link-generator
Category: Generate
Updated: 2026-08-29
Fill in a form, get correct markdown for links (with tooltips and reference style), sized images, and fenced code.
---
# Markdown badge generator
URL: https://docs-md.com/markdown-badge-generator
Category: Generate
Updated: 2026-09-03
Design shields.io badges with a live preview — label, message, color, style, logo — and copy them as markdown, HTML, or reStructuredText.
---
# Changelog generator
URL: https://docs-md.com/changelog-generator
Category: Generate
Updated: 2026-09-03
Build a CHANGELOG.md in Keep a Changelog format — or paste your git log and let conventional commits sort themselves into Added, Fixed, and Changed.
---
# Front matter generator
URL: https://docs-md.com/front-matter-generator
Category: Generate
Updated: 2026-09-03
Generate valid YAML, TOML, or JSON front matter for Jekyll, Hugo, Astro, Docusaurus, or Obsidian — dates, tags, slugs, and custom fields, escaped correctly.
---
# Markdown linter
URL: https://docs-md.com/markdown-lint
Category: Check & compare
Updated: 2026-09-03
Find heading, list, spacing, and link problems in a document — every finding explained, most of them fixable with one click.
---
# Markdown diff checker
URL: https://docs-md.com/markdown-diff
Category: Check & compare
Updated: 2026-09-03
Compare two versions of a document side by side or as a unified patch, with word-level highlights inside changed lines.
---
# Markdown link checker
URL: https://docs-md.com/markdown-link-checker
Category: Check & compare
Updated: 2026-09-03
Extract every link from a document and check it — dead pages, redirects, and broken #anchors — with the line each one is on.
---
# Markdown word counter
URL: https://docs-md.com/markdown-word-counter
Category: Check & compare
Updated: 2026-09-03
Word, character, sentence, and paragraph counts that ignore markdown syntax and code — plus reading time and heading, link, and image totals.
---
# Markdown viewer
URL: https://docs-md.com/markdown-viewer
Category: Edit & share
Updated: 2026-10-05
Open a .md file — drag it in, paste, or load from a URL — and read it rendered with tables, code highlighting, and mermaid diagrams. Print or share it.
## What is the difference between a markdown reader and a markdown editor?
URL: https://docs-md.com/markdown-viewer/md-file-reader-vs-editor
Updated: 2026-10-20
A markdown reader, also called a viewer, opens a .md file and shows it formatted so you can read it. A markdown editor is for writing and changing the file, usually with a live preview next to the source. Readers need no setup. Editors add saving, file management and writing aids. Many tools do a bit of both.
The two words get mixed up because most editors include a preview and many viewers let you type. The useful question is what you are doing with the file. If someone sent you a README, release notes or a document exported from an AI chat and you want to read it, you need a reader. If you maintain the file, you need an editor.
## What does a markdown reader do?
It turns markdown source into a formatted document and gets out of the way. A good reader renders headings, lists, tables, links, images, code blocks with syntax highlighting, and the extensions people actually use, such as task lists, footnotes and Mermaid diagrams. It offers reading comforts: a table of contents or outline, adjustable type size, a print layout. It does not need to save anything. Browser-based readers like the [markdown viewer](/markdown-viewer) open a file you drop in, render it locally, and are done; there is nothing to install or configure. Quick Look extensions on macOS and browser extensions that render `.md` links are readers too.
## What does a markdown editor do?
It is where you write. An editor saves the file, manages folders of files, and helps with the writing itself: shortcuts that insert bold or link syntax, auto-continuing lists, spell checking, search across files. Most show a preview, either side by side with the source (VS Code, many code editors) or blended into one view where the symbols disappear as you type (Typora, and Obsidian's live preview mode). Some add structure on top of markdown, such as links between notes, tags or publishing to a website. VS Code's [built-in preview](/markdown-viewer/preview-markdown-in-vs-code) is a common example of the side-by-side approach.
## Do I need an editor just to read a .md file?
No. Opening a file in an editor works, but it is more than you need, and editors open the source by default, so you still see `#` and `*` until you switch to the preview. A reader shows the formatted version immediately. If the symbols are what put you off, [why a .md file shows # and * symbols](/markdown-viewer/why-md-file-shows-symbols) explains where they come from. Installing an editor makes sense once you start writing or changing markdown files yourself.
## Can a plain text editor be a markdown editor?
Yes. Markdown is plain text, so Notepad, TextEdit, nano or any code editor can create and change a `.md` file. What they lack is the preview and the writing aids. Many people write markdown in a plain editor and check the result in a separate reader, which works well: write in the tool you know, then drop the file into a viewer to make sure the tables and code blocks render the way you expect. Recent versions of Windows 11 Notepad can also show basic markdown formatting, which blurs the line further.
## How do I choose between them?
Match the tool to the task.
- **Reading a file someone sent you:** a reader. No install, and a browser viewer works on any computer or phone.
- **Checking a README before you publish it:** a reader that uses the same rules as the destination. GitHub uses GitHub Flavored Markdown, so render with GFM; the [GitHub README viewer](/github-readme-viewer) also resolves the repository's relative links and images.
- **Writing documentation in a code project:** an editor with a side-by-side preview, usually the code editor you already use.
- **Keeping notes:** a note-taking editor built on markdown files, such as Obsidian.
- **Cleaning up messy markdown:** a formatter, which rewrites spacing and list markers consistently; the [markdown formatter](/markdown-formatter) does this in the browser.
## Do readers and editors render markdown the same way?
Not always. Markdown has several flavors. CommonMark is the strict core; GitHub Flavored Markdown adds tables, task lists, strikethrough and autolinks; other tools add footnotes, math, callouts or wiki-style links. An editor may support syntax that a reader does not, or the reverse, so a document can look right in one and partly raw in the other. When the final destination matters, preview with a tool that uses the destination's flavor. The [markdown viewer](/markdown-viewer) renders GitHub Flavored Markdown with footnotes and Mermaid, which matches GitHub, GitLab and most documentation sites.
## Is a markdown reader safer than an editor?
Both are safe for ordinary files, because markdown is text and does not run when opened. The difference is about access. A browser reader that works with the File API only sees the one file you give it, which is a reasonable choice for a file from someone you do not know. A desktop editor usually has access to your whole disk and may run extensions. Neither needs network access to render, though images in a document load from wherever their URLs point.
## Can one tool do both?
Many do. Editors include previews, and some readers let you edit. The markdown viewer here has an editable source panel, so you can fix a typo and see the result, but it does not save back to your disk; you would copy the corrected text back into your file. That is the practical line between the two: a reader is complete without saving, an editor is not.
## How do I open a .md file on iPhone or Android?
URL: https://docs-md.com/markdown-viewer/open-md-file-iphone-android
Updated: 2026-10-20
Save the file to your phone, open a browser-based markdown viewer and pick the file there. Neither iOS nor Android renders markdown on its own: the iPhone Files app shows a .md file as plain text, and Android opens it in whatever text app you have, if any. A viewer or a markdown app shows it formatted.
A `.md` file is markdown, plain text in which `#` marks a heading, `**` marks bold and `-` starts a list item. On a computer, opening it in a text editor is a reasonable fallback. On a phone, raw markdown is harder to read: long lines of pipes and dashes in a table wrap across the narrow screen, and code blocks lose their alignment. Getting a rendered view is worth the extra step.
## What happens when I tap a .md file on an iPhone?
The Files app opens a preview that shows the text, not the formatting. You see the `#` and `*` characters, and tables appear as rows of pipes. The same happens with a `.md` attachment in Mail or a file in a chat app: iOS previews it as text. Nothing is wrong with the file. iOS simply has no markdown renderer built in, so you need a viewer page or an app that understands the format.
## How do I read a .md file formatted on iPhone or iPad?
Use a browser viewer through Safari, which can pick files from the Files app.
1. If the file is an attachment in Mail, Messages or another app, open it, tap the share button and choose **Save to Files**. Pick a folder you will find again.
2. Open the [markdown viewer](/markdown-viewer) in Safari.
3. Tap **Open .md file**. iOS shows a file picker; browse to the file and tap it.
4. The document renders with headings, tables, lists, code highlighting and Mermaid diagrams. Tap **Hide source** to give the rendered view the full width of the screen.
The file is read by Safari on the phone and is not uploaded. On an iPad you can also drag a file from the Files app in Split View onto the viewer.
## How do I open a .md file on Android?
Tapping a `.md` file in a file manager or download notification opens it in an app that has registered for text files, or Android asks you to choose one, or reports that no app can open it. Which of these you see depends on the phone maker and the apps you have installed. To read it formatted, open the [markdown viewer](/markdown-viewer) in Chrome, tap **Open .md file**, and pick the file from the system file picker; downloads are usually in the **Downloads** folder. The rendering is the same as on a desktop, and the file stays on the phone.
## Which markdown apps work on phones?
If you read markdown on your phone often, an app saves the save-then-open step. [Obsidian](https://obsidian.md) has free iOS and Android apps that open folders of markdown notes and show them formatted. On Android, [Markor](https://github.com/gsantner/markor) is an open-source markdown editor with a preview mode, available from Google Play and F-Droid. Many other viewers and editors exist in both app stores; check the reviews, the date of the last update, and which permissions the app asks for before you install, because some read every file in your storage.
## How do I read a README from GitHub on my phone?
Open the repository on github.com in your browser; GitHub renders `README.md` and other markdown files on the repository page, on mobile as well. The GitHub mobile app does the same for repositories you browse there. If you only have a link to the raw file, the [GitHub README viewer](/github-readme-viewer) loads it from the repository and renders it with relative links and images working, which raw links lose.
## Why does the rendered document look cramped on a phone?
Wide content does not fit a phone screen. Tables with many columns, long code lines and large diagrams have to scroll sideways or shrink. In the viewer, turn the phone to landscape, hide the source panel and lower the type size. If the document is yours and is mainly read on phones, keep tables to a few columns and break long code lines; the [markdown table guide](/guides/markdown-table) has tips on keeping tables narrow.
## Can I send someone a .md file to read on their phone?
You can, but they will probably see raw text, for the reasons above. If the reader is not technical, send something their phone renders on its own: a PDF, or a link to a rendered web page. The viewer's **Share as link** button publishes the document to a short address that opens as a formatted page in any mobile browser. Treat that link as public to anyone who has it. The [guide to sharing a rendered markdown file](/markdown-viewer/render-markdown-to-pdf-or-link) compares the PDF and link routes.
## Is it safe to open a .md file on my phone?
Yes. A markdown file is text and does not run code when it is opened or rendered. Links and images inside it can point to websites, so treat links in a file from a stranger the same way you treat links in a message. The browser viewer does not run scripts from the file, and it does not upload the file; only **Share as link** sends the content to a server, and only when you tap it.
## What about .markdown and .txt files?
They work the same way. `.markdown` is a longer extension for the same format, and the viewer also opens `.mdx` and `.txt` files and renders any markdown inside them. If a file chooser greys out a `.md` file, change the filter to all files, or rename a copy to `.txt` in the Files app and open that; the markdown inside renders identically.
## Which option should I pick?
For a single file, the browser viewer: nothing to install on either platform, and the rendering matches GitHub. For a folder of notes you read every day, a markdown app such as Obsidian. For a repository README, the GitHub website. On a computer the steps are different; see the guides for [Windows](/markdown-viewer/open-md-file-windows) and [Mac](/markdown-viewer/open-md-file-mac).
## How do I open a .md file on a Mac?
URL: https://docs-md.com/markdown-viewer/open-md-file-mac
Updated: 2026-10-20
Control-click the file, choose Open With, and pick TextEdit. A .md file is plain text, so it opens, but you see the raw markdown symbols. macOS has no built-in markdown renderer, so to read it formatted use a browser viewer, a Quick Look extension, or an editor with a preview such as VS Code.
Markdown writes formatting with ordinary characters: `#` before a heading, `**` around bold text, `-` in front of a list item, pipes for tables. The format was designed to stay readable as plain text, so TextEdit is enough for a short note. For a long README with tables and code, the symbols get in the way, and a rendered view is much easier to read. None of the options below change the file, and none of them need an account. Which one fits depends on whether you only want to read the file once or work with markdown regularly.
## How do I open a .md file in TextEdit?
Control-click (or right-click) the file in Finder, choose **Open With**, then **TextEdit**. TextEdit shows the markdown source as typed. If **TextEdit** is not in the list, choose **Other…** and pick it from Applications. If you edit and save the file, keep it as plain text: in TextEdit, **Format**, **Make Plain Text** ensures it does not turn the file into rich text. TextEdit does not interpret markdown, so headings stay as lines starting with `#`.
## Why does Quick Look show raw markdown?
Quick Look, the preview you get by selecting a file in Finder and pressing the Space bar, treats a `.md` file as plain text. It shows the content but not the formatting, so you see the `#` and `*` characters. To get a rendered preview in Quick Look you need a third-party Quick Look extension that handles markdown.
One open-source option is [QLMarkdown](https://github.com/sbarex/QLMarkdown), a macOS Quick Look extension for markdown files. Its README offers a downloadable release and a Homebrew install:
```bash
brew install --cask qlmarkdown
```
After installing, open the app once so macOS registers the extension, then check that it is enabled under the Quick Look section of extensions in System Settings. Older Quick Look plugins in the `.qlgenerator` format are not supported by recent macOS versions, so prefer a project that ships as an app extension and has recent releases.
## How do I read a .md file formatted without installing anything?
Use a browser viewer. Open the [markdown viewer](/markdown-viewer) in Safari, Chrome or Firefox, then drag the `.md` file from Finder onto the viewer panel, or click **Open .md file** and choose it. The file is read locally by the browser, not uploaded, and it renders with GitHub's rules: headings, tables, task lists, footnotes, highlighted code and Mermaid diagrams. **Hide source** gives a full-width reading view and the outline lets you jump between headings. Opening the file directly in Safari instead, with **File**, **Open File**, shows plain text, because browsers do not render markdown on their own.
## How do I preview a .md file in VS Code on a Mac?
Open the file in Visual Studio Code and press **Cmd+Shift+V** to switch to the rendered preview, or **Cmd+K** then **V** to open the preview beside the source. Both shortcuts are listed in the [VS Code markdown documentation](https://code.visualstudio.com/docs/languages/markdown). The preview updates as you type, scrolls along with the editor and renders Mermaid diagrams and math. If you do not have VS Code, it is a free download, and the [VS Code preview guide](/markdown-viewer/preview-markdown-in-vs-code) covers the rest of its options.
## How do I make .md files always open in one app?
Select a `.md` file in Finder and press **Cmd+I** to open **Get Info**. Under **Open with**, choose the app, then click **Change All…** and confirm. Every `.md` file now opens in that app on double-click. Pick a markdown editor or VS Code if you want formatting; TextEdit if you only need the text. A browser is not a good default for local files, because without an extension it shows plain text. You can undo the change the same way by choosing a different app and clicking **Change All…** again.
## Which markdown apps exist for the Mac?
Several native editors render markdown, including Typora, Obsidian and iA Writer, along with many smaller ones on the Mac App Store. They differ in price, in which extensions they support (tables, footnotes, math, Mermaid) and in whether they show source and preview side by side or blend them in one view. For reading a file you received, an app is optional; for writing notes every day, one of these is worth trying. Check the developer's current website for pricing and supported macOS versions before you install, because those change.
## Can I read a .md file from the Terminal?
Yes, as text: `cat README.md` or `less README.md` prints the source. There are command-line tools that render markdown for the terminal, such as Glow, which you can install with Homebrew, but they are only worth it if you already live in the Terminal. Pandoc can convert a file to HTML that you then open in a browser:
```bash
pandoc README.md -s -o README.html && open README.html
```
## Which option should I pick?
For a file someone sent you, the browser viewer: no install, complete rendering, nothing uploaded. If you preview markdown files in Finder all day, install a Quick Look extension. If you edit markdown, use VS Code or a dedicated editor. If the file is a README from a GitHub project, the [GitHub README viewer](/github-readme-viewer) reads it from the repository with its relative links and images working, and [the Windows version of this guide](/markdown-viewer/open-md-file-windows) covers the same steps for a PC.
## How do I open a .md file on Windows?
URL: https://docs-md.com/markdown-viewer/open-md-file-windows
Updated: 2026-10-20
Right-click the file, choose Open with, and pick Notepad. A .md file is plain text, so it opens in any text editor, but you see the raw markdown symbols. To read it formatted, with headings, lists and tables, open it in a markdown viewer, in VS Code's preview, or in a recent version of Notepad.
The `.md` extension stands for markdown, a way of writing formatting with ordinary characters: `#` in front of a heading, `**` around bold text, `-` at the start of a list item. Nothing in the file is executable, so opening it in a text editor is safe. Windows just does not ship a program that is registered to show markdown as a formatted document on every machine, which is why a double-click often asks you to choose an app, or opens the file in something unexpected.
## How do I open a .md file with Notepad?
Right-click the file in File Explorer and choose **Open with**, then **Notepad**. On Windows 11 the right-click menu may show **Open with** directly; if it does not, choose **Show more options** first to get the classic menu. If Notepad is not in the short list, pick **Choose another app** and select it there. This always works because markdown is plain text. What you get depends on your Notepad version: older versions show every `#`, `*` and `|` exactly as typed, which is readable for short files and tiring for long ones.
## Can Notepad on Windows 11 show markdown formatted?
Recent versions of Notepad on Windows 11 can. Microsoft added lightweight formatting to Notepad in 2025, and it reads markdown files: headings, bold, italic, links and lists can be shown as formatting, with a switch between the formatted view and the raw syntax. Support grew over later updates, and tables arrived in newer builds than the first release. Notepad updates through the Microsoft Store, so if you do not see a formatting toolbar or a formatted view, check the Store for a Notepad update. If your organization manages updates, you may not have it yet, and Windows 10 Notepad does not have it.
Even where it works, Notepad covers the basic syntax. Fenced code blocks with syntax highlighting, footnotes, task lists and Mermaid diagrams are outside what it is built to show, so a technical README can still look partly raw.
## How do I see a .md file formatted without installing anything?
Use a browser-based viewer. Open the [markdown viewer](/markdown-viewer) in Edge or Chrome, then drag the `.md` file from File Explorer onto the viewer panel, or click **Open .md file** and pick it. The file is read by your browser and not uploaded, and it renders with GitHub's rules: headings, tables, task lists, footnotes, highlighted code and Mermaid diagrams. Click **Hide source** for a full-width reading view and use the outline to jump between sections. This is the quickest route on a work laptop where you cannot install software.
## How do I make .md files always open in the same program?
Set a default app for the extension. Right-click any `.md` file, choose **Open with**, then **Choose another app**, select the program and tick **Always use this app to open .md files** before clicking **OK**. You can also do it from **Settings**, **Apps**, **Default apps**: type `.md` in the box that sets a default by file type and pick the app. Good choices are Notepad for quick reading, VS Code if you edit markdown, or a dedicated markdown editor if you installed one. A browser cannot be set as a useful default here, because opening a local `.md` file in Edge or Chrome shows plain text unless an extension is installed.
## How do I open a .md file in VS Code on Windows?
Right-click the file and choose **Open with**, then **Visual Studio Code**, or choose **Open with Code** if you ticked that option during installation. The file opens as source. Press **Ctrl+Shift+V** to switch to the rendered preview, or **Ctrl+K** followed by **V** to open the preview beside the source, so you see changes as you type. The [VS Code markdown documentation](https://code.visualstudio.com/docs/languages/markdown) describes both shortcuts. The [guide to previewing markdown in VS Code](/markdown-viewer/preview-markdown-in-vs-code) covers preview locking, scroll sync and why some images do not appear.
## Why does double-clicking a .md file do nothing useful?
Windows opens a file with whatever app is registered for its extension, and `.md` often has no registration, or one you did not choose. On a fresh machine Windows asks which app to use. If you installed a developer tool, it may have claimed the extension. Some systems associate `.md` with unrelated software, because the same extension has been used by other file types in the past. Use **Open with** to choose deliberately, and set a default as described above if you open these files often.
## Is a .md file safe to open?
Opening it in a text editor or viewer is safe. A `.md` file is text; it does not run code when opened. A rendered markdown document can contain links and images that point to web addresses, so treat links in a file from an unknown sender as you would links in an email. Browser viewers do not run scripts embedded in the file, and VS Code's preview blocks scripts by default as well.
## What about .markdown, .mdx and README files?
They open the same way. `.markdown` is a longer spelling of the same format. `.mdx` is markdown with embedded JSX components, used by documentation sites; viewers render the markdown parts and show the components as text or skip them. A `README.md` from a downloaded project is an ordinary markdown file; if it came from GitHub, the [GitHub README viewer](/github-readme-viewer) reads it straight from the repository with its links and images working. For more on the README case specifically, see [how to open a README.md file](/readme-generator/how-to-open-readme-md).
## Which option should I pick?
For a one-off file, the browser viewer: nothing to install and the most complete rendering. If you only need to read short notes and your Notepad has formatting, Notepad is fine. If you write markdown regularly, VS Code with its side-by-side preview is the better daily tool. If you need to send the formatted document to someone else, see [how to share a rendered markdown file](/markdown-viewer/render-markdown-to-pdf-or-link).
## How do I preview markdown in VS Code?
URL: https://docs-md.com/markdown-viewer/preview-markdown-in-vs-code
Updated: 2026-10-20
Open the .md file and press Ctrl+Shift+V (Cmd+Shift+V on a Mac) to switch to the rendered preview. To see source and preview side by side, press Ctrl+K, release, then press V (Cmd+K V on a Mac). The preview is built into VS Code, so no extension is needed, and it updates as you type.
Both shortcuts come from the [VS Code Markdown documentation](https://code.visualstudio.com/docs/languages/markdown), which is the reference for everything below. The preview is a separate editor tab, so you can drag it to another group, split it, or put it on a second monitor like any other tab. It renders CommonMark with common extensions, Mermaid diagrams in `mermaid` code fences, and math with KaTeX.
## What are the ways to open the markdown preview?
There are four, and they open the same preview. Press **Ctrl+Shift+V** (**Cmd+Shift+V**) to replace the current view with the preview. Press **Ctrl+K V** (**Cmd+K V**) to open it beside the source. Right-click the file's editor tab and choose **Open Preview**. Or open the Command Palette with **Ctrl+Shift+P** (**Cmd+Shift+P**) and run **Markdown: Open Preview** or **Markdown: Open Preview to the Side**. There is also a preview icon in the editor title bar, at the top right of a markdown tab, which opens the side-by-side preview with one click.
## Why does the preview change when I switch files?
By default the preview follows the active markdown file: click another `.md` tab and the preview shows that file instead. To pin it to one document, make the preview the active tab and run **Markdown: Toggle Preview Locking** from the Command Palette. A locked preview shows **[Preview]** in its title and stays on its file while you edit others. The documentation notes the command only appears when the preview is the active tab, which is the usual reason people cannot find it.
## How do I keep the editor and preview scrolled together?
They already are. VS Code syncs scrolling in both directions, and marks the line your cursor is on with a light gray bar in the preview's left margin. Double-clicking an element in the preview jumps the editor to the matching line. If you prefer to scroll them independently, turn off `markdown.preview.scrollPreviewWithEditor` and `markdown.preview.scrollEditorWithPreview` in Settings.
```json
{
"markdown.preview.scrollPreviewWithEditor": false,
"markdown.preview.scrollEditorWithPreview": false
}
```
## Why are images or content missing from the preview?
The preview runs under a security policy. Its default level, **Strict**, disables scripts and only loads content over `https`, so an image with an `http://` URL is blocked. When something is blocked, an alert appears at the top right of the preview; click it, or run **Markdown: Change preview security settings**, to choose **Allow insecure content** (scripts stay off, `http` loads) or **Disable** (no extra restrictions). The setting applies to the whole workspace, and the VS Code documentation recommends staying on Strict unless you trust every markdown file in the workspace. For local images, check that the relative path in the markdown matches the file's location; paths are resolved from the markdown file's folder.
## Can I make .md files open in the preview by default?
Yes, through editor associations. Add this to your `settings.json`, and opening a markdown file from the Explorer shows the rendered preview first:
```json
{
"workbench.editorAssociations": {
"*.md": "vscode.markdown.preview.editor"
}
}
```
Use **View: Reopen Editor With...** from the Command Palette to switch a single file back to the text editor. The same documentation describes a `workbench.diffEditorAssociations` setting that renders markdown diffs from Source Control as a preview, with changes highlighted, which is useful when reviewing a documentation pull request.
## Does the VS Code preview look like GitHub?
Close, but not identical. VS Code uses its own stylesheet and its own markdown parser configuration, so spacing, fonts and some extensions differ from what GitHub shows. If you need to know how a README will look on GitHub, render it with GitHub's rules: the [markdown viewer](/markdown-viewer) renders GitHub Flavored Markdown in the browser, and [previewing a README before pushing](/github-readme-viewer/preview-readme-before-push) covers the README case in detail. Inside VS Code, the Markdown Preview GitHub Styling extension by Matt Bierner restyles the preview to resemble GitHub; it changes the look, not the parser.
## How do I change how the preview looks?
Point the `markdown.styles` setting at one or more CSS files. The setting accepts `https` URLs or paths relative to the workspace root, and your rules are applied on top of the built-in preview styles:
```json
{
"markdown.styles": ["preview.css"]
}
```
If single line breaks in your source should appear as line breaks in the preview, set `markdown.preview.breaks` to `true`; by default the preview follows CommonMark, where a single newline inside a paragraph is a space. Math rendering can be turned off with `"markdown.math.enabled": false` if dollar signs in your text are being read as formulas.
## Can I export or share the preview?
VS Code's preview has no export or share command. To get a PDF, see [exporting markdown to PDF from VS Code](/markdown-to-pdf/vs-code-markdown-to-pdf), which compares an extension, a browser converter and Pandoc. To send a rendered page to someone without VS Code, copy the file's content into the [markdown viewer](/markdown-viewer) and click **Share as link**, which publishes it at a short address that opens in any browser.
## What if I do not have VS Code?
You do not need it just to read markdown. A browser viewer renders a file in a few seconds with nothing to install. VS Code makes sense when you also write or edit markdown, because the side-by-side preview shows the effect of every change as you type. The difference between tools for reading and tools for writing is covered in [markdown reader vs editor](/markdown-viewer/md-file-reader-vs-editor).
## How do I share a rendered markdown file with someone who has no markdown app?
URL: https://docs-md.com/markdown-viewer/render-markdown-to-pdf-or-link
Updated: 2026-10-20
Send it as a PDF or as a link to a rendered web page. A PDF suits a finished document that should look the same everywhere and work offline. A link suits a document you may update, or one with wide tables and diagrams. Both open on any computer or phone without a markdown app.
Sending the `.md` file itself is the option to avoid when the reader is not technical. Their computer or phone will most likely show it as plain text, full of `#`, `*` and `|` characters, or ask them which app to use. The two routes below turn the markdown into something every device already knows how to open.
## How do I turn a markdown file into a PDF?
Render it and print it to PDF from your browser. In the [markdown viewer](/markdown-viewer), open or drop the `.md` file, check that it renders the way you expect, then click **Print / PDF** and choose **Save as PDF** as the destination in the print dialog. The viewer's controls are hidden and only the rendered document prints. For more control, the [markdown to PDF converter](/markdown-to-pdf) is built for this one job: it keeps code blocks with syntax highlighting, renders tables as real tables, and avoids leaving a heading alone at the bottom of a page. Either way the PDF is produced by the browser's print engine, so the text stays selectable and searchable, and the file is never uploaded.
For a cleaner result, set margins to **Default** and turn off **Headers and footers** in the print dialog, so the PDF does not carry the date and page address in its corners.
## How do I share a markdown file as a link?
Publish it and send the address. In the viewer, click **Share as link**: the document is published at a short URL that renders as a formatted page, diagrams included, and expires after 30 days. Anyone who opens the link sees the formatted document in their browser, on a computer or a phone, with nothing to install. If you need a different lifetime, use the [main sharing page](/), where you paste the markdown and choose an expiry of 1 day, 7 days, 30 days or never. That page also gives you an edit token, which lets you update the content behind the same URL later, or delete it.
## Should I send a PDF or a link?
Pick by what happens after you send it.
| Need | PDF | Link |
|---|---|---|
| Reader opens it offline or archives it | Yes | No |
| You will update the document after sending | Send a new file | Same URL, new content (with an edit token) |
| Looks identical on every device | Yes, fixed pages | Adapts to the screen |
| Wide tables and large diagrams | Can be cut at the page edge | Scroll horizontally |
| Attach to an email or upload to a portal | Yes | Paste the URL |
| Reader can copy text and code | Yes | Yes |
| Stops being available | Never, once sent | When it expires or you delete it |
In short, a PDF is a copy and a link is a window. Contracts, reports and anything that has to be filed should be PDFs. Drafts under review, plans that will change and documents mostly read on phones work better as links.
## Who can see a shared markdown link?
Anyone who has the URL. The links are unlisted rather than private: they are not protected by a password or tied to the recipient's account, so a forwarded link works for whoever receives it. Do not publish documents with passwords, keys, personal data or anything confidential this way. For sensitive material, send a PDF through a channel you already trust, or use a document system that controls access per person.
## What does each format keep from the markdown?
Both keep headings, lists, links, emphasis, tables, block quotes and code blocks with syntax highlighting. Mermaid diagrams render in the viewer and in shared links; in a PDF they appear as they render in the browser before printing, so check the print preview for diagrams cut across a page break. The [guide to keeping Mermaid and code blocks in a PDF](/markdown-to-pdf/markdown-to-pdf-mermaid-code) covers that in detail. Links stay clickable in both. In both, the text stays real text that readers can select and search, not an image of it.
## What if the reader needs to edit the document?
Then neither PDF nor link is ideal, because both are for reading. If they use Microsoft Word, convert the markdown to a `.docx` file with the [markdown to Word converter](/markdown-to-word) and send that; headings, lists and tables become native Word formatting they can change. If they are comfortable with markdown, send the `.md` file itself along with a link to a viewer, so they can read it formatted and still edit the source.
## Can I share a README from a GitHub repository?
If the repository is public, send the github.com address of the file: GitHub renders markdown for every visitor, with no account needed to read it. If the repository is private, the reader needs access to it, so publish a copy instead: paste the README into the viewer and share it as a link, or print it to PDF. Relative links to other files in the repository will not work in either copy, because those files are not included.
## How do I check the document before sending it?
Open the PDF or the link yourself, ideally on a phone as well as a computer. Look for tables that run off the edge, code blocks with very long lines, images that did not load and diagrams that failed to render. Images must use full `https` URLs to appear in a shared link or a PDF made in the browser, because a relative path such as `images/chart.png` only resolves next to the original file. Fix the markdown, render again, and only then send it. If the reader still has trouble, the guide to [opening a .md file on a phone](/markdown-viewer/open-md-file-iphone-android) shows the steps they would need.
## How do I view a markdown file in Chrome?
URL: https://docs-md.com/markdown-viewer/view-markdown-in-chrome
Updated: 2026-10-20
Chrome has no markdown renderer, so a .md file opened in it shows as plain text. To see it formatted, open an online markdown viewer in Chrome and drop the file onto it, or install a markdown extension and allow it to access file URLs. The viewer needs no install; the extension renders files you open directly.
Both routes end in the same place, a formatted document with headings, lists, tables and code, but they work differently. An online viewer is a web page that reads the file you give it. An extension changes how Chrome displays `.md` addresses, so it also works when you open a file from your disk or follow a link to a raw markdown file. The rest of this page covers each route and the permission that trips people up.
## What does Chrome do with a .md file by default?
It treats it as text. If you drag a local `.md` file into a Chrome tab, or open it with **Ctrl+O** (**Cmd+O** on a Mac), you usually get the raw source in a plain monospaced page, with every `#`, `*` and `|` visible. Depending on your system and how the file was served, Chrome may download the file instead of showing it. Links to raw files on the web, such as a `raw.githubusercontent.com` address, also display as plain text. None of this is a fault in the file: Chrome only renders HTML, and markdown has to be converted to HTML first.
## How do I view a markdown file in Chrome without installing anything?
Use an online viewer. Open the [markdown viewer](/markdown-viewer) in a tab, then drag the `.md` file from your file manager onto the viewer panel, or click **Open .md file** and pick it. The page reads the file with the browser's File API and does not upload it. It renders GitHub Flavored Markdown: tables, task lists, footnotes, highlighted code blocks and Mermaid diagrams. You can also paste markdown text into the editor, or paste a GitHub file URL and click **Load from URL**; that fetch happens in your browser, so it works for hosts that allow cross-origin requests, which GitHub raw files and gists do. This route works in managed Chrome profiles where extensions are blocked.
## How do I render markdown with a Chrome extension?
Install a markdown viewer extension from the Chrome Web Store, then open `.md` files or links in Chrome as usual; the extension replaces the plain text with a rendered page. One long-running open-source option is [Markdown Viewer by simov](https://github.com/simov/markdown-viewer), which supports several markdown parsers, themes and syntax highlighting. Before installing any extension, check its permissions, its number of users and when it was last updated, because a viewer extension asks to read the pages it renders. Microsoft Edge can install extensions from the Chrome Web Store, so the same extensions work there.
## Why does the extension not work on local files?
Chrome does not let extensions read `file://` addresses unless you allow it per extension. Until you do, a local `.md` file stays as plain text even with the extension installed. To turn it on:
1. Go to `chrome://extensions` in the address bar.
2. Find the markdown extension and click **Details**.
3. Turn on **Allow access to file URLs**.
4. Reload the tab with the `.md` file.
The Markdown Viewer project's [setup instructions](https://github.com/simov/markdown-viewer) describe the same switch. It applies to the one extension you enable it for. Only grant it to extensions you trust, because it lets them read local files you open in Chrome.
## Why does an extension not render some markdown links?
The extension only acts on addresses it is allowed to run on. Many extensions start with local files and a few known hosts, and ask you to allow other origins one by one. A server can also send a `.md` file with a content type that makes Chrome download it rather than display it, and an extension cannot render a page Chrome never opens. In those cases, download the file and use a viewer, or use **Load from URL** on the viewer page if the host permits cross-origin reads.
## Should I use the online viewer or an extension?
Use the online viewer when you read a markdown file now and then, when you cannot install extensions, or on a shared computer. Use an extension when you click through many markdown files or raw links every day and want them to render in place. The viewer has a few things extensions usually lack: **Share as link** to send the rendered page to someone, and **Print / PDF** for a clean printout. For whole repositories, with relative links between files and images that resolve, the [GitHub README viewer](/github-readme-viewer) is the better fit.
## How do I view markdown on a Chromebook?
Use the online viewer. Opening a `.md` file from the ChromeOS Files app shows its text, not the formatting. Open the viewer in Chrome and click **Open .md file**; the picker shows your Downloads folder and Google Drive. Extensions behave the same as on other platforms, including the **Allow access to file URLs** switch.
## Can Chrome print a markdown file as a PDF?
Not usefully from the raw text tab: you would get a PDF of the source with every symbol. Render it first. In the viewer, click **Print / PDF** and choose **Save as PDF** as the destination in Chrome's print dialog; only the rendered document prints. For page size and margin options, the [markdown to PDF converter](/markdown-to-pdf) is built for it.
## Why does a page say it is markdown but look normal in Chrome?
Because the site converted it before sending it. GitHub, GitLab, documentation sites and wikis store pages as markdown and turn them into HTML on their servers, so Chrome receives ordinary HTML and displays it. You only see raw markdown when Chrome gets the `.md` file itself, from your disk or a raw link. If you are not sure why the symbols appear in the first place, [why a .md file shows # and * symbols](/markdown-viewer/why-md-file-shows-symbols) explains it in a few paragraphs.
## Why does my .md file show # and * symbols instead of formatting?
URL: https://docs-md.com/markdown-viewer/why-md-file-shows-symbols
Updated: 2026-10-20
Because you are looking at the source, not the rendered document. A .md file is plain text in which # marks a heading and * marks emphasis; a program has to read those marks and turn them into formatting. Text editors and phones do not, so they show the symbols. Open the file in a markdown viewer to see the formatting.
Markdown works like a recipe rather than a finished dish. The file holds instructions written in ordinary characters, and a renderer follows them to produce a formatted page, usually HTML. When GitHub shows a README with real headings, it has run a renderer on the server. When you open the same file in Notepad or TextEdit, nothing runs, so you see the instructions themselves.
## What do the symbols mean?
Each one is a formatting instruction. `#` at the start of a line makes a heading, and more of them make smaller headings (`##`, `###`). Asterisks or underscores around words make emphasis: one pair for italic, two for bold. A `-`, `*` or `1.` at the start of a line begins a list item. Vertical bars `|` separate table columns, `>` starts a quotation, and three backticks open and close a block of code. `[text](https://…)` is a link. The [markdown cheat sheet](/markdown-cheat-sheet) lists the rest on one page, and the [headings guide](/guides/markdown-headings) covers the `#` levels in detail.
## Why is markdown designed so the symbols stay visible?
So the file stays readable without any software. John Gruber, who created the format, wrote in the [original syntax documentation](https://daringfireball.net/projects/markdown/syntax) that a markdown document "should be publishable as-is, as plain text, without looking like it's been marked up with tags or formatting instructions." That is why a `.md` file opened in a text editor is usable at all: a `#` line looks like a title and a hyphen list looks like a list. The cost is that the symbols are still there until something renders them.
## How do I make the file show its formatting?
Open it in something that renders markdown. The quickest is a browser viewer: open the [markdown viewer](/markdown-viewer), drag the file onto it or click **Open .md file**, and it renders with headings, tables, code highlighting and diagrams, without uploading the file. Other options are VS Code's built-in preview (**Ctrl+Shift+V**, or **Cmd+Shift+V** on a Mac), a markdown editor such as Obsidian or Typora, or, for a file in a GitHub repository, the repository page on github.com. Step-by-step instructions for each platform are in the guides for [Windows](/markdown-viewer/open-md-file-windows), [Mac](/markdown-viewer/open-md-file-mac) and [phones](/markdown-viewer/open-md-file-iphone-android).
## Why do some symbols still show in a markdown viewer?
Usually because the markdown is slightly off, and the renderer treats those characters as plain text. Common causes:
- **No space after `#`.** CommonMark, the specification most renderers follow, requires a space between the `#` characters and the heading text, so `#Title` stays as text while `# Title` becomes a heading.
- **Unclosed emphasis.** `**bold` without the closing `**` shows the asterisks. So does a space just inside the markers, as in `** bold **`.
- **A missing blank line.** A list or table directly after a paragraph line sometimes needs a blank line before it to be recognized, depending on the renderer.
- **An unclosed code fence.** Three backticks with no matching closing line turn everything after them into a code block, so the rest of the document shows raw.
- **Indentation.** A line indented by four spaces is a code block in standard markdown, and shows its symbols literally.
Fix the line and render again; the change is immediate in a live preview.
## Why does it show symbols in Word, email or chat?
Those programs either do not render markdown or render a different variant. Microsoft Word opens a `.md` file as plain text; [what Word does with a .md file](/markdown-to-word/can-word-open-md-file) explains the conversion route. Email clients send HTML or plain text, so markdown pasted into a message arrives with its symbols. Chat apps support their own subsets: Slack, for example, uses single asterisks for bold, so `**bold**` from a markdown file shows extra asterisks there. The [Slack formatting reference](/slack-markdown) lists what each app accepts.
## How do I show a literal # or * on purpose?
Put a backslash in front of it: `\#` and `\*` are displayed as the characters themselves, not read as formatting. This is useful for hashtags at the start of a line or for multiplication signs. Inside inline code (single backticks) or a code block, no escaping is needed, because everything there is shown as typed. The [escape characters guide](/guides/markdown-escape-characters) lists every character that can be escaped.
## Is something wrong with my file?
Almost never. Seeing `#` and `*` in a text editor is exactly what a healthy `.md` file looks like. The file is only broken if a markdown renderer also fails to format it, and then the cause is usually one of the syntax slips above, not corruption. If a file shows strange characters such as `é` instead of accented letters, that is a different problem: a text encoding mismatch, which you fix by reopening the file as UTF-8.
## Should I convert the file instead of viewing it?
Only if someone else needs to read it in a format they can open. Viewing is enough for reading it yourself. For a colleague without a markdown app, a PDF or a shared link is easier than the raw file; [sharing a rendered markdown file](/markdown-viewer/render-markdown-to-pdf-or-link) compares both. For a Word document, convert to `.docx`. Keep the `.md` file as the source either way, since it is the version that is easy to edit and compare.
---
# Markdown formatter (md formatter)
URL: https://docs-md.com/markdown-formatter
Category: Edit & share
Updated: 2026-09-16
Prettify messy markdown: uniform list markers, one emphasis style, aligned tables. Semantic — rendered output never changes.
## How do I align a markdown table so the columns line up?
URL: https://docs-md.com/markdown-formatter/fix-markdown-table-alignment
Updated: 2026-10-20
Pad each cell with spaces to the width of the widest cell in its column, and make the dashes in the delimiter row the same width. Then every pipe sits in the same position on every line. A formatter does this automatically: paste the table into a markdown formatter or run Prettier, and the source comes back aligned.
Alignment in the source is purely for people reading the raw file. Renderers ignore the extra spaces: a table with ragged pipes and the same table with perfect columns produce identical HTML. That is also why aligning a table is safe to automate. A formatter that parses the table and prints it back can only change whitespace, not content.
## What does an aligned markdown table look like?
Every row has the same length and the pipes form straight vertical lines. Here is a table as people usually type it, and the same table after one pass through our [Markdown Formatter](/markdown-formatter):
```markdown
|Name|Score|Notes|
|:---|---:|:-:|
|Ada|99|first|
|Grace Hopper|7|x|
```
```markdown
| Name | Score | Notes |
| :----------- | ----: | :---: |
| Ada | 99 | first |
| Grace Hopper | 7 | x |
```
Both render as the same three-column table. The second one shows the formatter doing two separate jobs. It pads the cells so the pipes line up, and it pads each cell on the side that matches the column's text alignment, so right-aligned numbers sit flush right in the source too. The delimiter row is stretched to the column width with the colons kept in place.
## How do the colons in the separator row affect alignment?
The colons set how text is aligned inside each column when the table is rendered; they do not line up the source. Per the GitHub Flavored Markdown spec, `:---` is left-aligned, `---:` is right-aligned and `:---:` is centred, and a delimiter with no colons leaves alignment to the renderer's default, which is usually left ([GFM spec, Tables](https://github.github.com/gfm/#tables-extension-)).
This is the most common confusion behind the question. Someone adds `:---:` hoping the raw file will look tidy, and nothing in the source changes. Two different things are called "alignment": text alignment inside rendered cells, set by colons, and vertical alignment of pipes in the source, set by padding. You usually want both: colons for how readers see the table, padding for how editors see the file. The [markdown table guide](/guides/markdown-table) covers the colon syntax with more examples.
## How do I align a table automatically?
Use a tool that parses tables rather than one that counts pipes. Three options, from no setup to fully automatic:
1. **In the browser.** Paste the document into the [Markdown Formatter](/markdown-formatter). Every table in it is reprinted aligned, along with the rest of the file. If you are building a new table rather than fixing one, the [Markdown Table Generator](/markdown-table-generator) produces aligned output from a grid you fill in.
2. **With Prettier.** `npx prettier --write table.md` aligns every table in the file. Prettier keeps tables aligned unless you set `proseWrap` to `never` and the aligned table is wider than `printWidth`; then it prints a compact table instead. See [How do I format markdown files with Prettier?](/markdown-formatter/format-markdown-with-prettier).
3. **In your editor.** In VS Code, the Prettier extension does this on Format Document. Some markdown extensions also offer a table formatting command; check the extension's own documentation for the exact name.
Any of these makes an md formatter part of your workflow, so you never align tables by hand again. Doing it by hand is fine for a three-row table and miserable for a twenty-row one, where adding one long cell means re-padding the whole column.
## Why do my columns still look misaligned after formatting?
Usually because of characters that are wider or narrower on screen than their count suggests. The common causes:
- **CJK characters and emoji.** In a monospaced font, a Chinese, Japanese or Korean character usually takes two columns, and most emoji also display wide. A formatter that counts characters will under-pad these cells. We tested this: our browser formatter counts characters, so a cell containing `東京` comes out two spaces short, while Prettier measures display width and aligns the same table correctly. If your tables contain CJK text, use Prettier for them.
- **A proportional font.** Alignment only works in monospaced fonts. If your editor, or a website showing raw markdown, uses a proportional font, no amount of padding will line the pipes up.
- **Tabs.** A tab character inside a cell is rendered at a width your editor decides. Replace tabs with spaces.
- **Escaped pipes and inline markup.** A cell containing `a \| b` or `[link](https://example.com)` is padded by its source length, which is correct for the source but means the rendered column widths look nothing like the source widths. That is expected.
## Does an aligned table render differently from an unaligned one?
No. The outer pipes, the padding and the number of dashes in the delimiter row are all optional in the GFM spec, so these two tables render identically:
```markdown
a|b
-|-
1|2
| a | b |
| - | - |
| 1 | 2 |
```
What does matter for rendering is that the header row and the delimiter row have the same number of cells, and that a blank line separates the table from a preceding paragraph, which several renderers need to recognise the table at all. A table that does not render at all is a syntax problem, not an alignment problem; a linter such as [Markdown Lint](/markdown-lint) is the better tool for finding it.
## Should I keep markdown tables aligned in a repository?
Keep them aligned if people read the raw files, and let a tool do it. Aligned tables are much easier to read in a terminal, in a pull request diff and in an editor without preview. The cost is diff noise: when one long value is added, every row of that column gets new padding, so a one-cell change shows as a change to every line of the table.
Some teams accept the noise in exchange for readability. Others choose compact tables with a single space around each cell, which markdownlint's MD060 rule calls the `compact` style, and enforce that instead. Either choice works if a formatter applies it consistently. What does not work is a mix: hand-aligned tables that drift out of alignment the first time someone edits them without a formatter.
If you only need a one-off fix, paste the table into the formatter, copy it back, and move on. If tables change often, run Prettier in CI with `--check` so misaligned tables are caught before merge.
## How do I format markdown in VS Code?
URL: https://docs-md.com/markdown-formatter/format-markdown-in-vs-code
Updated: 2026-10-20
VS Code does not ship a formatter for markdown, so Format Document does nothing until you install one. Add the Prettier extension (or markdownlint), make it the default formatter for markdown files, and run Format Document with Shift+Alt+F on Windows, Shift+Option+F on macOS or Ctrl+Shift+I on Linux. Format on save is one setting more.
VS Code has two built-in format actions, **Format Document** and **Format Selection**, but each language needs a formatter extension behind them ([VS Code docs, Formatting](https://code.visualstudio.com/docs/editing/codebasics#_formatting)). For markdown, VS Code's own extension gives you preview, outline, link completions and optional link validation, not formatting. If you run Format Document on a `.md` file with nothing installed, VS Code tells you there is no formatter for markdown files and offers to search the Marketplace.
## Which extension should I use to format markdown in VS Code?
Use Prettier if you want the whole file reprinted in one consistent style, and markdownlint if you want rule-based warnings that can also fix some problems. Prettier is the closest thing to a standard md formatter: it parses the file and prints it back with fixed choices for bullets, emphasis, tables and spacing. markdownlint is a linter first, but it registers itself as a formatter too.
The two extensions are:
- **Prettier - Code formatter**, identifier `esbenp.prettier-vscode`. It uses the Prettier version installed in your project's `node_modules` if there is one, and otherwise the copy bundled with the extension ([prettier-vscode README](https://github.com/prettier/prettier-vscode#readme)).
- **markdownlint**, identifier `DavidAnson.vscode-markdownlint`. It underlines rule violations as you type and, per its README, "registers itself as a source code formatter for Markdown files", so Format Document applies its automatic fixes ([vscode-markdownlint README](https://github.com/DavidAnson/vscode-markdownlint#readme)).
Many people install both: Prettier for layout, markdownlint for things a printer cannot decide for you, such as a skipped heading level or an image without alt text. The difference is explained in more detail in [What is the difference between a markdown formatter and a linter?](/markdown-formatter/markdown-formatter-vs-linter).
## How do I set Prettier as the default formatter for markdown?
Install the extension, then add a language-specific entry to your `settings.json`. Open the Command Palette (Ctrl+Shift+P, or Cmd+Shift+P on macOS), run **Preferences: Open User Settings (JSON)**, and add:
```json
{
"[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
```
The Prettier extension's README notes that VS Code does not support combined language syntax for this setting, so markdown needs its own block even if you already set Prettier for JavaScript. To set it for one project only, put the same block in `.vscode/settings.json` in the repository instead of your user settings, and commit it so everyone on the project gets the same formatter.
If you have both Prettier and markdownlint installed and have not chosen a default, VS Code asks which one to use the first time you format. You can also run **Format Document With...** from the Command Palette to pick a formatter for a single run without changing the default.
## How do I format markdown on save in VS Code?
Turn on `editor.formatOnSave`, either globally or only for markdown. The markdown-only version keeps the behaviour from surprising you in other languages:
```json
{
"[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
}
}
```
With this in place, every save reprints the file. If you also want markdownlint to apply its fixes on save, its README shows the setting `editor.codeActionsOnSave` with `"source.fixAll.markdownlint": "explicit"`, which runs the fixes when you save explicitly rather than on auto-save. The extension also adds a **markdownlint: Fix all supported markdownlint violations in the document** command (`markdownlint.fixAll`) if you prefer to run fixes by hand.
Format on save is convenient but has one cost in shared repositories: the first save of an old file can produce a large diff that has nothing to do with your change. Format the whole repository once in a separate commit, then turn on format on save, so later diffs only show real edits.
## What will Prettier change in my markdown file?
Prettier rewrites style, not content. On the files we tested with Prettier 3 it changed `*` and `+` bullets to `-`, `__bold__` to `**bold**`, `*italic*` to `_italic_`, padded table cells so the pipes line up, and reformatted code inside fenced blocks whose language it knows, such as JavaScript or JSON. It left long lines of prose alone.
That last point surprises people. Prettier's `proseWrap` option defaults to `preserve`, which keeps your existing line breaks as they are, because some renderers treat a line break inside a paragraph as a visible break ([Prettier options, Prose Wrap](https://prettier.io/docs/options#prose-wrap)). If you want hard-wrapped paragraphs at 80 characters, set `"proseWrap": "always"` in a `.prettierrc` file. The full set of options and the command line are covered in [How do I format markdown files with Prettier?](/markdown-formatter/format-markdown-with-prettier).
To keep Prettier away from part of a file, put `` on the line before a block, or wrap a range in `` and ``. Prettier's docs say the range form needs a blank line before each comment to be recognised.
## Can I format markdown without installing anything?
Yes. Paste the text into the [Markdown Formatter](/markdown-formatter), pick a list marker, emphasis character and code fence style, and copy or download the result. It parses the document with remark and prints it back, so the rendered output stays the same while the source becomes consistent. It runs in the browser, which makes it a quick md formatter for a single file on a machine where you cannot install extensions.
It is not a substitute for an editor setup on a project you work on every day. A browser tool does not know your repository's config, and you have to paste the result back by hand. For a team, the durable answer is Prettier in `.vscode/settings.json` plus the same Prettier version in `package.json`, so the editor and your CI agree.
## Why does Format Document not change my markdown?
Usually because no formatter is set for markdown, or a different one is winning. Check these in order:
1. **No default formatter.** Run **Format Document With...** and see what is listed. If only "None" or nothing useful appears, install an extension as described above.
2. **Wrong default.** The status bar shows the language mode; make sure the file is recognised as Markdown, not plain text. A `.markdown` or `.mdx` file may be mapped differently from `.md`.
3. **Ignored file.** Prettier skips files listed in `.prettierignore`. The Prettier output channel (View, Output, then choose Prettier) shows when a file was ignored.
4. **Nothing to change.** If the file already matches the formatter's style, the format runs and produces no edits. Try it on a file with mixed `*` and `-` bullets to confirm it works.
When you also want to check the result for structural problems, such as duplicate headings or bare URLs, run the file through the [Markdown Lint](/markdown-lint) tool or keep the markdownlint extension enabled alongside Prettier.
## How do I format markdown files with Prettier?
URL: https://docs-md.com/markdown-formatter/format-markdown-with-prettier
Updated: 2026-10-20
Prettier formats markdown out of the box, with no plugin. Run `npx prettier --write "**/*.md"` from the project root to rewrite every markdown file in place, or `npx prettier --check "**/*.md"` to only report which files would change. Set `proseWrap` in a `.prettierrc` file if you want long paragraphs wrapped at a fixed width.
Prettier picks its parser from the file extension, so `.md` and `.markdown` files go through its markdown printer automatically ([Prettier docs, Configuration](https://prettier.io/docs/configuration)). Unlike a linter, it has few options: you get its style, and the point is that nobody on the team argues about it again.
## How do I run Prettier on markdown from the command line?
Install Prettier as a dev dependency so everyone uses the same version, then run it against your files. The Prettier docs recommend installing an exact version, because a minor release can change output.
```bash
npm install --save-dev --save-exact prettier
# format every markdown file in place
npx prettier --write "**/*.md"
# report files that are not formatted, change nothing
npx prettier --check "**/*.md"
# format a single file and print the result instead of saving
npx prettier README.md
```
Keep the quotes around the glob. Without them your shell expands `**/*.md` before Prettier sees it, and in shells where `**` is not recursive you silently format only the top-level files. With quotes, Prettier expands the pattern itself. Prettier's CLI docs warn that `--write` overwrites files, so commit or stash your work first ([Prettier CLI](https://prettier.io/docs/cli)).
`--check` exits with a non-zero status when any file needs formatting and prints a line such as "Code style issues found in the above file. Run Prettier with --write to fix." That makes it the command to put in CI. If you want just the file names, for piping to another command, use `--list-different` instead.
To skip folders such as `node_modules`, generated docs or vendored content, list them in a `.prettierignore` file at the project root. It uses the same pattern syntax as `.gitignore`.
## What does Prettier change in a markdown file?
It reprints the file from a parsed syntax tree, so the content stays the same and the source style becomes uniform. Running Prettier 3 on a deliberately messy test file, we saw these changes:
- `*` and `+` bullets became `-`. Two separate lists placed next to each other get `-` and `*` alternately, so they do not merge into one list.
- `__bold__` became `**bold**` and `*italic*` became `_italic_`.
- Table cells were padded so the pipes line up, including the delimiter row. Alignment colons such as `:-:` were kept.
- Code inside fenced blocks with a language Prettier knows, such as `js` or `json`, was formatted with Prettier's rules for that language. The `embeddedLanguageFormatting` option set to `"off"` disables this.
- Ordered lists numbered `1. 1. 1.` stayed that way; lists numbered `1. 2. 3.` stayed incrementing.
What it left alone matters as much. A setext heading (a title underlined with `=====`) stayed setext, and a long paragraph kept its original line breaks. That second point is controlled by `proseWrap`.
## What does the proseWrap option do?
`proseWrap` decides whether Prettier rewraps paragraphs. It has three values, and the default is `preserve` ([Prettier options, Prose Wrap](https://prettier.io/docs/options#prose-wrap)):
| Value | Effect |
|---|---|
| `preserve` | Keeps your line breaks exactly as written. This is the default. |
| `always` | Wraps prose at `printWidth`, which defaults to 80 characters. |
| `never` | Joins each paragraph onto a single line and leaves wrapping to the editor or viewer. |
The docs explain why the default is hands-off: some services, such as GitHub comments, render a line break inside a paragraph as a visible break, so rewrapping could change how the text looks there. In README files and documentation sites, a single newline inside a paragraph is normally ignored and `always` is safe.
There is a practical reason to choose `never` too. One line per paragraph means an edit to one sentence shows up as a one-line change in a diff, but the whole paragraph is that line, so reviewers see more. Some teams prefer `always` with a narrow width, others one sentence per line written by hand with `preserve`. Pick one and set it in config so it is not left to each editor.
## How do I configure Prettier only for markdown files?
Use `overrides` in a `.prettierrc` file. This keeps your code settings untouched and applies markdown settings only to markdown:
```json
{
"overrides": [
{
"files": ["*.md"],
"options": {
"proseWrap": "always",
"printWidth": 80
}
}
]
}
```
`printWidth` only affects prose when `proseWrap` is `always`; with the default `preserve` it has no visible effect on paragraphs. Tables are always printed aligned unless `proseWrap` is `never` and the aligned table would be wider than `printWidth`, in which case Prettier falls back to a compact table with single spaces around each cell.
## How do I stop Prettier from formatting part of a file?
Put `` on the line before the block you want left alone, such as a hand-aligned table or a list whose odd numbering is intentional. For a longer range, usually something another tool generates, wrap it:
```markdown
| Name | Role |
|-|-|
| Ada | Maintainer |
```
Prettier's docs say there must be a blank line before both the start and the end comment for them to be recognised, and that the range form only works at the top level of the document ([Prettier, Ignoring Code](https://prettier.io/docs/ignore)).
## Is there a way to format markdown like this without Node?
Yes, for a quick one-off. The [Markdown Formatter](/markdown-formatter) on this site is a browser md formatter built on remark, the parser and printer used throughout the unified ecosystem. Paste the file, choose `-`, `*` or `+` for bullets, `*` or `_` for emphasis and backticks or tildes for code fences, and copy the result. It also aligns table pipes and converts setext headings to `#` headings, which Prettier does not.
Its output will not match Prettier byte for byte. The two printers make different default choices, and the browser tool does not format code inside fences or wrap prose. If your repository runs `prettier --check` in CI, run Prettier itself before committing so the check passes. For editor integration, see [How do I format markdown in VS Code?](/markdown-formatter/format-markdown-in-vs-code).
## Should I use Prettier with markdownlint?
Yes, they solve different problems, and they work together if you avoid rules that fight. Prettier decides layout. markdownlint reports things a printer cannot fix, such as a heading level that jumps from `##` to `####`, duplicate headings, bare URLs or images without alt text. You can check those in the browser with [Markdown Lint](/markdown-lint) before setting up `markdownlint-cli2`.
The one conflict to watch is line length. markdownlint's MD013 rule flags long lines, while Prettier with the default `proseWrap: preserve` will not shorten them. Either set `proseWrap: always` so Prettier wraps for you, or disable MD013 in your markdownlint config.
## What is the difference between a markdown formatter and a linter?
URL: https://docs-md.com/markdown-formatter/markdown-formatter-vs-linter
Updated: 2026-10-20
A formatter rewrites your markdown into one consistent style without asking: bullets, emphasis, table padding, blank lines. A linter reads the file, checks it against rules and reports problems, some of which a formatter could never fix, such as skipped heading levels or missing alt text. Use a formatter for layout and a linter for structure.
The two are often confused because their outputs overlap. Both care that a file uses one bullet marker, and both can fix trailing spaces. The difference is in how they work and what they are allowed to decide. A formatter parses the file into a syntax tree and prints a new file from that tree, so it controls every byte of the output. A linter looks at the file you wrote and points at lines; it changes text only when a rule has a safe, mechanical fix.
## What does a markdown formatter do?
It reprints the whole document in a fixed house style, so the rendered output stays the same and the source becomes predictable. Our [Markdown Formatter](/markdown-formatter) is built this way on remark: it parses the markdown, then prints it back with remark-stringify using the style you pick in three drop-downs, for list marker (`-`, `*` or `+`), emphasis (`*` or `_`) and code fence (backticks or tildes).
In a single pass it will:
- make every bullet use the chosen marker and indent nested lists consistently;
- use one character for both emphasis and strong emphasis;
- turn setext headings (underlined with `===` or `---`) into `#` headings;
- pad table cells so the pipes line up;
- collapse runs of blank lines so blocks are separated by exactly one.
Prettier works the same way with fewer choices and a few extra behaviours, such as formatting code inside fenced blocks. Neither of them will tell you that your document has two H1 headings, because two H1 headings are valid markdown and print back perfectly. A formatter has no opinion about content, only about how it is written.
## What does a markdown linter do?
It checks the document against a list of named rules and reports each violation with a line number. The best-known markdown linter is markdownlint, whose rules have IDs such as MD001 (heading levels should only increase by one), MD025 (a single top-level heading), MD034 (no bare URLs) and MD045 (images need alt text) ([markdownlint rules](https://github.com/DavidAnson/markdownlint#rules--aliases)). Our [Markdown Lint](/markdown-lint) tool implements 19 of these rules in the browser under the same IDs.
Some rules overlap with formatting: MD004 checks list marker style, MD049 and MD050 check emphasis and strong style, MD012 flags multiple blank lines. A formatter fixes all of these as a side effect. But many rules are about meaning or accessibility, and no printer can fix them, because the fix needs a human decision:
| Problem | Formatter | Linter |
|---|---|---|
| Mixed `*` and `-` bullets | Fixes it | Reports it (MD004), can often fix it |
| Table pipes out of line | Fixes it | Reports inconsistent column style (MD060) |
| Heading jumps from `##` to `####` | Leaves it | Reports it (MD001) |
| Two `#` headings in one file | Leaves it | Reports it (MD025) |
| Image without alt text | Leaves it | Reports it (MD045) |
| Bare URL in a sentence | Leaves it | Reports it (MD034) |
| Fenced code block without a language | Leaves it | Reports it (MD040) |
A linter can suggest that an image needs alt text. It cannot write the alt text for you.
## Do I need both a formatter and a linter?
On a project with more than a handful of markdown files, yes. The formatter removes every style argument in one command, and the linter catches the structural problems that are left. Running only a linter means people spend review time fixing bullet characters by hand. Running only an md formatter means a beautifully consistent file can still have broken heading hierarchy.
The usual setup is Prettier, or another formatter, run on save in the editor and checked in CI, plus markdownlint run in CI with formatting-related rules either aligned to the formatter's style or turned off. See [How do I format markdown files with Prettier?](/markdown-formatter/format-markdown-with-prettier) for the formatter half and [How do I format markdown in VS Code?](/markdown-formatter/format-markdown-in-vs-code) for the editor setup.
For a single document, such as a README you are about to publish or a block of text an AI assistant generated, you can do both steps in the browser: format it, then paste the result into the linter and fix what remains.
## Can a formatter and a linter conflict?
Yes, when they enforce different choices for the same thing. Prettier writes italic text with underscores, so a markdownlint config that requires asterisks for emphasis (MD049 set to `asterisk`) will flag every file Prettier touches. The same applies to bullet style and line length.
The fix is to decide which tool owns each style choice. Let the formatter own anything it can rewrite, and configure the linter to agree or disable those rules. markdownlint's default for MD004, MD049 and MD050 is `consistent`, meaning one style per file, which any formatter's output satisfies. Line length is the usual exception: MD013 flags lines over 80 characters by default, while Prettier keeps your existing line breaks unless you set `proseWrap: always`. Either turn on wrapping in Prettier or turn off MD013.
## Can a linter fix problems automatically?
Partly. markdownlint marks some rules as fixable, and its command-line tool `markdownlint-cli2` applies those fixes with `--fix`; the VS Code extension applies them with Format Document or its fix-all command. Fixable rules are the mechanical ones, such as trailing spaces, missing blank lines around headings or a missing space after `#`.
That is still different from formatting. A fix touches the lines that broke a rule and leaves everything else as you wrote it. A formatter rewrites the whole file, including lines that broke no rule. If you want a file that looks the same no matter who wrote it, you need the formatter. If you want to keep your own style and only remove mistakes, a linter with fixes may be enough.
## Which should I run first?
Run the formatter first, then the linter. Formatting removes every finding that is purely about style, so the linter's report shrinks to the problems that need a person: heading order, alt text, bare URLs, empty links. Running them the other way round means fixing style warnings by hand that the formatter would have fixed anyway.
In CI the order matters less, because both run as checks, not rewrites. Put the formatter check first so a contributor who forgot to format sees that message before a list of lint warnings that formatting would partly resolve. The [headings guide](/guides/markdown-headings) is a useful reference for the most common linter finding that formatting cannot fix.
---
# Markdown cheat sheet
URL: https://docs-md.com/markdown-cheat-sheet
Category: Reference
Updated: 2026-09-01
Every element of markdown and GFM with side-by-side syntax and rendered output — headings to footnotes to mermaid diagrams.
|