Skip to content
@oneocr

oneocr

Windows 11 built-in OCR engine, wrapped in pure Java - and the 1ocr command line tool.

oneocr

oneocr

Windows 11's built-in OCR engine, wrapped in pure Java — and a command line tool built on it.

Website · Live output · The 1ocr command


The Windows 11 Snipping Tool carries an undocumented ~50 MB Microsoft OCR model called OneOCR. It is fast, it is already on the machine, and it reads Latin, Devanagari and Tamil well. It has no public API.

These repositories bind it from Java through the Foreign Function & Memory API — no JNI, no native glue to compile — and build a command line tool on top that reads images, PDFs and whole folders, and writes text, JSON, SVG and a browser-renderable semantic XHTML that keeps every word's bounding box and confidence.

The work rests on the reverse-engineering of b1tg/win11-oneocr and others.

Repositories

Repository Maven artifact What it is
cli io.github.oneocr:oneocr-cli The 1ocr command — images, PDFs, folders, and the layout-aware export
api io.github.oneocr:oneocr-api The FFM binding to oneocr.dll. Use this to build your own tool
tesseract io.github.oneocr:oneocr-tesseract Optional Tesseract 5 second pass, for the scripts OneOCR cannot read
xhtml_controls_js io.github.oneocr:oneocr-xhtml_controls_js The viewer controls for that XHTML, written in Java and compiled to JS by TeaVM
semantic_xhtml The CSS and JS every generated document links, served over GitHub Pages

Quick start

1ocr page.png                     # txt, json, svg and semantic xhtml beside the input
1ocr pdf order.pdf --layout       # every page, plus a layout-aware text and html export
1ocr folder ./scans -r            # a whole tree, resumable
1ocr layout order.pdf.oneocr.xhtml   # re-render from saved boxes, no second OCR pass

Needs JDK 22+ (JDK 21 works with --enable-preview) and Windows 11.

Two things worth knowing

The native libraries are not distributed here. oneocr.dll, oneocr.onemodel, onnxruntime.dll and opencv_world*.dll are Microsoft components that ship with Windows. Take them from your own installation and drop them in api/src/main/resources/natives/.

Line order is not reading order. The engine reports lines in its own sequence, so a cause title set in two columns comes out interleaved. --layout recovers the real structure by recursive X-Y cutting over the line boxes and writes a parallel text and HTML rendering. On a real 83-page court notice it rejoined 145 orphaned fragments and unscrambled the table of contents.

Status

Windows only today. Linux is the next target, and C sources are expected alongside the Java.

Popular repositories Loading

  1. cli cli Public

    Command-line tools and output formatters for Windows 11 OneOCR using Java FFM (Foreign Function & Memory API).

    Java 1

  2. api api Public

    Java FFM (Foreign Function & Memory API) wrapper for Windows 11 SnippingTool OCR engine.

    Java 1

  3. xhtml_controls_js xhtml_controls_js Public

    Java

  4. tesseract tesseract Public

    Optional Tesseract 5 second pass (Java FFM) for Indic and other scripts Windows 11 OneOCR cannot read.

    Java

  5. semantic_xhtml semantic_xhtml Public

    Published CSS and JS for the OneOCR semantic XHTML5 output format. Served over GitHub Pages and linked by every generated OCR document.

    Java

  6. oneocr.github.io oneocr.github.io Public

    The oneocr website: what it is, what it emits, and live sample output.

    HTML

Repositories

Showing 9 of 9 repositories

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…

Most used topics

Loading…