Why Choose Aspose.OCR library for Java?

Discover the seamless world of Aspose.OCR for Java – a potent, easy-to-use, and cost-effective OCR API. With less than 5 lines of Java code, add OCR functionality to your applications without delving into complex math or neural networks. Our robust OCR engine boasts superior speed and accuracy, supporting 130+ languages, including Latin, Cyrillic, Arabic, Persian, Devanagari, and Chinese scripts. From scanned images and smartphone photos to screenshots and scanned PDFs, retrieve results in popular document and data exchange formats. Benefit from pre-processing filters that handle rotated, skewed, and noisy images. Optimize recognition performance and system load by offloading resource-intensive tasks to the GPU.

Illustration ocr

Swift and Precise OCR

Achieve high-speed and accurate OCR results with our advanced Java technology.

Multilingual Support

Recognize text in more than 130 languages, including Latin, Cyrillic, Arabic, Persian, Indic and Chinese scripts.

Adaptable Image Support

Process images from various sources, such as scanners, cameras, and smartphones.

Chinese Character Mastery

Recognize more than 6,000 Chinese characters with unparalleled precision.

Font Styles and Format Integrity

Preserve font styles and formatting for faithful representation of recognized Java text.

Live code sample

Experience the simplicity: Transform image to text in few lines of Java code!

Ready to recognize Ready to recognize Drop a file here or click to browse *

* By uploading your files or using the service you agree with our Terms of use and Privacy Policy.

Recognition result

Convert image to text

