CLI tool
schappim/macOCR avatar
schappim/macOCR

macOCR: screen text, QR codes and barcodes into your clipboard

Get any text on your screen into your clipboard.

2,438 stars120 forksSwiftLicense varies

At a glance

What is it?
macOCR is a Swift command line tool for macOS that captures a region of the screen and runs Apple's Vision framework over it locally. It is for people who keep hitting text they cannot select.
Who is it for?
Adopt macOCR if you work on macOS and regularly need text out of screenshots, video stills or unselectable PDFs, and you are comfortable granting Screen Recording permission to Terminal or to whichever launcher calls it. Do not adopt it if you need Windows or Linux, or if you want a notarised binary with no quarantine step.
Can I use it commercially?
Not without permission. GitHub finds no licence file in the repository, and without a licence all rights are reserved by default: you may read the code but not reuse it. Check the README, or ask the authors, before using it.
Is it still maintained?
Yes. The repository last received commits 26 days ago.
What is it written in?
Mainly Swift, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 30, 2026, and from our analysis. They are not legal advice.

Editorial analysis

The gap macOCR fills on a Mac

Most text on a screen is selectable, and for that you already have copy and paste. The awkward cases are the ones where selection is not available at all: a screenshot someone sent you, a still frame from a video, a PDF whose text layer is broken, an error dialog that vanishes, a conference badge, a parcel label. macOCR targets exactly that gap. You run `ocr`, the cursor becomes a crosshair, you drag a box around the region, and whatever was inside it lands on your clipboard as plain text. The README describes the intended audience indirectly through its examples rather than naming a role, but the shape of the tool points at developers, support staff and anyone doing repetitive copy work from images. It is a macOS-only tool, written in Swift, and it uses Apple's Vision framework rather than a hosted OCR service. That choice is the whole pitch: no API keys, no uploads, no account, and it works offline.

How the capture and recognition pipeline actually runs

The data flow is short and entirely local. macOCR takes a screenshot of the region you selected, hands the image to Vision for text recognition, and then prints the result to stdout while also writing the same plain text to the clipboard. The command reference is explicit that the clipboard always receives plain text regardless of what stdout looks like, which is why `--no-copy` exists as an escape hatch for scripts. Recognition output follows the order Vision found the text, one line per line, so a three-line invoice comes back as three lines. By default the tool reads both the text in the region and the payload of any QR code or barcode it finds, in on-screen order, without you declaring that a code is present. `--barcodes` narrows it to codes only, `--no-barcodes` narrows it to text only, and `--symbologies` restricts the search to named types such as `QR,EAN13`. Nothing leaves the machine: there is no network step in the recognition path described in the README.

Installing macOCR and running your first capture

Homebrew is the documented recommended path, and the README notes the reason plainly: `ocr --update` can upgrade you in place only when Homebrew installed it.

bash
brew install schappim/ocr/ocr

If you would rather not use Homebrew, the release page carries tarballs. On Apple Silicon the documented sequence downloads, extracts and moves the binary into place.

bash
curl -L -o macOCR-arm64.tar.gz \
  https://github.com/schappim/macOCR/releases/latest/download/macOCR-arm64.tar.gz
tar xzf macOCR-arm64.tar.gz
sudo mv ocr /usr/local/bin/ocr

The Intel build follows the same pattern with `macOCR-x86_64.tar.gz`. Released binaries are ad-hoc signed rather than notarised, so macOS may refuse to run a downloaded copy; the README's fix is to clear the quarantine attribute once.

bash
xattr -d com.apple.quarantine /usr/local/bin/ocr

The first run asks for Screen Recording permission because macOCR captures the screen. Grant it, then run `ocr` again. If you invoke it from Alfred, Raycast or Shortcuts, the permission prompt belongs to that app rather than to Terminal, and the README says to approve it there too. Once it works, the first real use is just the bare command.

bash
ocr

Drag a box. You should see the recognised text printed to stdout, and the same text should paste with Command-V. Press Escape to cancel; cancelling copies nothing and leaves your existing clipboard untouched.

Reading files, the clipboard and fixed regions

Screen capture is the headline, but it is not the only input. `ocr -c` reads the image already on your clipboard, which is useful when you have just taken a screenshot with the system shortcut and do not want to re-drag a selection. `ocr -i statement.pdf` reads a PDF straight through, page by page, and `--pages 1,4,7-9` restricts which pages are processed. `--dpi` controls the resolution PDF pages are drawn at, with a documented default of 200. For image files, `ocr -i ~/Desktop/receipt.png` skips screen capture entirely, and `-` as the input reads from standard input. If you would rather not drag at all, `--rect 0,0,800,600` captures a fixed region. `--json` switches stdout to structured output for scripts, and `--save-image <path>` keeps the screenshot alongside the text. The combination of `-i` and `--json` is the most scriptable corner of the tool, because it removes both the interactive selection and the human-readable output from the pipeline.

