> Source: https://txtfetch.com/extract > Plain-text twin — every page on txtfetch.com has one. https://txtfetch.com/text --- # Extract text from anything, one format at a time. Every format has its own gotchas. Pick yours below for the working curl, the covered extensions, and the answers people actually search for. Prefer to start from your language instead of the file format? See [extract by language](https://txtfetch.com/for) for Python, JavaScript, Go, Java, and C#. Already extracted something and the text came back wrong instead? See [fixes for broken extracted text](https://txtfetch.com/fixes). ## PDF & scans - **[.pdf (digital)](https://txtfetch.com/extract/pdf)** ### Extract text from any PDF, one request. Multi-column academic papers. Dense financial tables. Scanned contracts. One endpoint returns all of them in the same response shape, with no per-layout tuning. - `.pdf` Extract .pdf (digital) → - **[.pdf (scanned)](https://txtfetch.com/extract/scanned-pdf)** ### Scanned PDFs, OCR'd without a flag. No text layer, skewed feeder scans, low-DPI faxes. txtfetch detects the blank pass itself and retries through OCR, in the same request. - `.pdf` Extract .pdf (scanned) → ## Office - **[.docx](https://txtfetch.com/extract/docx)** ### Every Office format, one endpoint. Word, PowerPoint, Excel, RTF, OpenDocument. Per-format libraries and screenshot-reading VLMs both struggle to cover that breadth in one pipeline. - `.docx` - `.doc` - `.pptx` - `.ppt` - `.xlsx` - `.xls` - `.odt` - `.ods` - `.odp` - `.rtf` Extract .docx → - **[.pptx](https://txtfetch.com/extract/pptx)** ### Slide text and speaker notes, together. Most extractors keep one or the other. txtfetch reads slide bodies and speaker notes from the same request. - `.pptx` - `.ppt` - `.pptm` - `.potx` - `.odp` Extract .pptx → - **[.xlsx](https://txtfetch.com/extract/xlsx)** ### Spreadsheets, resolved not raw. Cell values are indices into a shared string table. Formulas store their formula, not their answer. Tika resolves both before you ever see the response. - `.xlsx` - `.xls` - `.xlsm` - `.csv` - `.ods` Extract .xlsx → - **[.doc](https://txtfetch.com/extract/legacy-office)** ### The 97-2003 binary formats, read properly. OLE2 Compound File Binary Format isn't a smaller version of OOXML. It's a different filesystem-in-a-file, and .doc text isn't stored in reading order. - `.doc` - `.xls` - `.ppt` - `.pub` - `.wpd` Extract .doc → - **[.rtf](https://txtfetch.com/extract/rtf)** ### RTF, parsed properly, not regex-stripped. \\uN? Unicode escapes are followed by an ANSI fallback character on purpose. Strip backslashes with a regex, and you duplicate every non-ASCII character in the document. - `.rtf` Extract .rtf → ## Open formats - **[.odt](https://txtfetch.com/extract/odf)** ### OpenDocument, zipped or flat. content.xml plus its styles and metadata parts, a markup vocabulary of its own. And a tracked-changes block means struck-out text is still in the file you're about to extract. - `.odt` - `.ods` - `.odp` - `.fodt` - `.otp` - `.ott` Extract .odt → ## Email - **[.eml](https://txtfetch.com/extract/email)** ### Email, headers to attachments, one call. From/To/Subject headers, the message body, and attached documents all come out together. You don't orchestrate separate steps. - `.eml` - `.msg` - `.mbox` Extract .eml → - **[.msg](https://txtfetch.com/extract/msg)** ### Outlook .msg isn't email, structurally. MAPI property streams inside an OLE2 container. Nested .msg-in-.msg attachments. Whole mailbox databases. None of it looks like an .eml file. - `.msg` - `.eml` - `.mbox` - `.pst` - `.ost` Extract .msg → ## Web & data - **[.html](https://txtfetch.com/extract/html)** ### Any web page, fetched and reduced to clean text. Pass a URL, not a file. txtfetch fetches the page server-side and hands back clean text, with the markup, scripts, and styles gone. Deciding what's chrome (nav, ads, cookie banners) versus article is a caller-side call. See the free tool below to check yours. - `.html` - `.htm` - `.xhtml` Extract .html → - **[.csv](https://txtfetch.com/extract/csv)** ### CSV, decoded from the bytes. Comma, semicolon, tab, or pipe. UTF-8, Windows-1252, or UTF-16 with a BOM. txtfetch settles the encoding question from the file itself, and hands back the rows exactly as written. - `.csv` - `.tsv` - `.psv` - `.txt` Extract .csv → - **[.xml](https://txtfetch.com/extract/xml)** ### Markup stripped, order preserved. DITA, DocBook, JATS, XBRL filings. The content is real prose buried in tags, entities, and attributes, in document order, not alphabetical or arbitrary order. - `.xml` - `.json` - `.yaml` - `.html` - `.xhtml` - `.svg` Extract .xml → ## Images & OCR - **[.png](https://txtfetch.com/extract/image)** ### OCR that's just another curl request. Scanned receipts, faxed contracts, photographed whiteboards. Tesseract OCR runs automatically, with no separate OCR pipeline to stand up. - `.png` - `.jpg` - `.jpeg` - `.tiff` - `.tif` - `.bmp` - `.gif` Extract .png → - **[.tiff](https://txtfetch.com/extract/tiff)** ### Every page of the TIFF, not just the first. A multi-page fax TIFF is a chain of image directories, not one picture. Read the file the way most image loaders do and you silently lose every page after the first. - `.tiff` - `.tif` - `.jpg` - `.png` - `.bmp` - `.webp` - `.gif` Extract .tiff → ## Books & archives - **[.epub](https://txtfetch.com/extract/epub)** ### Ebooks in, chapter text out. EPUB's zipped-XHTML internals are exactly the kind of format archaeology txtfetch exists to hide from you. - `.epub` Extract .epub → - **[.zip](https://txtfetch.com/extract/zip)** ### One ZIP, every file's text back. Skip the unzip-then-loop script. Point txtfetch at an archive and get every contained document's text back from one request. - `.zip` Extract .zip → ## Audio & video - **[media captions](https://txtfetch.com/extract/captions)** ### Where the text in a video or audio file actually lives. Not every media file has text in it. What you get back depends entirely on the container. This page maps a caption sidecar, a tagged MP3, and a plain WAV to what each one actually returns. That includes the cases where the honest answer is nothing. - `.srt` - `.vtt` - `.ttml` - `.mp4` - `.mov` - `.m4a` - `.mp3` - `.ogg` - `.flac` Extract media captions → ## Send a real file through it. One HTTP call returns the text. Read one in your browser first, for free. [Get an API key →](https://app.txtfetch.com/signup) [Open the free file reader →](https://txtfetch.com/tools/file-to-text)