Dev.to WebDev 🛠 Dev 👁 0 📖 1 min read

What is an MD File

When I first started using AI apps that save files to my local hard drive, I had them save the output as .docx files. Those were easy to read. Raw output from most AI agents was harder to read, and cutting and pasting it

When I first started using AI apps that save files to my local hard drive, I had them save the output as .docx files. Those were easy to read. Raw output from most AI agents was harder to read, and cutting and pasting it into Word was a chore.

I soon realized that converting that text to .docx used a lot of tokens. So I started using .md files instead. A .md file is a Markdown file. Markdown is a lightweight markup language, and an .md file is essentially a text file that stays easy to read while still carrying simple formatting.

These files are widely used for README documentation in software repositories like GitHub, for technical writing, and for static site generation. You can safely open them in any standard text editor, and you can convert them to HTML or other formatted documents for the web.

I use Pandoc (pandoc.org) to convert a .docx file to a .md file and back. Pandoc also handles conversion to many other file types.

To go from docx to md, I use:

pandoc -s FileName.docx -t gfm --wrap=none -o FileName.md

To go from md to docx, I use:

pandoc "FileName.md" -o "FileName.docx"

Going from md to docx creates a very readable file, formatted the way we are used to seeing documents.

.md files are also handy when I write a set of instructions or a spec that I then hand off to Grok or Claude Code running locally on my computer.

Quick reference for the core Markdown syntax

Element Syntax
Heading # H1 through ###### H6
Bold **text**
Italic *text*
Bold + Italic ***text***
Strikethrough ~~text~~
Inline code `code`
Code block ` (fence with an optional language)
Link [text](url)
Image ![alt](url)
Blockquote > quote
Unordered list - item
Ordered list 1. item
Task list - [ ] task / - [x] done
Horizontal rule ---
Line break Two trailing spaces, then Enter
📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.