One API, any language

Image to Text API: Extract Text and Data from Any Image

POST a photo, scan or screenshot to DocuOCR and get the words back as structured JSON: the recognized text plus named fields, tables and confidence scores. Printed and handwritten, PNG, JPG, TIFF or PDF, all on one REST endpoint.

Call it from Python, JavaScript, Java, C# or PHP: the request and response are identical because the work happens server-side. Try it on your own image below. Last updated July 2026.

  • Printed and handwriting
  • Fields, tables and confidence
  • PNG, JPG, TIFF, WEBP, PDF
  • No SDK, plain REST and JSON
Try it now, no signup

PDF, JPG, PNG, BMP, HEIC, TIFF

Upload a document to extract

Upload an image and see the JSON your code would receive.

SOC 2 Type II
256-bit encryption
US data handling
REST and JSON
3 calls
upload, extract, get JSON
5 languages
Python, JS, Java, C#, PHP
1 endpoint
photos, scans and PDFs
JSON
fields, tables, confidence
// The short answer

How an image to text API works

An image to text API turns the pixels of a photo, scan or screenshot into machine-readable text. You send the image to an HTTPS endpoint with your API key, the service runs optical character recognition on the page, and it returns the recognized words as JSON. Raw OCR APIs like Google Cloud Vision give you the text and the coordinates of each block, which is enough to display or search. A document extraction API like DocuOCR goes a step further: it reads the same image, then labels the values, so an invoice comes back as an invoice number, a date and totals, and a table comes back as rows and columns with a confidence score on each value. Because it is plain REST, you call it the same way from any language, and the work runs on the server, so a phone photo and a high-resolution scan follow the same code path.

The three calls

  • Upload: POST the image, get a file_id.
  • Extract: POST the file_id, get a job hash.
  • Get: poll or webhook for the JSON.
// The options, compared

Image to text APIs, side by side

Every major image to text API reads printed text; they differ on handwriting, on what they return, and on how much you get before you pay. Capabilities verified July 2026 from provider docs.

Image to text API Handwriting What it returns Free to test
DocuOCR Printed + handwriting Named fields, tables and confidence as JSON Yes, free tier
Google Cloud Vision Printed + handwriting Text and bounding boxes, no named fields 1,000 units/mo free
Azure AI Vision (Read) Printed + handwriting, 100+ languages Text, lines and words with positions Free F0 tier
AWS Textract Printed + handwriting Text, forms and tables as blocks 3-month free tier
OCR.space Printed + handwriting (Engine 3) Plain text, 200+ languages Rate-limited free API
Mistral Document AI Printed Markdown plus structured output No standing free tier

The real split is text versus fields. Vision, Azure Read and Textract hand you recognized text and positions, so you write the logic that turns "INV-4021" into an invoice number yourself. A document API returns the labeled field, which is most of the work. See the full OCR API pricing comparison for per-1,000-page rates, or the honest best OCR API roundup for how to choose.

// Call it from your stack

One image to text API, every language

The DocuOCR image to text API is language-agnostic REST, so the same three calls work wherever you build. Here is the raw request, then a copy-and-run walkthrough for each language.

image_to_text.sh
# 1. Upload the image, get a file_id
curl -X POST https://docuocr.com/api/documents/upload \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "[email protected]"

# 2. Start extraction with the file_id -> extraction_hash
curl -X POST https://docuocr.com/api/documents/extract \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"file_id": "FILE_ID"}'

# 3. Read the structured JSON back
curl https://docuocr.com/api/documents/extraction/HASH \
  -H "Authorization: Bearer YOUR_API_KEY"
// Where teams use it

What developers build on an image to text API

Receipt and expense capture

A mobile app photographs a receipt and the API returns merchant, date and total, so expenses post themselves with no typing.

ID and KYC reads

An onboarding flow reads a driver license or passport photo into fields, checks confidence, and routes anything uncertain to review.

Invoice intake

