---
title: "MICR SDK: Bank check OCR and data extraction in C# | Nutrient .NET SDK"
canonical_url: "https://www.nutrient.io/guides/dotnet/extraction/micr/"
md_url: "https://www.nutrient.io/guides/dotnet/extraction/micr.md"
last_updated: "2026-05-21T17:12:02.203Z"
description: "Learn how to check optical character recognition (OCR) and magnetic ink character recognition (MICR) data extraction using C# with Nutrient .NET SDK. Verify and validate text and magnetic ink character recognition results programmatically."
---

# Check OCR and MICR data extraction using C#

This guide explains how to extract magnetic ink character recognition (MICR) information from documents. The MICR code is usually the last line in a bank check. The code is printed in magnetic ink for automatic reading and security reasons, and it can be read by devices using optical character recognition (OCR). Nutrient.NET SDK’s (formerly GdPicture.NET) OCR engine enables you to recognize the MICR information in bank checks. Both commonly used fonts — E-13B and CMC-7 — are supported. The engine automatically recognizes the MICR code, and you don’t need to specify the region of interest in the document.

## Extracting MICR information

To extract MICR information from a document, follow the steps below:

1. Create a `GdPictureImaging` object and a `GdPictureOCR` object.

2. Select the image by passing its path to the `CreateGdPictureImageFromFile` method of the `GdPictureImaging` object.

3. Set the image with the `SetImage` method of the `GdPictureOCR` object.

4. Determine the font used in the MICR area of the document, and do one of the following:
   - If the MICR uses the E-13B font, run the OCR process by passing `OCRSpecialContext.MICRLineE13B` to the `RunOCR` method of the `GdPictureOCR` object.
   - If the MICR uses the CMC-7 font, run the OCR process by passing `OCRSpecialContext.MICRLineCMC7` to the `RunOCR` method of the `GdPictureOCR` object.

5. Get the result of the OCR process as text with the `GetOCRResultText` method of the `GdPictureOCR` object.

6. Write the output to the console.

7. Release unnecessary resources.

The example below extracts MICR information from a document that uses the E-13B font:

### C#

```csharp

using GdPictureImaging gdpictureImaging = new GdPictureImaging();
using GdPictureOCR gdpictureOCR = new GdPictureOCR();
// Select the image to process.
int imageId = gdpictureImaging.CreateGdPictureImageFromFile(@"C:\temp\source.png");
// Set the image.
gdpictureOCR.SetImage(imageId);
// Run the OCR process.
string resultId = gdpictureOCR.RunOCR(OCRSpecialContext.MICRLineE13B);
// Get the result of the OCR process as text.
string micrData = gdpictureOCR.GetOCRResultText(resultId);
// Write the output to the console.
Console.WriteLine($"MICR information: {micrData}");
// Release unnecessary resources.
gdpictureImaging.ReleaseGdPictureImage(imageId);
gdpictureOCR.ReleaseOCRResults();

```

### VB.NET

```vb

Using gdpictureImaging As GdPictureImaging = New GdPictureImaging()
Using gdpictureOCR As GdPictureOCR = New GdPictureOCR()
    ' Select the image to process.
    Dim imageId As Integer = gdpictureImaging.CreateGdPictureImageFromFile("C:\temp\source.png")
    ' Set the image.
    gdpictureOCR.SetImage(imageId)
    ' Run the OCR process.
    Dim resultId As String = gdpictureOCR.RunOCR(OCRSpecialContext.MICRLineE13B)
    ' Get the result of the OCR process as text.
    Dim micrData As String = gdpictureOCR.GetOCRResultText(resultId)
    ' Write the output to the console.
    Console.WriteLine($"MICR information: {micrData}")
    ' Release unnecessary resources.
    gdpictureImaging.ReleaseGdPictureImage(imageId)
    gdpictureOCR.ReleaseOCRResults()
End Using
End Using

```

#### Used methods and properties

- [`AddLanguage`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPictureOCR~AddLanguage.html)

- [`CreateGdPictureImageFromFile`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPictureImaging~CreateGdPictureImageFromFile.html)

- [`GetOCRResultText`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPictureOCR~GetOCRResultText.html)

- [`ReleaseGdPictureImage`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPictureImaging~ReleaseGdPictureImage.html)

- [`ReleaseOCRResults`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPictureOCR~ReleaseOCRResults.html)

- [`ResourceFolder`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPictureOCR~ResourceFolder.html)

- [`RunOCR`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPictureOCR~RunOCR\(\).html)

- [`SetImage`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPictureOCR~SetImage\(\).html)

#### Related topics

- [Load a file](/guides/dotnet/load-a-file.md)

- [Save a file](/guides/dotnet/save-a-file.md)

---

## Related pages

- [Extract data from bank statements using C#](/guides/dotnet/extraction/bank-statements.md)
- [Extract file attachments from PDFs in C#](/guides/dotnet/extraction/file-attachments.md)
- [Extract images from PDFs in C#](/guides/dotnet/extraction/images.md)
- [Effortlessly extract data from PDFs and images](/guides/dotnet/extraction.md)
- [Extract invoice data with C# and OCR](/guides/dotnet/extraction/invoices.md)
- [Extract tables from PDFs and images using C#](/guides/dotnet/extraction/tables.md)

