Extract structured data as valid JSON

Pulls fields out of messy text into JSON that matches your schema exactly, with null for anything that is not there.

Prompt, 2 blanks to fill
Extract data from the text below into JSON that matches this schema exactly:

```json
{{SCHEMA}}
```

Rules:
- Output only the JSON object. No explanation, no markdown fence.
- Use null when a field is not present. Never guess.
- Dates in ISO format (YYYY-MM-DD). Numbers without currency symbols or thousands separators.
- Keep text values exactly as written in the source, except trimming whitespace.

<text>
{{TEXT}}
</text>

Example output

{ "company": "Northwind Ltd", "invoice_number": "INV-2041", "total": 1840.5, "due_date": "2026-12-01", "po_number": null }

How to use

Write SCHEMA as an example JSON object with the field names and types you want. In an API, use the provider’s structured output or tool-use feature with the same schema for guaranteed valid JSON, and validate the result in code either way.

Why it works

Clear rules for missing values and formats remove the guesswork that causes invalid or inconsistent JSON. In APIs you can go further by prefilling the reply with an opening brace or using a stop sequence, so the model only returns the object.

Find a prompt for the task in front of you.

96 prompts in 8 categories. Copy one, fill in the blanks, paste it into any model.

Browse prompts

Promptlexity is a free library of 96 AI prompts and 8 downloadable AI skills across 8 categories, plus a glossary of 64 AI and prompting terms. Each prompt shows the exact text to paste, the variables to fill in, an example of what comes back, and why it works. Each glossary term has a plain-English definition, an example and a common mistake. 6 step-by-step guides cover the basics. No signup, works with ChatGPT, Claude, Gemini and other models.

Press Esc to close