https://txtfetch.com/formats/
Every format, one endpoint.
txtfetch detects the real type from the bytes, not the extension, and hands it to Apache Tika. Drop a file below and watch txtfetch fingerprint it from the bytes, or search the full list.
Drop a file below to see what txtfetch detects — runs in your browser, nothing is uploaded.
PDF, Office docs, images, email, and more — the file never leaves this page.
See its text right now, free →Run the deeper PDF check →Now get its text →Ask us →
The exact API call for :
curl -X POST https://api.txtfetch.com/v1/extract \
-H "Authorization: Bearer $TXTFETCH_KEY" \
-F file=@__FILENAME__import os
import requests
with open("__FILENAME__", "rb") as f:
r = requests.post(
"https://api.txtfetch.com/v1/extract",
headers={"Authorization": f"Bearer {os.environ['TXTFETCH_KEY']}"},
files={"file": f},
)
print(r.json()["extracted_text"])import { readFile } from "node:fs/promises";
const file = new Blob([await readFile("__FILENAME__")]);
const form = new FormData();
form.append("file", file, "__FILENAME__");
const res = await fetch("https://api.txtfetch.com/v1/extract", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.TXTFETCH_KEY}` },
body: form,
});
const { extracted_text } = await res.json();
console.log(extracted_text);package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"mime/multipart"
"net/http"
"os"
)
type extractResponse struct {
Status string `json:"status"`
ExtractedText string `json:"extracted_text"`
}
func main() {
f, err := os.Open("__FILENAME__")
if err != nil {
panic(err)
}
defer f.Close()
var body bytes.Buffer
writer := multipart.NewWriter(&body)
part, err := writer.CreateFormFile("file", "__FILENAME__")
if err != nil {
panic(err)
}
if _, err := io.Copy(part, f); err != nil {
panic(err)
}
writer.Close()
req, err := http.NewRequest("POST", "https://api.txtfetch.com/v1/extract", &body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("TXTFETCH_KEY"))
req.Header.Set("Content-Type", writer.FormDataContentType())
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
var result extractResponse
if err := json.NewDecoder(resp.Body).Decode(&result); err != nil {
panic(err)
}
fmt.Println(result.ExtractedText)
}PDF & documents
.pdfPortable Document Format.rtfRich Text Format.txtPlain text.mdMarkdown.texLaTeX source.logLog file
Microsoft Office (modern)
.docxWord document.dotxWord template.xlsxExcel workbook.xlsmExcel workbook (macro-enabled).pptxPowerPoint presentation.pptmPowerPoint presentation (macro-enabled).potxPowerPoint template
Microsoft Office (legacy)
.docWord 97-2003 document.xlsExcel 97-2003 workbook.pptPowerPoint 97-2003 presentation.pubPublisher document.vsdVisio drawing.oneOneNote notebook.msgOutlook message
Deep dive: extract text from legacy .doc, .xls and .ppt files →
OpenDocument
.odtOpenDocument text.odsOpenDocument spreadsheet.odpOpenDocument presentation.odgOpenDocument graphics.ottOpenDocument text template.fodtFlat OpenDocument text
Apple iWork
.pagesPages document.numbersNumbers spreadsheet.keyKeynote presentation
Email & messaging
.emlEmail message.msgOutlook message.mboxMailbox archive.pstOutlook data file.ostOutlook offline data file.vcfvCard contact
Web & markup
.htmlHTML page.htmHTML page.xhtmlXHTML page.xmlXML document.rssRSS feed.atomAtom feed
Data & structured
.csvComma-separated values.tsvTab-separated values.jsonJSON document.yamlYAML document
Images (OCR via Tesseract)
No text layer? Tesseract OCR reads the pixels automatically — same request, same response.
.pngPNG image.jpgJPEG image.jpegJPEG image.tiffTIFF image.bmpBitmap image.gifGIF image.webpWebP image
Archives (recursed)
Contained files are extracted and their text pulled out too, not just filenames.
.zipZIP archive.tarTar archive.gzGzip archive.7z7-Zip archive
Audio & video (metadata only)
Tika reads embedded metadata and tags here — title, artist, duration, codec — not spoken words. txtfetch does not transcribe audio or video.
.mp3MP3 audio (ID3 tags).wavWAV audio (metadata).mp4MP4 video (metadata).movQuickTime video (metadata).m4aMPEG-4 audio (metadata).oggOgg audio/video (metadata).flacFLAC audio (metadata)
Try it: extract & clean up a video/audio file's caption track →
not-listed
This is the common-case shortlist, not the whole list. txtfetch's engine recognizes far more than what's above. Look your exact extension or media type up on the full coverage page, checked against the build we run for a real verdict. Or tell us what you're working with, and we'll confirm.
Ask us →under-the-hood
Every format above goes through the same pipeline. txtfetch detects the real type, extracts structurally with Apache Tika, and falls back to Tesseract OCR when there's no text layer. Then it returns clean JSON. See how it works end to end.
Detection reads a file's magic bytes, not its extension or claimed media type. See the glossary for what both terms mean.
Stop parsing. Start shipping.
Create an account and get an API key in minutes. The free Hobby plan needs no card.
Get started →