DEV Community

IronSoftware
IronSoftware

Posted on

OCR on Windows 11: Built-In Tools and a .NET Library

A few years back, if you wanted the text out of a screenshot, you typed it back in by hand. Today, my Windows 11 machine can pull text off the screen with a keyboard shortcut, and most people I talk to have no idea it can do that. I have spent a good while across QA, .NET development, and now developer relations watching teams reach for a heavyweight OCR setup when a built-in tool would have done the job in two seconds, and, just as often, reach for a keyboard shortcut when what they actually needed was code running on a server at 3 a.m. with nobody at the keyboard.

Full transparency: I work at Iron Software as a Developer Advocate, and I build with IronOCR, so I am biased toward our tools. I will keep this focused on working code and call out the real trade-offs, including the places where the free, built-in Windows tools are genuinely the better choice and you should not pay for anything. That happens more than you might expect.

Here is the way I think about it. There are two completely different OCR problems hiding under one name. One is "I can see some text on my screen and I want it on my clipboard." The other is "my software needs to read text out of files, unattended, possibly on Linux, possibly thousands of them." Windows 11 has gotten genuinely good at the first one. The second one is where you write code. Let me walk through both.

The Snipping Tool already does OCR

This is the one I show people first because it is free, it is already installed, and it reuses a shortcut a lot of folks already have in muscle memory.

Press Win + Shift + S to open the capture overlay, draw a box around the text you want, and the snip opens in the Snipping Tool window. Click the Text Actions button on the toolbar. Every recognized word lights up, and you can drag to select part of it or hit Copy all text to grab the whole block. There is also a Quick Redact option that masks detected email addresses and phone numbers before you copy, which I use constantly when I am about to paste a screenshot into a public ticket or a chat channel.

What I like about it: recognition runs on the device, so the text never leaves your machine, and it handles clean printed text in a single language well. What it deliberately does not do is expose any image preprocessing, language tuning, or batch input, and that is fine, because it is a manual capture tool, not a pipeline. For grabbing a confirmation number off a receipt or a paragraph out of a PDF preview, I genuinely have not found anything faster.

PowerToys Text Extractor, for when you do not want a screenshot at all

Microsoft PowerToys is a free utility suite, and its Text Extractor module is the one I keep enabled on every machine I set up. It predates the Snipping Tool's OCR, and it is still my reflex because of how direct it is: there is no screenshot to manage afterward.

Install PowerToys from the Microsoft Store or GitHub, then enable Text Extractor in the PowerToys settings. The default shortcut is Win + Shift + T. Press it, the screen dims with a crosshair, you drag a rectangle over any text, and the characters land straight on your clipboard. No window, no button to click afterward.

The part that has saved me more than once: it reads text that you cannot normally select. Text baked into a video frame. The label on a disabled button. An error dialog that blocks copy. I have pulled stack traces out of modal error boxes that would not let me select a single character otherwise.

You can change the activation shortcut and pick the OCR language pack in settings, which matters if you read non-English text often. Like the Snipping Tool, it is built for a person at the keyboard. There is no command-line entry point and no way to point it at a folder, so it is a power-user convenience, not an automation tool. That distinction is the whole article, really.

OneNote and Photos read text out of files you already have

The two tools above grab text off the live screen. Sometimes the source is a file sitting on disk instead, and Windows handles that too.

In OneNote, paste or insert an image into a page, right-click it, and choose Copy Text from Picture. OneNote runs OCR and drops the result on your clipboard. I use this for the occasional scanned page I dropped into my notes, and it works well for one document at a time. The Photos app and the Snipping Tool's file mode can do the same when you open an existing image and invoke Text Actions on it.

These are convenient because they meet the image where it already lives. The catch is the recurring theme: every extraction is a manual, one-image-at-a-time action with no way to script it. If you have three images, this is perfect. If you have three thousand, you need code, and that is where the rest of this article lives.

Windows.Media.Ocr: the engine Windows hands to developers

Here is the thing most developers miss. The same on-device engine those built-in tools use is available to you in code, through the Windows.Media.Ocr API in the Windows Runtime. No NuGet package, no third-party anything; it ships with Windows. If you are building a Windows-only desktop app and you want zero external dependencies, this is a reasonable place to start.

using Windows.Globalization;
using Windows.Graphics.Imaging;
using Windows.Media.Ocr;
using Windows.Storage;
using Windows.Storage.Streams;