Explore More Examples >
AsposeOCR api = new AsposeOCR();
// Add images to the recognition batch
OcrInput images  = new OcrInput(InputType.SingleImage);
// Recognition language
RecognitionSettings recognitionSettings = new RecognitionSettings();
// Recognize images
ArrayList<RecognitionResult> results = api.Recognize(images, recognitionSettings);
results.forEach((result) -> {

Any platform

Aspose.OCR for Java seamlessly operates on any platform supporting Java SE 6.0 or above – be it a local machine, web server, or the cloud.

Microsoft Windows
Microsoft Azure
Amazon Web Services

Supported file formats

Aspose.OCR for Java can work with virtually any file you can get from a scanner or camera. Recognition results are returned in the most popular file and data exchange formats that can be saved, imported to a database, or analyzed in real time.


  • PDF
  • JPEG
  • PNG
  • TIFF
  • GIF
  • Bitmap

Batch OCR

  • Multi-page PDF
  • ZIP
  • Folder

Recognition results

  • Text
  • PDF
  • Microsoft Word
  • Microsoft Excel
  • HTML
  • RTF
  • ePub
  • JSON
  • XML

Effortless Installation

Aspose.OCR for Java is distributed as a lightweight Java Archive (JAR) file or as a downloadable file with minimal dependencies. Simply install it into your project, and you’re all set to recognize texts in multiple supported languages and save recognition results in various formats.

Request a trial license to kickstart the development of a fully functional OCR application without limitations.

Java, Everywhere

Our library fully supports Java SE 6 or above, enabling your applications to run seamlessly on any platform – desktop Windows, Windows Server, macOS, Linux, and the cloud.

130+ Recognition Languages

Our Java OCR API recognizes numerous languages and popular writing scripts, including mixed languages:

Leave language detection to the library or define the language yourself for enhanced recognition performance and reliability.

  • Extended Latin alphabet: English, Spanish, French, Indonesian, Portuguese, German, Vietnamese, Turkish, Italian, Polish, and 80+ more;
  • Cyrillic alphabet: Russian, Ukrainian, Kazakh, Serbian, Belarusan, Bulgarian;
  • Arabic, Persian, Urdu;
  • Chinese and Devanagari script, including Hindi, Marathi, Bhojpuri, and others.

Empowering Features and Capabilities

Aspose.OCR for Java Explore the advanced features and capabilities of Aspose.OCR for Java.

Feature icon

Photo OCR

Extract text from smartphone photos with scan-level accuracy.

Feature icon

Searchable PDF

Convert any scan into a fully searchable and indexable document.

Feature icon

URL recognition

Recognize an image from URL without downloading it locally.

Feature icon

Bulk recognition

Read all images from multi-page documents, folders and archives.

Feature icon

Any font and style

Identify and recognize text in all popular typefaces and styles.

Feature icon

Fine-tune recognition

Adjust every OCR parameter for best recognition results.

Feature icon

Spell checker

Improve results by automatically correcting misspelled words.

Feature icon

Find text in images

Search for text or regular expression within a set of images.

Feature icon

Compare image texts

Compare texts on two images, regardless of the case and layout.

Feature icon

Web Link Image Recognition

Seamlessly recognize images directly from web links, enhancing OCR integration in your Java projects.

Feature icon

Automatic Misspelled Word Correction

Enhance OCR results by automatically correcting misspelled words, ensuring accuracy in your Java applications.

Feature icon

Full Integration with Aspose Ecosystem

Integrate Aspose.OCR for Java seamlessly with other Aspose products for a comprehensive and efficient Java solution.

Code Samples

Explore the code samples to learn how to seamlessly integrate Aspose.OCR for Java into your applications.


As a Java Archive (JAR) file with minimal dependencies or from Maven repository, Aspose.OCR for Java is easily distributed. Integration into your project, directly from your preferred Java Integrated Development Environment (IDE), is a seamless process. Simply install it, and you’re prepared to leverage the complete range of OCR capabilities, saving recognition results in any of the supported formats.

Post-installation, you can promptly commence using Aspose.OMR for Java, albeit with certain limitations. A temporary license lifts all trial version restrictions for 30 days. Utilize this period to initiate the development of a fully functional OCR application, allowing you to make an informed decision on purchasing Aspose.OCR for Java at a later stage.

Recognize text on scanned images in Java

Overcome the challenge of OCR applications lacking widespread scanners. Our API boasts powerful built-in image pre-processing filters that adeptly handle rotated, skewed, and noisy images. Combined with support for all image formats, it ensures reliable recognition even from smartphone photos. Most pre-processing and image correction are automated, requiring your intervention only in challenging cases.

Apply Automatic Image Corrections - Java

// Create instance of OCR API
AsposeOCR api = new AsposeOCR();

// Define pre-processing filters
PreprocessingFilter filters = new PreprocessingFilter();

// Pre-process image before recognition
BufferedImage imageRes = api.PreprocessImage(imagePath, filters);

// Recognize image
RecognitionResult result = api.RecognizePage(imageRes, set);

Extract text from photos in Java

Integrate text detection and recognition in your Java applications. Access precise results from photos with ease, enhancing your image processing capabilities. Elevate image processing capabilities, obtaining accurate results from photos.

Detect and recognize text on photo - Java

// Add a photo to the recognition batch
OcrInput images  = new OcrInput(InputType.SingleImage);

// Set photo recognition mode
RecognitionSettings recognitionSettings = new RecognitionSettings();

// Extract text from a photo
ArrayList<RecognitionResult> results = api.Recognize(images, recognitionSettings);
results.forEach((result) -> {

Resource Optimization in Java

Optical character recognition demands resources. Our API offers flexible ways to balance the classic time-price-quality triad. It allows you to restrict the number of threads utilized by the recognition engine. While this adjustment may lead to a slower recognition speed, it enables you to allocate resources for concurrent tasks like parallel image processing, web server operations, database management, or background data analysis.

  • Choose between thorough recognition and fast recognition.
  • Specify the number of threads allocated for recognition, or allow the library to automatically scale to the number of processor cores.
  • Free up the CPU by offloading calculations to the GPU.

Balancing resources uasage

RecognitionSettings recognitionSettings = new RecognitionSettings();

Fast Recognition with minimal setup

If you images are high-quality scans without skew or distortion, you can use the fastest recognition mode that consumes minimum possible resources using:

Fast Recognition OCR - Java

AsposeOCR api = new AsposeOCR();

// Add images to the recognition batch
OcrInput images  = new OcrInput(InputType.SingleImage);
images.add(os.path.join(self.dataDir, "source1.png"));
images.add(os.path.join(self.dataDir, "source2.png"));

// Fast recognize images
ArrayList<RecognitionResult> results = api.RecognizeFast(images);
results.forEach((result) -> {