What macOCR will not do for you

The language situation is the biggest constraint and it is not macOCR's fault. Choosing a language needs macOS 11 (Big Sur) or later; on macOS 10.15 the `-l` flag is not available at all and the tool reads English. What your Mac can recognise depends on the installed macOS version, which is why `--list-languages` asks the system instead of printing a fixed list. The README states that macOS 13 (Ventura) and later recognise around thirty languages, while macOS 11 and 12 recognise eight: English, French, Italian, German, Spanish, Portuguese, and Simplified and Traditional Chinese. A user on an older Mac who needs Japanese is simply out of luck. There is also a platform boundary with no workaround: this is a Swift tool built against Apple's Vision framework, so Windows and Linux are not in scope. A second, softer limitation is that recognition quality is delegated. macOCR does no preprocessing of its own that the README documents, so a blurry video still or a low-contrast dialog will come back as badly as Vision reads it. Finally, the release binaries are ad-hoc signed rather than notarised, which means the quarantine step is part of the install rather than an edge case.

macOCR versus a paid screenshot OCR app

The obvious alternative category is commercial screenshot OCR utilities, TextSniper being the one that shows up in search results alongside macOCR. The difference in approach is not the recognition engine, since both ultimately lean on the same platform frameworks, but the interface and the licensing model. A menu bar app gives you a global hotkey and a preference pane; macOCR gives you a command and a set of flags. That matters in opposite directions. If your workflow is a person dragging a box a few times a day, a menu bar app is less friction. If your workflow is a script, a batch of PDFs, or a launcher you already have configured, a CLI composes with what you already run: `--rect`, `--pages`, `--json` and `--no-copy` have no equivalent in a drag-only app. The README does not position macOCR against any named competitor, so the honest framing is that the two solve the same problem at different layers, and macOCR's advantage is being callable.

Maintenance, updating and the licence question

The repository is not archived, and the last push was on 2026-09-04, with v1.4.0 released the same day and v1.3.0 and v1.2.0 before it in the preceding weeks. That is a recent record, and the README documents an update path: `ocr --update` checks GitHub for a newer release and upgrades via Homebrew. That mechanism is Homebrew-only, which the README states directly, so a binary installed by hand from a tarball does not get the same in-place upgrade and you would repeat the download, extract and move steps. `ocr --help` is documented as showing usage plus where macOCR lives and how to update it, which is the practical way to check which install you have. On licensing, the repository metadata available here does not state a licence, and the README's contents list includes a License section that is not present in the text available. Treat the licence as unverified and read the LICENSE file in the repository before shipping the binary inside anything you distribute. That is a fact about the material, not legal advice.

Editorial conclusion

Adopt macOCR if you work on macOS and regularly need text out of screenshots, video stills or unselectable PDFs, and you are comfortable granting Screen Recording permission to Terminal or to whichever launcher calls it. Do not adopt it if you need Windows or Linux, or if you want a notarised binary with no quarantine step. Before relying on it, run ocr --list-languages on the exact Mac you intend to use, because the recognisable set is decided by the installed macOS version rather than by macOCR.

Frequently asked questions

How do I install macOCR on macOS?

The README recommends Homebrew with brew install schappim/ocr/ocr, because ocr --update can then upgrade you in place. Release tarballs for Apple Silicon and Intel are also published, but a downloaded binary is ad-hoc signed rather than notarised, so you may need to clear the quarantine attribute with xattr -d com.apple.quarantine /usr/local/bin/ocr.

Why does macOCR ask for Screen Recording permission on first run?

macOCR takes a screenshot of the region you select, so the first run prompts for Screen Recording permission. Grant it, then run ocr again. If you call it from Alfred, Raycast or Shortcuts, the README says the permission prompt belongs to that app rather than to Terminal, and you need to approve it there too.

Can macOCR read a PDF or an image file instead of the screen?

Yes. ocr -i statement.pdf reads a PDF page by page, and ocr -i ~/Desktop/receipt.png reads an image file without any screen capture. The --pages flag restricts which PDF pages are processed and --dpi sets the resolution pages are drawn at, with a documented default of 200.

Which languages can macOCR recognise?

It depends on your macOS version, which is why ocr --list-languages asks the system rather than printing a fixed list. The README states that macOS 13 and later recognise around thirty languages, while macOS 11 and 12 recognise eight: English, French, Italian, German, Spanish, Portuguese, and Simplified and Traditional Chinese. The -l flag needs macOS 11 or later.

Official sources

  1. Issues
  2. README
  3. Releases
  4. schappim/macOCR on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/schappim-macocr.svg)](https://hysenlabs.com/projects/schappim-macocr)