Open Source & MIT Licensed

Stop Parsing.
Start Looting.

Extract valid JSON from LLM outputs, malformed data, and messy text.Indestructible. Self-Repairing. Lightweight.

Try it out

The Looting Ground

Paste any text containing JSON — messy, malformed, or buried in markdown. Watch loot-json extract it flawlessly.

Input
Output
Waiting for JSON to loot...

Why Loot?

Built for the real world where JSON is never perfect. Stop fighting with parsers and start shipping features.

Indestructible

Handles malformed JSON, missing quotes, trailing commas, and more. Your data survives the chaos.

Self-Repairing

Automatically fixes common JSON errors. Missing brackets? Unquoted keys? We've got you covered.

Lightweight

Zero dependencies. Under 5KB minified. Blazing fast extraction that won't bloat your bundle.

LLM-Ready

Specifically designed to extract JSON from LLM outputs — markdown code blocks, mixed text, you name it.

TypeScript First

Full TypeScript support with generics. Get type-safe JSON extraction out of the box.

Developer Friendly

Simple API: just loot(). No configuration needed, works instantly.

example.ts
import { loot } from 'loot-json';

// LLM response with embedded JSON
const llmOutput = `Here's your data: 
{"name": "Alice", "score": 95}
Hope this helps!`;

// Extract the JSON effortlessly
const data = loot(llmOutput);
// → { name: 'Alice', score: 95 }