Markdown Formatting Tips for Better LLM Prompts
Use headings, lists, and code fences to structure prompts so ChatGPT, Claude and Gemini follow instructions more reliably.
Separate the parts
A good prompt has distinct parts: role, task, context, constraints, output format. Headings make those boundaries obvious to both you and the model.
Useful patterns
Simple structures go a long way:
- ## Task, ## Context, ## Output format headings
- Numbered steps for multi-part instructions
- Code fences around data, logs, and examples
- Tables for comparisons the model should fill in
Convert existing content
If your context is a web page or rich document, convert it with the Markdown Converter. Then check the size in the Token Counter; Markdown is usually far lighter than the HTML it replaces.
Try it free in your browser
- Markdown Converter — Paste HTML, DOCX, or webpage text and get tidy Markdown.
- Token Counter — Live token, character, and context-window meter for any prompt. Uses official tiktoken encoders.
Tools mentioned
Frequently asked
Does Markdown really help models?
Models are trained on a lot of Markdown, so clear headings and lists help them distinguish instructions from data.
Is XML better than Markdown?
Both work. Markdown is lighter for humans to write; XML-style tags are useful for wrapping long documents.
Keep reading
How to Prepare PDFs for ChatGPT, Claude, and Gemini
A practical guide to extracting clean, AI-ready text from PDFs — born-digital and scanned — so ChatGPT, Claude, and Gemini answer accurately and don't waste tokens on headers, footers, and page numbers.
The Best Way to Feed Long Documents to Claude (and Other Long-Context Models)
Claude's 200K-token context is generous, but you'll still want to clean, compress, and structure long documents before sending them. Here's a step-by-step playbook.
Cleaning Whisper Transcripts for AI Summaries
OpenAI Whisper, Otter, and YouTube transcripts are full of timestamps, filler words, and speaker noise. Here's how to strip them before sending to ChatGPT or Claude — and why it matters.