# What is document parsing?

Document parsing converts files such as PDF, DOCX and XLSX into text or markdown a language model can read, keeping headings and tables intact.

Document parsing converts structured or binary document formats, such as PDF, DOCX, XLSX, PPTX and CSV, into machine-usable text or markdown, preserving structure like headings and tables. LLM pipelines depend on it because models consume plain text, not binary files: parsing turns a report or spreadsheet into content a context window can read.

## Why LLM pipelines need document parsing

A lot of the web's substantive content does not live in HTML. Research papers, financial filings, government reports, product specification sheets and datasets are published as PDFs, word-processor documents, spreadsheets and slide decks. To a text-only pipeline those files are opaque: a PDF mostly describes where glyphs sit on a page, and an XLSX file is a zipped bundle of XML.

Document parsing is the decoding step in between. A parser opens the file format, extracts the text, and rebuilds the document's logical structure (heading levels, paragraphs, lists and tables) as markdown or plain text. Keeping structure is what separates a good parser from a raw text dump: a financial table flattened into one stream of words loses the row and column relationships a model needs to answer questions about it. Structured, compact output is the document-side counterpart of [LLM-ready data](https://millionshort.com/docs/glossary/what-is-llm-ready-data) for webpages.

## Document parsing vs web scraping

The two are often bundled but do different jobs. Web scraping is about fetching: retrieving a page over HTTP, rendering JavaScript if needed, and isolating the main content (see [what a web scraping API does](https://millionshort.com/docs/glossary/what-is-a-web-scraping-api)). Document parsing is about decoding a format: taking a file that the fetch already returned and translating its internal format into text.

For HTML pages the decoding step is [HTML to markdown conversion](https://millionshort.com/docs/glossary/what-is-html-to-markdown). For a PDF or DOCX it is a parser for that format. A pipeline that fetches URLs but cannot parse documents silently drops every PDF link it meets, and in research-heavy work those are often the primary sources.

## Document parsing vs OCR

Document parsing reads the digital structure of a file. A PDF exported from software carries an embedded text layer, and a DOCX carries its text as XML, so a parser can read the characters directly. Reading order and tables in a PDF can still come out wrong, because the format records positions, not structure.

[OCR (optical character recognition)](https://millionshort.com/docs/glossary/what-is-ocr) solves a different problem: recognizing text in images, such as scanned pages, photos and screenshots, where no text layer exists. A scanned PDF looks like a PDF but is really a stack of pictures. Parsing alone gets nothing out of it, and it needs OCR.

## Where MillionShort fits

MillionShort does not offer document parsing. You cannot send it a PDF or a spreadsheet to convert, and search results are snippets, not parsed documents.

What is related: several of the 13 [sources](https://millionshort.com/docs/search/sources), such as `academic`, `medical`, `law` (United States), `finance` and `contracts`, search material that is commonly published as documents, and return a snippet and a URL for each result like any other source. [Extract](https://millionshort.com/docs/extract/parameters) turns a URL into clean text; its page says which kinds of page it reads.
