# JSON to TypeScript — generate interfaces, no upload

> Generate TypeScript interfaces from JSON or JSONL samples with recursive inference and unions, copied ready to paste. Runs in your browser, no upload.

Paste JSON or JSONL samples and generate TypeScript interfaces with recursive type inference and unions, ready to copy into your code. The inference runs in your browser, so the data isn't uploaded.

Typing an API response by hand is tedious and error-prone. Pasting a real sample and generating interfaces gets you accurate types in seconds, including nested shapes and unions where values vary across records.

It's the fastest way to make an untyped payload type-safe. To first flatten deeply nested JSON for analysis instead, use JSON flatten; for a broader dev JSON toolkit, see the Dev Desk.

## How to

1. **Paste JSON.** Drop in a JSON or JSONL sample of your data.
2. **Generate.** Types are inferred recursively, including nested objects and unions.
3. **Copy.** Copy the generated TypeScript interfaces into your project.

## FAQ

### How accurate is the inference?

It walks the sample recursively, inferring nested object shapes and combining differing values into unions — a strong starting point you can refine by hand.

### Does it handle arrays and nested objects?

Yes. Nested structures become nested interfaces, and arrays are typed by their element shape.

### Is my JSON uploaded to convert it?

No. Type generation happens in your browser, so the sample data stays on your device.


## Related tools

- [JSON flattener](https://www.safepaper.app/data/json-flatten)
- [JSON toolkit](https://www.safepaper.app/dev/json-toolkit)
- [Format swap](https://www.safepaper.app/data/csv-to-json)
- [SQL query](https://www.safepaper.app/data/sql-query)

---

Canonical HTML: https://www.safepaper.app/data/json-to-typescript
Markdown: https://www.safepaper.app/data/json-to-typescript.md

There is no upload endpoint — your files are processed in this browser tab. Open your network tab and check.
