YAML to Markdown Converter

Paste YAML or upload a .yml file. Nested keys become headings, lists of objects become tables, anchors are expanded.

Input — YAML
Output — Markdown
Markdown output will appear here...

To convert YAML to Markdown, paste the YAML (or upload a .yml file) into the box above and copy the result. Keys that hold a mapping become headings, plain settings become - **key:** value lines, lists of values become bullets, and a list of mappings becomes a table. Anchors and << merge keys are resolved first, so the output shows the values that actually apply.

What does the output look like?

A Docker Compose file

YAML in
services:
  web:
    image: nginx:1.27
    ports:
      - "8080:80"
  db:
    image: postgres:16
    environment:
      POSTGRES_DB: app
Markdown out
# services

## web

- **image:** nginx:1.27
### ports

- 8080:80


## db

- **image:** postgres:16
### environment

- **POSTGRES_DB:** app

A list of CI steps becomes a table

YAML in
steps:
  - name: Checkout
    uses: actions/checkout@v4
  - name: Test
    run: npm test
Markdown out
# steps

| name | uses | run |
| --- | --- | --- |
| Checkout | actions/checkout@v4 |  |
| Test |  | npm test |

Anchors and merge keys are expanded

YAML in
defaults: &defaults
  timeout: 30
  retries: 3
prod:
  <<: *defaults
  retries: 5
Markdown out
# defaults

- **timeout:** 30
- **retries:** 3

# prod

## <<

- **timeout:** 30
- **retries:** 3

- **retries:** 5

What happens to anchors, aliases and merge keys?

They are expanded. An alias such as *defaults is replaced by the content of the anchor, and a <<: *defaults merge copies those keys in, with keys written in the block itself winning. In the third example, prod gets timeout: 30 from the anchor and keeps its own retries: 5. The anchor names themselves do not appear in the Markdown.

Can it convert a file with several documents (---)?

No. A file with more than one document, such as a Kubernetes manifest holding a Deployment and a Service, stops with the error "expected a single document in the stream". Paste one document at a time. A single --- at the very top is fine.

Which lists become tables?

A list becomes a table when its first item is a mapping. The columns are every key used by any item, and an item without a key gets an empty cell, like run and uses in the CI example.

Cells are meant for plain values. A nested list in a cell is joined with commas ([admin, ops] becomes admin,ops) and a nested mapping shows as [object Object]. For deeply nested lists, convert the same data as JSON with JSON to Markdown, which switches to sections instead of printing that.

Why did 1.10 turn into 1.1?

Because unquoted, 1.10 is a number in YAML, and the number 1.10 is 1.1. The same goes for 0800, which becomes 800. Quote values that must stay exactly as typed, such as version strings, ZIP codes and phone numbers: version: "1.10". Words like yes, no and on are kept as words, since the parser follows YAML 1.2.

How are dates, nulls, comments and other edge cases handled?

InputWhat you get
Unquoted date (released: 2024-01-15)Kept exactly as written, as text
null, ~ or an empty valueWritten as null
Comments (# ...)Dropped
Multi-line block (note: |)Lines kept, but they render as one paragraph in the list item
Pipe | in a table cellNot escaped, so the cell splits into two
Line break in a table cellWritten as a real line break, which splits the row
Nested mapping in a table cell[object Object]
List mixing plain values and mappingsGarbled: [object Object] in bullets, or one column per character. Keep list items the same kind
Tabs used for indentationError: YAML only allows spaces
More than six levels of nestingHeadings stop at ######
Accents, CJK and emojiPassed through unchanged

How does this compare with Pandoc and yq?

MDConvert (this page)Pandocyq
Turns a YAML file into Markdown contentYesNo, YAML is read only as document metadataNo, it outputs YAML, JSON and other data formats
Expands anchors and merge keysYesNot applicableYes, with explode()
Multiple documents per fileNoNot applicableYes
Install neededNo, runs in the browserYes, command-line programYes, command-line program
Batch / scriptingNo, one file at a timeYesYes

yq is the tool for querying and reshaping YAML in a pipeline. This page is for getting a readable page out of a config file quickly.

Maintained by Ankit Aglawe. Last updated .

Related Tools

Need a different format? See every tool on the Markdown converter page, or go back to the MDConvert home page.

YAML to Markdown questions

Can I upload a .yml or .yaml file?
Yes. Click Upload above and pick the file, or paste the contents into the input box. Both extensions are the same format.
Are my YAML comments kept?
No. The YAML parser discards comments, so # notes in the file do not reach the Markdown. If a comment explains a setting, add it back as text under that heading.
Does it work on an OpenAPI or Swagger file?
It converts, but the result is a long run of nested headings, not an API reference. Every path, method and schema becomes its own heading. A dedicated OpenAPI renderer is a better fit for that.
Why does the output start at a # heading?
Top-level keys map to level 1 headings. If you are pasting the result into a page that already has a title, demote the headings by adding one # to each.
My config has passwords in it. Is it safe to paste?
The conversion runs in your browser and nothing is uploaded. The Markdown will still contain the secret values, so remove them before you commit or share the result.