Techniques··4 min read

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