A fast, beautiful OCR command-line tool for macOS. Powered by Apple Vision framework's VNRecognizeTextRequest (Revision 3).
Pipe-friendly by default — results go to stdout. Write to files with -o and the format is auto-detected from the extension.
swift build -c release
cp .build/release/macocr /usr/local/bin/
macocr photo.jpg # OCR to stdout
macocr scan.png -o results.json -c # JSON with confidence scores
macocr document.pdf -f -l de -o out.md # Fast German PDF to Markdown
macocr *.png -a --format json > all.json # Batch with auto-detect
macocr receipt.jpg -w "IBAN" -w "BIC" # Custom dictionary
| Flag | Description |
|---|---|
-f, --fast |
Fast recognition (lower quality, near-instant) |
-l, --languages |
Set languages in priority order (-l en -l de) |
-a, --auto-detect |
Automatically detect document language |
--no-correction |
Disable language correction |
-w, --words |
Custom dictionary words |
--min-height |
Minimum text height relative to image (0.0-1.0) |
-n, --candidates |
Number of recognition candidates per line |
| Flag | Description |
|---|---|
-o, --output |
Write to file (format from extension: txt/md/json/html) |
--format |
Force output format |
-c, --confidence |
Include confidence scores |
-b, --bounds |
Include bounding boxes |
| Flag | Description |
|---|---|
--dpi |
PDF rasterization DPI (default: 200) |
| Flag | Description |
|---|---|
--list-languages |
Show all supported recognition languages |
--version |
Show version |
- txt — plain text, one line per recognition (default)
- md — Markdown with headers per file
- json — structured JSON with optional confidence/bounds metadata
- html — styled HTML document with dark mode support
Tested on Tesseract's own test images. Full details in benchmark/BENCHMARK.md.
phototest eurotext book page 1 book page 2
(clean) (multi-lang) (scanned) (scanned)
─────────────────────────────────────────────────────────────────────
Tesseract 5 │ 100.0% 98.8% 90.6% 92.2%
ocr🦫 accurate │ 100.0% 99.8% ★ 92.5% ★ 93.0% ★
ocr🦫 fast │ 100.0% 97.6% 38.5% 98.5%
phototest eurotext book page 1 book page 2 4MB grayscale
──────────────────────────────────────────────────────────────────────────────────────
Tesseract 5 │ 0.206 0.573 2.033 2.178 2.245
ocr🦫 accurate │ 0.870 0.431 ★ 0.938 ★ 1.084 ★ 1.067 ★
ocr🦫 fast │ 0.156 ★ 0.164 ★ 0.474 ★ 0.478 ★ 0.144 ★
| Engine | Avg Accuracy | Avg Speed | Best For |
|---|---|---|---|
| Tesseract 5 | 95.4% | 1.25s | Cross-platform, Linux servers |
| ocr🦫 accurate | 96.3% | 0.83s | Best quality on macOS |
| ocr🦫 fast | 83.7% | 0.32s | Quick previews, clean input |
30 languages in accurate mode including English, German, French, Spanish, Chinese, Japanese, Korean, Russian, Arabic, and more. Run macocr --list-languages for the full list.
macOS 14+, Swift 5.9+
MIT