--- title: "Optical Character Recognition" url: https://docs.catalyst.zoho.com/en/sdk/javascript/v1/zia-services/ocr/ description: "This page describes the method to perform operations using the components in Zia Services." last_updated: 2026-09-09T10:45:38Z service: Zia Services type: general related_links: - name: "Catalyst Zia Services" url: /en/zia-services/ - name: "Java SDK Documentation" url: /en/sdk/java/v1/zia-services/ocr/ - name: "Python SDK Documentation" url: /en/sdk/python/v1/zia-services/ocr/ - name: "REST API Documentation" url: /en/api/code-reference/zia-services/ocr/#OCR repository: name: "Repository" url: https://github.com/catalystbyzoho/zcatalyst-sdk-js --- # Optical Character Recognition > **Note:** Ensure you have installed the [required package](https://docs.catalyst.zoho.com/en/sdk/javascript/v1/zia-services/overview/#prerequisites) to use this SDK method. [Zia Optical Character Recognition](https://docs.catalyst.zoho.com/en/zia-services/help/optical-character-recognition/introduction) detects textual characters in images or digital documents, and converts them into machine-encoded text. Zia OCR can recognize text in 9 international languages and 10 Indian languages. > **Notes:** * [View the list of languages and language codes](https://docs.catalyst.zoho.com/en/api/code-reference/zia-services/ocr/#OCR). * Catalyst does not store any of the files you upload in its systems. The files you upload are used for one-time processing only. They are not used for ML model training purposes either. Catalyst components are fully compliant with all applicable data protection and privacy laws. You must specify the path to the image or document file that needs to be processed for OCR. The response will also include a confidence score, which defines the accuracy of the processing, in addition to the recognized text. **Allowed file formats**: .jpg, .jpeg, .png, .tiff, .bmp, .pdf **File size limit**: 20 MB You must pass the file path, model type, and languages as arguments to the `extractOpticalCharacters()` method. However, the model type and language values are optional. By default, it is passed as the `OCR` model type, and the languages are automatically detected if they are not specified. The `zia` reference used in the code snippets below is the [component instance](https://docs.catalyst.zoho.com/en/sdk/javascript/v1/zia-services/get-zia-instance/) created to perform these operations. The promise returned here is resolved to a JSON object. ```javascript const fs = require('fs'); // Define the file stream for file attachments const result = await zia.extractOpticalCharacters( fs.createReadStream('/Users/amelia-421/Desktop/MyDoc.webp'), { language: 'eng', modelType: 'OCR' } ); console.log(result); ``` #### Example of Expected Response A sample response that you will receive is shown below. ```json { "confidence": 95, "text": "This is a lot of 12 point text to test the\nocr code and see if it works on all types\nof file format\n\nThe quick brown fox jumped over the\nlazy dog. The quick brown fox jumped\nover the lazy dog. The quick brown fox\njumped over the lazy dog. The quick\nbrown fox jumped over the lazy dog" } ```