Plus plan

Math solver

Solve a maths problem from a picture or text, with steps
POST
/v1/ai/ocr/math

About this tool

This tool solves a maths problem that you give as a picture or as typed text. It can show the steps. You choose the level (school, high school or university) and whether maths is written as plain text or LaTeX (a way of writing formulas in text). Simple arithmetic answers are checked by the tool itself. The AI can still make mistakes, so check the answer.
For example, you take a photo of a homework equation and you want to see how to solve it, step by step.

How to use it

  1. Choose this tool.
  2. Add a picture of the problem with Upload, or type the problem in the text box instead.
  3. Choose the level, and turn on Show the steps if you want them.
  4. Choose Plain text or LaTeX, then press Generate.
  5. Read the answer and copy it.

What you get back

You get the solution, with the steps if you asked for them, as text on screen that you can copy.
TEST IT LIVE

Try Math solver in the Studio

One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Open in the Studio
Family
AI
Plan
Plus
Method
POST
Endpoint
/v1/ai/ocr/math
Tool ID
ai.ocr.math
Authentication
API key
Accepts
Text and settings
Background jobs
Yes
Usage group
Ai
For developers

Use it from your code

cURL

curl -X POST "https://app.h2i.davixlabs.io/v1/ai/ocr/math" \
  -H "X-Api-Key: $DAVIX_H2I_API_KEY" \
  -F 'on_unsupported=error' \
  -F 'quality=standard' \
  -F 'level=school'

Node.js

const { DavixH2I } = require('@davixlabs/h2i-sdk');

const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.ai.ocr.math({
    "on_unsupported": "error",
    "quality": "standard",
    "level": "school"
  });
console.log(result.data, result.requestId);

PHP

<?php
require 'vendor/autoload.php';

$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->ai()->ocr()->math([
    'on_unsupported' => 'error',
    'quality' => 'standard',
    'level' => 'school',
]);
echo $result->requestId;
FAQ

Frequently asked questions

Solve a maths problem from a picture or text with the steps shown; code checks plain arithmetic answers itself. Readiness: unbenchmarked (see GET /v1/ai/capabilities/ocr.math).

Classification: ai. Deterministic stages: file type detection from content, native PDF text extraction / OCR for documents, image normalisation (Sharp).

Math solver works from text and settings, so no file is needed. Every input is optional.

Not on the Free plan: Math solver is available on the Plus plan and above. Free accounts can upgrade any time to use it. Each run uses credits from your monthly allowance.

Send a POST request to /v1/ai/ocr/math with your API key in the X-Api-Key header. Official SDKs for Node.js, Python, PHP, Go, Java, .NET and Ruby do the same for you, and the code box on this page shows ready-to-copy examples. For large work it can also run as a background job, so your request returns straight away.