What docTR is
docTR is a free deep-learning OCR library for finding and recognizing text in documents, intended for document automation and research. Its pretrained predictors first detect text and then recognize it, while a layout predictor identifies areas such as tables, figures and headers. It can load PDFs and images, and web pages when the optional HTML extra is installed. Results can be rendered as plain text or exported as a JSON-serializable nested dictionary. The project describes its predictors as optimized for CPU and GPU inference. Users can train custom detection, recognition, layout and table-structure models if the pretrained options do not fit their needs. Documentation covers loading and sharing models through the Hugging Face Hub, and includes a minimal REST API deployment template and browser demo. Installation is available through pip, Git or official Docker images. The library requires Python 3.11 or higher and is licensed under Apache License 2.0. Pretrained weights download on first use and are cached locally.
Who it suits
docTR suits developers and research teams building document automation workflows who can work with Python 3.11 or higher. It also fits users who need to customize OCR or layout models.
Good to know, and what to watch
- Pretrained predictors detect and recognize text in two stages.
- Layout predictor identifies tables, figures and headers.
- Supports PDFs, images and optional HTML input.
- Custom detection, recognition and layout models can be trained.
- Free under Apache License 2.0.
- Requires Python 3.11 or higher.
- Web-page input requires the optional HTML extra.
- AWS Lambda setup requires disabling multiprocessing and moving the cache to /tmp.
- Pretrained weights download on first use.
Plans
Every plan and pricedocTR open-source Python library
Free plan
Getting started
- Install Python 3.11 or higher
- Install docTR with pip or from Git
- Alternatively use an official Docker image
- Download pretrained weights on first use
- Load PDFs, images, or web pages with the optional HTML extra
- Render OCR results as plain text or export a JSON-serializable dictionary
Limits to check
docTR requires Python 3.11 or higher. HTML input needs the optional HTML extra, and the contrib artefact detector requires onnxruntime.
The Club's review
docTR is a Python library for adding document OCR and layout analysis to software or research workflows. It suits developers who want to build and customize an OCR pipeline rather than use a packaged scanning app. Its capabilities are broad for a free library, but Python 3.11 or higher is a firm entry requirement.
Overview
docTR pairs pretrained text detection and recognition in a two-stage OCR pipeline with a separate predictor for document layout. That makes it a stronger fit for workflows that need both text and page structure than for readers who simply want to upload a file and receive a finished document. The project is licensed under Apache License 2.0, and can be installed with pip, from Git, or through official Docker images.
Key features
- Text recognition and layout: Pretrained predictors locate and recognize text, while a layout predictor identifies regions such as tables, figures, and headers. The structural output can help applications route or interpret page content, but docTR is a library for constructing workflows, not a ready-made document processing service.
- Multiple input and output paths: The quickstart covers PDFs, images, and web pages. HTML requires the optional html extra, so web-page support may need an additional installation step. Results can be rendered as plain text or exported as a JSON-serializable nested dictionary for use in application code.
- Inference and customization: Predictors are described as optimized for CPU and GPU inference. When pretrained models are not suitable, users can train custom detection, recognition, layout, and table-structure models. That flexibility favors teams prepared to work on model training; it is more commitment than a basic OCR task requires.
- Model access and deployment: Documentation describes loading and sharing models through the Hugging Face Hub, and provides a minimal REST API template and a browser demo. These offer starting points for integration and demonstration, rather than a packaged hosted service.
- Additional detection: The contrib module includes an artefact detector for logos, QR codes, and barcodes, but requires onnxruntime. Pretrained weights download on first use and are cached locally for later calls.
Installation requires Python 3.11 or higher. For AWS Lambda, the guide advises disabling multiprocessing and placing the model cache under /tmp to meet the platform's write restrictions. Questions can go to GitHub Discussions or the #doctr Slack channel; the project also invites issues and pull requests for community models.
Pricing
docTR open-source Python library — free. The free plan includes the Python library and can be installed with pip, Git, or Docker; Python 3.11 or higher is required. There is no free trial because the library is free to use. This suits developers and researchers able to manage installation and integration themselves. It is not a hosted plan with a stated seat or usage allowance; the documented trade-off is the technical setup and workflow ownership that come with a library.
Platforms
docTR is available for Linux, macOS, and Windows, with API and self-hosted use also supported. It is primarily a desktop offering, but its library, REST API template, and Docker images give developers options for incorporating it into software or deployment workflows. The available inputs are PDFs, images, and web pages, with HTML requiring the optional extra.
Who it's for
Choose docTR if you are a developer or researcher building document automation and need OCR outputs, layout signals, or the option to train models for your own use case. It also suits teams that want a free, self-hosted foundation and can meet its Python requirement. Look elsewhere if you need a turnkey OCR interface or a hosted processing service rather than a library to integrate.
Pros and cons
- Pro — More than text extraction: Separate layout prediction can identify tables, figures, and headers, which helps workflows that need page structure alongside recognized text.
- Pro — Room to tailor models: Custom training covers detection, recognition, layout, and table structure when pretrained predictors are not enough.
- Pro — Multiple integration routes: pip, Git, Docker, Hugging Face Hub support, and a minimal REST API template give technical teams several ways to work with the library.
- Con — Requires a current Python environment: Python 3.11 or higher excludes users unable to meet that runtime requirement.
- Con — Not a packaged service: Users must integrate the library into their own workflow, so it is a poor match for someone who wants OCR without development work.
- Con — Some capabilities add setup: HTML input needs an optional extra, and the contrib artefact detector needs onnxruntime.
Alternatives
For more options, browse OCR software or OCR API Software.
- PaddleOCR is another free OCR option, with Android and iOS platforms and an Official API Free Tier capped at 20,000 document pages per day. Consider it when those mobile platforms or the stated API allowance better fit your needs.
- Tesseract OCR is a free Apache 2.0 OCR engine available on Android, Linux, macOS, Windows, and as API or self-hosted software. Choose it when you want an OCR engine across those platforms rather than docTR's documented layout and custom-model options.
- FreeOCR.AI is a freemium option for API, macOS, web, and Windows. Its Monthly Pro plan is $10 a month for 10,000 credits per month, while Yearly Pro is $80 a year for 120,000 credits per year; consider it if those paid credit plans and platforms suit your workflow.
- OCRmyPDF is free, self-hosted software for Linux, macOS, Windows, and API use that depends on external OCR and PDF tools. Pick it when that self-hosted approach and its external-tool dependencies fit your PDF workflow better.
- Open-Capture is free, open-source software under GNU GPLv3 for API, Linux, self-hosted, and web use, with no limit on users. It may fit teams that specifically need a user-unlimited platform across those environments.
- EasyOCR is a free option for Linux, macOS, Windows, and self-hosted use.
- i2OCR is a freemium web option whose Free OCR plan processes one image or PDF page at a time. Consider it when browser access and single-page processing are a better fit than integrating a library.
- Prizmo is a freemium option for iOS and macOS.
Verdict
docTR is a strong choice for developers and researchers who want a free, customizable OCR library with layout analysis and control over integration. Its main reason to choose is the combination of text recognition, structural prediction, and custom model training; its main reason to look elsewhere is the Python 3.11-or-higher requirement and the work of building your own application around it.
The verdict
docTR provides OCR, layout analysis and options to customize models for document workflows. It is a free library, but installation requires Python 3.11 or higher.
Questions people ask
Is docTR free?
Yes. The docTR open-source Python library costs nothing and uses the Apache License 2.0.
Which operating systems and platforms are supported?
The listed platforms are API, Linux, macOS, self-hosted, and Windows. Installation is available through pip, Git, or Docker.
What files can docTR read?
It can load PDFs and images. Web pages are supported when the optional HTML extra is installed.
Can docTR use custom models?
Yes. Users can train custom detection, recognition, layout, and table-structure models when pretrained models are unsuitable.
How are OCR results returned?
Results can be rendered as plain text or exported as a JSON-serializable nested dictionary.
Where can users get support?
The contribution guide directs questions to GitHub Discussions and a #doctr Slack channel.
What the maker publishes
- Customization
- Users can train custom detection, recognition, layout, and table structure models when pretrained models do not meet their needs. source
- Deployment
- The project provides a minimal REST API deployment template and a browser demo. source
- Deployment
- The documentation offers templates for a browser demo and API deployment, and documents running docTR on AWS Lambda. source
- Extra modules
- The contrib module includes an artefact detector for items such as logos, QR codes, and barcodes, and requires onnxruntime. source
- Founded
- 2021 source
- Free plan
- Yes source
- Inference
- The project describes its predictors as optimized for inference on both CPU and GPU. source
- Input formats
- docTR can read PDFs, images, and web pages, with HTML input requiring the optional html extra. source
- Inputs and outputs
- The quickstart shows loading PDFs, images, and web pages and exporting results as plain text or a JSON-serializable dictionary. source
- Supported inputs
- both source
- Installation
- The library can be installed with pip or from Git, and official Docker images are available from GitHub Container Registry. source
- Installation requirement
- The library requires Python 3.11 or higher and can be installed from pip, Git, or an official Docker image. source
- Integrations
- The documentation describes loading and sharing models through the Hugging Face Hub. source
- Layout analysis
- A layout predictor detects document regions such as tables, figures, and headers. source
- License
- The project identifies its license as Apache License 2.0. source
- License
- The documentation's source code identifies the program as licensed under Apache License 2.0. source
- Maker
- The project documentation says docTR is actively maintained by Mindee. source
- OCR features
- It provides pretrained two-stage text detection and recognition predictors and a layout analysis predictor for regions such as tables, figures, and headers. source
- OCR pipeline
- Its pretrained OCR predictors use a two-stage text detection and recognition pipeline. source
- Output
- OCR results can be rendered as plain text or exported as a JSON-serialisable nested dictionary. source
- Primary platform
- desktop source
- Pretrained weights
- Pretrained weights are downloaded on first use and cached locally for later calls. source
- Purpose
- docTR is a deep learning OCR library for locating and recognizing text in documents, intended for document automation and research. source
- Requirements
- The installation guide requires Python 3.11 or higher. source
Checked against the maker's pages on 5 Oct 2026.