Excel to JSON and Mock API Generator
Open a workbook, use header paths like address.city and tags[] for nesting, then download JSON, a db.json for json-server, JSON Schema or TypeScript, and try REST queries.
Funziona nel tuo browser. I tuoi file non lasciano mai il dispositivo. Scopri come verificarlo
…
Come si usa
- 1Open data
An XLSX workbook or CSV files.
- 2Name columns
Use dotted and [] headers for nesting and arrays.
- 3Set options
Types, empty cells, array separator and ID column.
- 4Choose output
JSON, db.json, JSON Schema or TypeScript.
- 5Test
Try GET requests in the mock API tab.
Informazioni su questo strumento
Front-end developers and testers often need realistic API data before the back end exists, and the people who know the data best keep it in spreadsheets. This tool turns those sheets into mock API data. Open an XLSX workbook, where every sheet becomes a resource, or add CSV files. Values are converted to proper JSON types: integers and decimals become numbers, TRUE and FALSE become booleans, cells containing JSON stay JSON, and values with leading zeros, such as postcodes and phone numbers, stay text. Header names describe the shape: a column called address.city creates a nested address object, tags[] splits a cell such as "home; office" into an array, and items[0].name builds arrays of objects. Empty cells can become null, be left out, or stay as empty strings. The output tabs give the JSON for the current sheet, a db.json file containing every sheet ready for the open-source json-server package, a JSON Schema (draft 2020-12) inferred from the data with types, nullable fields and required properties, and TypeScript type definitions. A mock API tab lists the REST endpoints json-server will expose and lets you try GET requests with paging, filtering, full-text search and sorting right in the page, so front-end code written against it works unchanged when you run the real mock server.
Who it is for
Front-end developers, QA engineers, product managers sharing sample data, and teachers of web development.
Header conventions
| Header | Result | |---|---| | `name` | `"name": "Desk lamp"` | | `price` | `"price": 39.9` (number) | | `address.city` | `"address": { "city": "Paris" }` | | `tags[]` | `"tags": ["home", "lighting"]` | | `items[0].sku` | `"items": [{ "sku": "A1" }]` |
Outputs
- **JSON**: an array of records for the selected sheet. - **db.json**: one key per sheet, for `npx json-server db.json`. - **JSON Schema**: types, nullable fields and required properties, useful for validation and documentation. - **TypeScript**: an exported type for the records.
Query tester
Try `/products?_sort=price&_order=desc`, `/products/2`, `/products?_page=1&_limit=2` or `/products?q=lamp`. Responses follow json-server conventions, including the X-Total-Count value for paging.
Tips
Keep IDs unique and in their own column. Use ISO dates (2026-10-01T09:30:00Z) so JavaScript can parse them. Do not put real customer data in mock files that will be shared or committed.
Worked example
A products sheet with price, in_stock, tags[] and dimensions.width_cm becomes nested JSON with numbers, booleans and arrays; the orders sheet becomes a second resource in db.json; the schema marks price as number and tags as an array of strings.
From mock to real API
When the real back end is ready, compare its responses with the JSON Schema generated here: field names, types and nullable fields should match, so the front end keeps working. Keep the db.json in your repository as test fixtures for automated tests.
Privacy
Conversion runs in your browser; nothing is uploaded.
Esempio svolto
products sheet → nested JSON, db.json with products and orders, JSON Schema and TypeScript.
In breve
- Categoria: Sviluppo e dati
- Funziona nel browser, senza registrazione né caricamento.
- Le informazioni che inserisci restano sul tuo dispositivo.
- Disponibile in inglese.
- Contenuto rivisto l'ultima volta il:
- Fonte ufficiale: JSON Schema 2020-12 and json-server REST conventions
Domande frequenti
How do I convert Excel to JSON?
Open the workbook here; each sheet becomes an array of JSON objects.
Can I create nested JSON from columns?
Yes, use dotted headers like address.city and [] for arrays.
What is db.json?
The data file used by the open-source json-server mock REST API.
Can it generate a JSON Schema?
Yes, draft 2020-12, inferred from the data.
Are leading zeros kept?
Yes, values like 01234 stay text.
Is my data uploaded?
No, everything runs in your browser.
