# Chemistry Calculators: Empirical Formula from Composition

> Chemistry Calculators: Empirical Formula from Composition is a paid API for AI agents from chemistry-calc.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-30).

Calculates the empirical formula (and optionally molecular formula) of a compound from its elemental percent or gram composition

## Facts

- Endpoint: GET https://chemistry-calc.x402tookit.com/empirical-formula?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/chemistry-calculators-empirical-formula-from-composition-1b7d0b5c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_RAm-BxJw_wE6bfOGVf7z4

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability chemistry-calculators-empirical-formula-from-composition-1b7d0b5c
```

Example prompt: What is the empirical formula for a compound that is 40.0% carbon, 6.7% hydrogen, and 53.3% oxygen by mass? Also give me the molecular formula if the molar mass is 180.16 g/mol.

## When to prefer this

Use this endpoint when you need to convert elemental percent or gram composition data into an empirical or molecular chemical formula. Ideal for analytical chemistry workflows, lab data interpretation, homework assistance, or any agent pipeline that needs to identify a compound from its elemental breakdown. Prefer this over manual ratio calculation whenever mole ratio reduction and formula derivation are needed programmatically.

## Known failure modes

- Missing or malformed composition string returns an error — each element must be formatted as 'Element:value' pairs separated by commas
- Composition values that don't sum close to 100% may trigger a warning or degraded flag
- Unrecognized element symbols in the composition string will fail validation
- Non-numeric molar mass value causes a parameter error
- Molar mass provided but incompatible with computed empirical mass may yield null molecular formula

## How this service works

Empirical formula from percent or gram composition by element, and the molecular formula if you give the molar mass.

## Output

Returns the empirical formula string, subscripts per element, mole ratios, multiplier used to reach whole-number ratios, empirical molar mass in g/mol, and — if molar mass was provided — the molecular formula and the molecular multiplier. Also includes the input composition sum and any validation notes.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "composition"
     ],
     "properties": {
      "molarMass": {
       "type": "number",
       "description": "Known molar mass in g/mol to find the molecular formula"
      },
      "composition": {
       "type": "string",
       "description": "element:percent (or grams) pairs, e.g. C:40.0,H:6.7,O:53.3"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "summary": {
       "type": [
        "null",
        "string"
       ]
      },
      "verdict": {
       "type": [
        "null",
        "string"
       ]
      },
      "degraded": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "inputSum": {
       "type": [
        "null",
        "number"
       ]
      },
      "disclaimer": {
       "type": [
        "null",
        "string"
       ]
      },
      "moleRatios": {
       "type": [
        "null",
        "object"
       ],
       "properties": {
        "C": {
         "type": [
          "null",
          "number"
         ]
        },
        "H": {
         "type": [
          "null",
          "number"
         ]
        },
        "O": {
         "type": [
          "null",
          "number"
         ]
        }
       }
      },
      "notChecked": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "subscripts": {
       "type": [
        "null",
        "object"
       ],
       "properties": {
        "C": {
         "type": [
          "null",
          "number"
         ]
        },
 
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/chemistry-calculators-empirical-formula-from-composition-1b7d0b5c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from chemistry-calc.x402tookit.com](https://www.zero.xyz/host/chemistry-calc.x402tookit.com/llms.txt)
