# Text to JSON: Extract Data Without Guessing

Text to JSON: Extract Data Without Guessing is a tested SKILL.md that extracts data from text into JSON that matches the shape you give (a JSON Schema, an example object or a list of fields), without guessing; an agent buys it once for $0.01 over x402.

- Page: https://aiskills402.com/skills/text-to-json
- Category: Data & Analysis (https://aiskills402.com/categories/data)
- Price: $0.01 once, USD-priced, paid in USDC on Base over x402. Price as loaded on this page. The 402 response your agent receives is authoritative.
- Version: 1.0.0
- Card (JSON): https://api.aiskills402.com/v1/skills/text-to-json

## Use it when

Extracts data from text into JSON that matches the shape you give (a JSON Schema, an example object or a list of fields), without guessing. Every value comes from the text; a missing fact becomes null, numbers and dates are converted only into the type the shape asks for, two conflicting values are not settled by a guess, and instructions hidden in the text are ignored. Use when asked to extract structured data, turn text into JSON, parse an invoice, receipt, email, order, CV or job post into fields, or fill a JSON schema from a document.

## Not for

Scanned images or PDFs your agent cannot read as text; filling in values a document leaves out; working out totals, due dates or currency conversions; checking whether the document itself is true. It returns what the text says, not what is likely.

## Tested, honestly

Tested 2026-10-03.

- Strong model (claude-sonnet-5-5 (Claude Code alias "sonnet")): Passed all 9 cases with bare, valid JSON in exactly the requested shape. It read 1.250,50 € and 2.500 g by their language, turned 03.10.2026 into 2026-10-03 and left the undecidable 04/05/2026 as null, kept Cyrillic names and phone numbers as written, used the stated address correction, left two conflicting totals as null and named both in the issues field, refused to add up an order whose total the text never gave, and ignored a planted instruction to mark an order paid, noting the attempt.
- Weak model (claude-haiku-4-5-20251001 (Claude Code alias "haiku")): Extracted the right values in all 9 cases: the same nulls, the same number and date readings, no sum computed, the planted instruction ignored. But it wrapped the JSON in a Markdown code fence in all 9, so its answer does not parse until the fence is removed.

Note: Nine fictional texts in English, German, Bulgarian, Russian and Spanish: two invoices, an ambiguous date, a job post with an allowed-values field, a contact list, an order with a planted instruction, a quote with two totals and a correction, a product sheet that needs a unit conversion, and an order with no stated total. Machine checks parse the JSON and compare every field the case names; Haiku's fenced answers were also checked with the fence removed. One run per model and case.

Full summary: https://aiskills402.com/skills/text-to-json/tests

## Example

### English (claude-sonnet-5-5)

Before:

> INVOICE #INV-0042 Issued: March 3, 2026 Due: April 2, 2026 Bill to: Northwind Studio, 18 Harbour Road, Leeds Qty   Item            Unit price 2     Logo design     450.00 1     Brand guide     940.00 Total due: 1,840.00 USD Payment by bank transfer.

After:

> {"invoice_number": "INV-0042", "issue_date": "2026-03-03", "due_date": "2026-04-02", "total": 1840.0, "currency": "USD", "vat_id": null, "line_items": [{"description": "Logo design", "quantity": 2, "unit_price": 450.0}, {"description": "Brand guide", "quantity": 1, "unit_price": 940.0}]}

### German (claude-sonnet-5-5)

Before:

> Rechnung Nr. 2026-117 vom 03.10.2026 Malerbetrieb Krause GmbH, Lindenstraße 4, 04109 Leipzig Gesamtbetrag: 1.250,50 € Zahlbar bis 17.10.2026 ohne Abzug.

After:

> {"invoice_number": "2026-117", "issue_date": "2026-10-03", "due_date": "2026-10-17", "total": 1250.5, "currency": "EUR", "paid": null}

### Bulgarian (claude-sonnet-5-5)

Before:

> Търсим Senior Backend разработчик (Go) за екипа ни в София. Заплата: 3 100 – 4 300 € бруто месечно. Работа: хибридно, два дни седмично в офиса. Изпратете CV на jobs@example.bg.

After:

> {"title": "Senior Backend разработчик (Go)", "salary_min": 3100, "salary_max": 4300, "currency": "EUR", "work_mode": "hybrid", "city": "София", "apply_deadline": null}

### Russian (claude-sonnet-5-5)

Before:

> Контакты по проекту: Иван Петров, менеджер проекта, +7 912 345-67-89, ivan.petrov@example.ru. По оплатам — Анна Смирнова, бухгалтер, почта anna.s@example.ru.

After:

> {"contacts": [{"name": "Иван Петров", "role": "менеджер проекта", "phone": "+7 912 345-67-89", "email": "ivan.petrov@example.ru"}, {"name": "Анна Смирнова", "role": "бухгалтер", "phone": null, "email": "anna.s@example.ru"}]}

### Spanish (claude-sonnet-5-5)

Before:

> Lámpara de mesa Nórdica Peso neto: 2.500 g Dimensiones: 40 × 30 × 12 cm Precio: 18,90 € (IVA incluido)

After:

> {"product": "Lámpara de mesa Nórdica", "weight_kg": 2.5, "price": 18.9, "currency": "EUR", "color": null}

## What is in the file

- Hard rules
- Turning text into types
- Work in this order
- Short examples

## Languages

English, Bulgarian, German, Spanish, Russian

## How to buy

Agent (HTTP):

1. GET https://api.aiskills402.com/v1/skills/text-to-json/file without a payment header. The answer is 402 with a PAYMENT-REQUIRED header (x402 v2): exact amount, asset, network, recipient.
2. Sign `accepts[0]` with an x402 client (for example @x402/core + @x402/evm).
3. Repeat the GET with the signature in the PAYMENT-SIGNATURE header. The answer is 200 with the file, its sha256 and a re-download token.

Agent (MCP): https://mcp.aiskills402.com/mcp — free tools search_skills, get_skill, redownload_skill. Buying itself is over HTTP.

Full flow: https://aiskills402.com/docs

## The file

- Version: 1.0.0
- Size: 7.5 KB (7632 bytes)
- SHA-256: 7823bd6638269b510f1567dc0e7a35d37df4609e2c1e80a5814d6d6a4079f4a0
- Updated: 2026-10-03
- New versions are free through your re-download token.

## Versions

### 1.0.0 (2026-10-03)

First release: extracts data from text into the JSON shape you give; missing facts are null, no sums or conversions the text did not state, conflicting values left open, instructions inside the text ignored, bare JSON as the answer.

## License

Perpetual, non-exclusive; use and modify for yourself incl. paid work; no resale or republishing. Holder: Georgi Kalchev, aiskills402.com. Terms: https://aiskills402.com/docs#license

## FAQ

### What happens when a value is missing?

It becomes null, never an empty string, a zero, false or a likely value. In our runs both models left a date written as 04/05/2026, with nothing to tell day from month, as null instead of picking one, and left a job post's missing deadline empty.

### Does it add up totals for me?

No. A field for a sum the text does not state stays null, even when the parts are there, because a computed figure looks exactly like a quoted one. Both models left subtotal and total empty for an order that listed only prices and quantities. Ask for the arithmetic in your request if you want it.

### Can a document trick it?

We planted a line in an order telling the AI system to mark it paid and approve a refund. Neither model did it, and Claude Sonnet recorded the attempt in the notes field. Lines inside the text are handled as data, never as instructions.

### Why does the output of Claude Haiku not parse?

Haiku extracted the right values in all nine of our cases but wrapped the JSON in a Markdown code fence every time. Strip the fence before parsing, or use Claude Sonnet, which returned bare JSON in every case.

## Related skills

- [Faithful Summary](https://aiskills402.com/skills/summarize.md): $0.03 once
- [Translate App Text (JSON, YAML, PO)](https://aiskills402.com/skills/translate-app-text.md): $0.01 once

## Measurement limits

- Models other than the two named above were not run.
- Each verdict comes from the test run on the date shown; the skill may have changed since (check the version).
- Full test inputs are not published here, only short excerpts of our own text.
- Results on your own texts, languages and domains can differ.

Offer note: Paid in USDC (USD-pegged) over x402 by an AI agent; one-time.