Scanned or emailed invoices become invoice number, vendor and line items, then flow into QuickBooks, NetSuite or an ERP.

Screenshot to data

Support and ops tools pull numbers and text out of screenshots so a person does not retype what is on the screen.

Table capture

Photos of statements and forms become rows and columns your app can load into a database or spreadsheet.

Handwriting digitization

Handwritten forms, notes and log sheets become searchable text, with low-confidence words flagged for a human.

// Frequently asked

Image to text API FAQ

What is an image to text API?
An image to text API is a web service you call over HTTPS that reads the words in a photo, scan or screenshot and returns them as machine-readable text. You POST an image (PNG, JPG, TIFF or WEBP), the service runs optical character recognition on the pixels, and it responds with the recognized text, usually as JSON. A document-level API like DocuOCR goes further and returns named fields and table rows, not just a wall of text, so your code can use the values directly.
How do I convert an image to text with an API?
You send the image file to the API endpoint with your API key, wait for recognition to finish, and read the text back from the response. With DocuOCR it is three calls: upload the image to get a file_id, start extraction to get a job hash, then GET the structured JSON. The same endpoint accepts a photo, a screenshot or a scanned page, and returns the words plus, for a form or receipt, the labeled fields.
Which image to text API is best for developers?
The best image to text API depends on what you need back. For plain text from any image, Google Cloud Vision, Azure AI Vision and AWS Textract all return recognized text and coordinates. For handwriting, Vision, Azure Read and OCR.space Engine 3 all handle it. For named fields and tables from business documents (invoices, receipts, IDs) without writing your own parsing, a document extraction API like DocuOCR returns structured JSON in one call, which is most of the code you would otherwise maintain.
Can an image to text API read handwriting?
Yes, several can. Google Cloud Vision extracts printed and handwritten text, Azure AI Vision Image Analysis 4.0 Read handles printed and handwritten text in over 100 languages, and OCR.space Engine 3 supports handwriting, tables and 200-plus languages. Accuracy on handwriting is always lower than on printed text and depends heavily on legibility, so for high-stakes values you should keep a confidence threshold and route low-confidence reads to a person.
How much does an image to text API cost?
Most raw OCR runs about $1.50 per 1,000 images at Google Cloud Vision, Azure and AWS Textract, with the first 1,000 units a month free at Vision. Mistral Document AI is $4 per 1,000 pages. Free tiers exist (Vision 1,000 units, OCR.space rate-limited) but are meant for testing, not production volume. Structured extraction that returns named fields costs more; DocuOCR bills per page on a plan, roughly $14 to $20 per 1,000 pages, with fields and tables included.
What formats can an image to text API read?
A good image to text API reads the common raster formats: PNG, JPG or JPEG, TIFF, BMP and WEBP, and most also accept PDF, both native and scanned. A scanned or photographed PDF is treated as an image and run through OCR; a digital PDF with a real text layer can be read directly. DocuOCR accepts all of these on one endpoint and returns the same JSON shape, so your code does not branch on the file type.
Do I need to train a model to use an image to text API?
No. A general image to text API works out of the box on any image with no training. You only reach for training when you need custom fields from an unusual layout, and even then a modern document API infers most fields automatically. DocuOCR reads standard business documents with no setup and lets you define a template only if you have a nonstandard form, so you can be reading images the same day you get an API key.
Can I call an image to text API from Python, JavaScript or C#?
Yes. A REST image to text API is language-agnostic, so you call it from whatever your stack uses: Python with requests, Node.js with fetch, Java or C# with the built-in HttpClient, PHP with cURL or Guzzle. DocuOCR is plain REST with no SDK required, and there is a dedicated code walkthrough for each language. The request and response are identical across languages because the work happens on the server.

Turn images into structured text today

Generate an API key, POST your first image, and read the recognized text plus named fields back as JSON in minutes. No engine to host, no SDK to learn, and a free tier to test before you pay per page.