// Create an OCR engine for the user's language (English here).
OcrEngine engine = OcrEngine.TryCreateFromLanguage(new Language("en"));

// Load an image file into a SoftwareBitmap that the engine can read.
StorageFile file = await StorageFile.GetFileFromPathAsync(@"C:\scans\invoice.png");
using IRandomAccessStream stream = await file.OpenAsync(FileAccessMode.Read);
BitmapDecoder decoder = await BitmapDecoder.CreateAsync(stream);
SoftwareBitmap bitmap = await decoder.GetSoftwareBitmapAsync();

// Run recognition and print the full text.
OcrResult result = await engine.RecognizeAsync(bitmap);
Console.WriteLine(result.Text);
Enter fullscreen mode Exit fullscreen mode

That runs with nothing installed beyond Windows itself, which is a real advantage. The trade-off is sitting right in the namespace. Windows.Media.Ocr only runs on Windows, so the moment your code touches a Linux container it is gone. The language packs you get depend on what the host machine happens to have installed, which makes deployment unpredictable. And there is no image filtering in the box, so a low-contrast or skewed scan comes back with mistakes you have to handle yourself. If your app ships only to Windows desktops and the inputs are clean, that may be a fair deal. The further you drift from that, the more it costs you.

When OCR becomes part of your software, reach for a library

Once OCR has to run server-side, inside Docker, on Linux or macOS, or across a large batch of files, the manual tools and the WinRT engine both run out of road. This is the category IronOCR is built for: a .NET library on a tuned Tesseract 5 engine, aimed at programmatic scenarios, not at replacing a quick screen grab. I will be clear about that boundary, because installing a library to copy a phone number off your screen would be silly.

The three things you get over the WinRT engine are portability, bundled language data, and image correction. IronOCR runs on .NET across Windows, Linux, and macOS; it ships with 125+ languages so you are not at the mercy of what the host has installed; and it includes image filters that deskew, denoise, and binarize a scan before recognition.

using IronOcr;

// Set your license key once at startup (a free trial key works here).
IronOcr.License.LicenseKey = "YOUR-LICENSE-KEY";

var ocr = new IronTesseract();

using var input = new OcrInput();
input.LoadImage(@"C:\scans\invoice.png");

// Clean up a noisy or skewed scan before reading.
input.DeNoise();
input.Deskew();

OcrResult result = ocr.Read(input);
Console.WriteLine(result.Text);
Console.WriteLine($"Confidence: {result.Confidence}");
Enter fullscreen mode Exit fullscreen mode

The OcrInput object is where the batch and quality work happens. You can load many images or whole PDFs, apply filters per page, and read them in one pass. The OcrResult carries more than plain text: there is a confidence score I lean on to flag low-quality pages for human review instead of silently trusting bad output, plus structured access to lines and words. For unattended jobs that grind through documents on a schedule, asynchronous reading keeps throughput up.

Installation is one package:

dotnet add package IronOcr
Enter fullscreen mode Exit fullscreen mode

That confidence score is the feature I would not give up. In a real pipeline you do not want OCR quietly returning garbage that flows downstream into a database. You want a number you can threshold on, so anything below, say, 80% gets routed to a person. The built-in tools do not give you that, because for a manual grab you are the confidence check. You are looking right at the result.

So which one do you actually use?

There is no single best OCR tool on Windows 11. There is a best tool for each kind of job, and the honest answer crosses vendor lines.

For pulling text off your screen right now, the built-in options win on speed and cost, full stop. The Snipping Tool's Text Actions and PowerToys Text Extractor cost nothing, run on-device, and need no code. Reach for those first for any manual, one-off extraction. I do, every day, and I work at an OCR company.

The moment OCR moves into your own software, a server, or a stack of files, those manual tools stop being an option at all. A Windows-only desktop app with clean inputs can use Windows.Media.Ocr and ship zero dependencies. For anything that has to run cross-platform, process many files unattended, clean up poor scans, or report a confidence score you can act on, a library is the layer to build on.

If your project lands in that programmatic category, you can start a free IronOCR trial and run it against your own documents before you commit to anything. The tutorials cover reading scanned documents and the other formats you will hit in practice. Match the tool to the job, and most days the right tool turns out to be free.

Top comments (0)