Convert PDFs and Excel Into LLM-Ready Markdown With Python @realpython
Convert PDFs and Excel Into LLM-Ready Markdown With Python  @realpython
Uploaded November 2026 | Updated December 2026, 2 days ago
Converting Documents to Markdown With MarkItDown (video course) β†’ realpython.com/courses/converting-documents-markdown-markitdown/?utm_source=youtube&utm_medium=description&utm_campaign=converting-documents-markdown-markitdown&utm_content=oRYxRsO-qr0

Your LLM can turn a PDF into Markdown for you, but it spends tokens doing it and you get little say in the result. In this video, you'll do the conversion yourself in Python with Microsoft's MarkItDown library and get documents your LLM can read cheaply and reliably.

Negar Vahid starts with why LLMs love Markdown: it keeps headings, lists, and tables while using far fewer tokens than HTML or XML. Then you'll install MarkItDown, verify the setup, and convert an Excel spreadsheet into a clean Markdown table in four lines of code.

The video wraps up with a challenge: batch-convert a folder of PDFs, Word files, and spreadsheets with MarkItDown and pathlib. The full course goes further, with the MarkItDown MCP server in Claude Desktop, image descriptions with OpenAI, and the library's limits.

Create Your Personal Python & AI Coding Learning Plan β†’ realpython.com/plan?utm_source=youtube&utm_medium=description&utm_campaign=learning-plan&utm_content=oRYxRsO-qr0

πŸ‘‰ Links from the video:
Sample code and data files: realpython.com/bonus/python-markitdown-code/?utm_source=youtube&utm_medium=description&utm_campaign=python-markitdown-code&utm_content=oRYxRsO-qr0
Python MarkItDown: Convert Documents Into LLM-Ready Markdown: realpython.com/python-markitdown/?utm_source=youtube&utm_medium=description&utm_campaign=python-markitdown&utm_content=oRYxRsO-qr0
Python Virtual Environments: A Primer: realpython.com/python-virtual-environments-a-primer/?utm_source=youtube&utm_medium=description&utm_campaign=python-virtual-environments-a-primer&utm_content=oRYxRsO-qr0
Python's pathlib Module: Taming the File System: realpython.com/python-pathlib/?utm_source=youtube&utm_medium=description&utm_campaign=python-pathlib&utm_content=oRYxRsO-qr0
MarkItDown on GitHub: github.com/microsoft/markitdown

00:00 What you'll learn
01:31 Why LLMs love Markdown
02:47 Markdown vs HTML vs XML
03:34 What MarkItDown does
04:36 Install MarkItDown
05:49 Verify the install
06:05 The sample files
06:48 Convert an Excel file to Markdown
08:44 Run the script
09:04 Challenge: batch-convert files
09:40 Next up: the MarkItDown MCP server

🐍 Become a Python expert with real-world tutorials, on-demand courses, interactive quizzes, and 24/7 access to a community of experts at https://realpython.com?utm_source=youtube&utm_medium=description&utm_campaign=home&utm_content=oRYxRsO-qr0

β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°
🐍 Start Here β†’ realpython.com/start?utm_source=youtube&utm_medium=description&utm_campaign=start&utm_content=oRYxRsO-qr0
πŸ—ΊοΈ Guided Learning Paths β†’ realpython.com/learning-paths/?utm_source=youtube&utm_medium=description&utm_campaign=learning-paths&utm_content=oRYxRsO-qr0
🎧 Real Python Podcast β†’ realpython.com/podcast?utm_source=youtube&utm_medium=description&utm_campaign=podcast&utm_content=oRYxRsO-qr0

πŸ“š Python Books β†’ realpython.com/books?utm_source=youtube&utm_medium=description&utm_campaign=books&utm_content=oRYxRsO-qr0
πŸ“– Python Reference β†’ realpython.com/ref?utm_source=youtube&utm_medium=description&utm_campaign=ref&utm_content=oRYxRsO-qr0
πŸ§‘β€πŸ’» Quizzes & Exercises β†’ realpython.com/quizzes/?utm_source=youtube&utm_medium=description&utm_campaign=quizzes&utm_content=oRYxRsO-qr0

πŸŽ“ Live Courses: realpython.com/live/?utm_source=youtube&utm_medium=description&utm_campaign=live&utm_content=oRYxRsO-qr0
⭐️ Reviews & Learner Stories: realpython.com/learner-stories/?utm_source=youtube&utm_medium=description&utm_campaign=learner-stories&utm_content=oRYxRsO-qr0
β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°
Convert PDFs and Excel Into LLM-Ready Markdown With PythonClaude Skills Are Just Files You Can Read and EditRedaction Mistake That Leaves Text for AI to Read7 Python Mistakes Beginners MakePerformance Lessons From a Python Team LeadBuild Python CLIs With Argparse and No DependenciesOne Wheel for Free-Threaded and GIL PythonGive AI Just Enough Context to Succeed3 Problems With Hard-Coding Parameters in Python CodeRun AI Models Locally With Ollama and PythonSemantic Versioning: Django and PythonShould Python Have Kept the GIL? Guido Shares His View
Real Python |

Convert PDFs and Excel Into LLM-Ready Markdown With Python

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER