---
title: "oneocr"
url: https://recursiveai.org/oneocr/
description: "Local OCR and document understanding for .NET in pure C#, with small models of its own and no native binaries. A page model with boxes and calibrated confidences, invoices and receipts as fields, PDF pages, and optional LLM vision checked against the page. MIT or Apache-2.0."
---

# oneocr

Local OCR and document understanding for .NET, in pure C# with small models of its own. Images and PDFs in; text, a page model with boxes and calibrated confidences, Markdown, or invoice and receipt fields out.

```sh
dotnet add package RecursiveAI.OneOcr
```

- [Getting started](https://recursiveai.org/oneocr/docs/getting-started/)
- [Docs](https://recursiveai.org/oneocr/docs/)
- [Cookbook](https://recursiveai.org/oneocr/cookbook/)
- [GitHub](https://github.com/recursive-ai-oss/oneocr-csharp)
- [NuGet](https://www.nuget.org/packages/RecursiveAI.OneOcr)

## A quick look

Load the bundled models once, then read text, the whole page or an invoice’s fields. Nothing to download, and nothing leaves the machine. Invoice fields also need `RecursiveAI.OneOcr.Models.Documents`.

[Getting started](https://recursiveai.org/oneocr/docs/getting-started/)

*Program.cs · C#*

```
using OneImage;
using OneOcr;
using OneOcr.Documents;
using OneOcr.Models.Documents;
OcrEngine engine = OcrEngine.LoadBundled();
Image image = Image.Load("invoice.png");
string text = image.ToText(engine);
OcrPage page = image.Ocr(engine);
DocumentModels.Configure();
Invoice invoice = image.ExtractInvoice(engine);
Console.WriteLine(invoice.Total?.Value);
```

### Local, managed, no setup

The recognizer, page detector and word models ship inside the package and run on the CPU. No native binaries, no `tessdata`, no network. Latin, Greek and Cyrillic in one model.

### A page, not a string

Blocks, lines, words and characters with boxes, tables with spans, key–value pairs and reading order, saved as versioned `oneocr.page` JSON.

### Confidence you can use

A word’s confidence is the calibrated probability that it is exactly right, so one threshold means the same thing on every page.

### Invoices and receipts as fields

Typed fields with their EN 16931 business terms, each with the words and box it was read from. A local model tags words on the page, so it can’t invent a value.

### LLM vision, held to the page

Opt-in providers over plain `HttpClient`. Every value the model returns is checked against the page’s words and marked grounded, derived or ungrounded.

### Same bytes everywhere

Text, boxes and confidences are bit-identical on AVX-512, AVX2, 128-bit vectors and the scalar path, at every thread count. NativeAOT and trimming work.

## Measured against four engines, wins and losses

One run of the release gate on a sealed test set, against Tesseract 5.3.4, PaddleOCR, docTR and Apple Vision. OneOcr was the best engine measured on five of the ten gated categories and behind the best on five: synthetic screenshots, complex layout, real web screenshots, clean real PDFs and generated photos of US receipts. The tables, conditions and method are published in full.

[The benchmark tables](https://recursiveai.org/oneocr/docs/overview/#benchmarks)

## The packages

- **RecursiveAI.OneOcr**: Local OCR, the page model and its JSON, local Markdown, and invoice, receipt and custom extraction. No networking code. Pixels through oneimage. 1.0.0.
- **.Models**: `RecursiveAI.OneOcr.Models` embeds the recognizer, page detector and word models, checked against their SHA-256 pins on every load. Installed with the core package. 1.0.0.
- **.Models.Documents**: `RecursiveAI.OneOcr.Models.Documents` adds the invoice and receipt extraction model. 1.0.0.
- **.Pdf**: `RecursiveAI.OneOcr.Pdf` reads PDF pages: text-layer words through onepdf, and OCR of the image regions the text doesn’t cover. 1.0.0.
- **.Llm**: `RecursiveAI.OneOcr.Llm` adds LLM vision: Anthropic, OpenAI, OpenAI-compatible servers, Gemini and Azure OpenAI, with grounding, cost caps and routing. The only package that uses the network. 1.0.0.
- **.Training**: `RecursiveAI.OneOcr.Training` fine-tunes the recognizer or a new extraction head on your own documents, on the CPU, deterministically, with a review queue. 1.0.0.
- **.Tool**: `RecursiveAI.OneOcr.Tool` is the `oneocr` command line: `ocr`, `train`, `eval` and `review`. 1.0.0.
- **.NET**: .NET 10. NativeAOT and trimming are supported. Every package shares one version. Code and model weights are MIT or Apache-2.0.

## Go further

- [GitHub](https://github.com/recursive-ai-oss/oneocr-csharp)
- [NuGet](https://www.nuget.org/packages/RecursiveAI.OneOcr)
- [Getting started](https://recursiveai.org/oneocr/docs/getting-started/)
- [All docs](https://recursiveai.org/oneocr/docs/)
- [Cookbook](https://recursiveai.org/oneocr/cookbook/)
- [Invoices as fields](https://recursiveai.org/oneocr/cookbook/invoices/)
- [PDF pages](https://recursiveai.org/oneocr/cookbook/pdf-pages/)
- [Moving from Tesseract](https://recursiveai.org/oneocr/docs/migrating-from-tesseract/)
- [Benchmarks](https://recursiveai.org/oneocr/docs/overview/#benchmarks)
- [Changelog](https://github.com/recursive-ai-oss/oneocr-csharp/blob/v1.0.0/CHANGELOG.md)
