Detect and extract text from images

Optical Character Recognition (OCR)

The Cloud Vision API lets you use optical character recognition (OCR) capabilities for text detection from images. This means you can use Cloud Vision for computer vision tasks like image analysis and dense document text detection, including handwriting extraction.

Cloud Vision API provides two annotation features that support optical character recognition (OCR):

  • TEXT_DETECTION detects and extracts text from any image. For example, a photograph might contain a street sign or traffic sign. The JSON includes the entire extracted string, as well as individual words, and their bounding boxes.

    Road sign displaying text.

  • DOCUMENT_TEXT_DETECTION also extracts text from an image, but the response is optimized for dense text and documents. The JSON includes page, block, paragraph, word, and break information.

    Document with highlighted text.

    Learn more about DOCUMENT_TEXT_DETECTION for handwriting extraction and text extraction from files (PDF or TIFF).

Try it for yourself

If you're new to Google Cloud, create an account to evaluate how Cloud Vision performs in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.

Try Cloud Vision free

Text detection requests

Set up your Google Cloud project and authentication