How to Convert Excel Data to JSON for REST API Testing
Table of Contents
API developers and testers often maintain test data in Excel spreadsheets — it is easy to edit, share, and hand off to non-technical team members. Converting that data to JSON for Postman collections, database seeds, or API request payloads used to require a script. A browser-based converter makes it a 30-second task.
Why API Teams Keep Test Data in Excel
Excel spreadsheets are a common format for test data in API development because:
- Business stakeholders and QA teams can edit data without code access
- Shared workbooks let multiple people contribute test cases
- Filters and pivot tables make it easy to review large datasets
- Client deliverables often arrive as Excel files
The challenge is getting that Excel data into JSON format for use in API tools. A browser-based converter bridges the gap: upload the Excel file, get a JSON array, copy it into your tool of choice.
Using Excel-to-JSON Output as Postman Mock Data
Postman allows you to use JSON data for data-driven tests via its Collection Runner. Convert your Excel test data to JSON and feed it directly into Postman:
- Convert your Excel file to JSON using the browser tool
- Download the JSON file
- In Postman, open Collection Runner
- Select your collection and click "Select File" under Data
- Upload the JSON file
- Postman iterates through each row of your Excel data as a separate test run
Note: Postman Collection Runner also accepts CSV format. If your data is simple (no nested structures), downloading as CSV from the Excel Viewer may be slightly faster than converting to JSON first.
Sell Custom Apparel — We Handle Printing & Free ShippingUsing Excel JSON as Database Seed Data
Database seed scripts typically require JSON arrays where each object maps to one row. The output from the Excel-to-JSON converter is exactly this format.
For Node.js / Mongoose (MongoDB):
const data = require("./seed-data.json");
await Model.insertMany(data);
For Prisma (PostgreSQL/MySQL):
const data = require("./seed-data.json");
for (const row of data) {
await prisma.tableName.create({ data: row });
}
The main cleanup needed: ensure column headers in your Excel file match your database field names exactly. A few minutes of header cleanup in Excel saves time on post-conversion renaming.
Cleaning the JSON to Match Your API Schema
The raw converter output is a flat array of objects. API schemas often require specific formats that need minor adjustments:
- Rename keys: Match your API field names using find-and-replace in a text editor or a short JavaScript map
- Remove extra fields: Filter out columns you do not need:
data.map(({ FieldToRemove, ...rest }) => rest) - Add required fields: If your API requires fields not in Excel (like
createdAt), add them in a post-processing step - Wrap in an object: Some APIs expect
{ "data": [...] }rather than a bare array — add this wrapper after converting
Formatted vs Minified JSON — Which to Use for APIs
The converter offers a toggle between formatted (indented) and minified JSON output.
Use formatted JSON when: reviewing the output manually, committing to a git repo, using as Postman test data, or feeding to a seed script.
Use minified JSON when: embedding in a request payload, reducing file size for large datasets, or passing directly to a CLI tool.
APIs themselves do not care about whitespace — both formatted and minified JSON are parsed identically by any server. The choice is purely about readability and file size.
Try It Free — No Signup Required
Runs 100% in your browser. No data is collected, stored, or sent anywhere.
Open Free Excel to JSON ConverterFrequently Asked Questions
Can I use Excel-to-JSON output directly in Postman?
Yes. Postman Collection Runner accepts JSON files as data sources for data-driven tests. Convert your Excel file to JSON with the browser tool, download the file, and upload it in the Collection Runner under the Data option.
How do I convert Excel test data to JSON for database seeding?
Upload your Excel file to the browser converter, select the sheet with your test data, and click Download JSON. The output is a JSON array of objects matching your row data. Use it directly in Node.js seed scripts with insertMany or Prisma create calls.
Does the converter handle nested JSON for API payloads?
No. The browser converter produces flat JSON arrays — one object per row, one key per column. For nested API payloads, convert to flat JSON first, then restructure the output in code or a JSON transformation tool.
What is the best format for Excel column headers when converting for API use?
Use camelCase (firstName, emailAddress) or snake_case (first_name, email_address) to match your API field names. Avoid spaces and special characters in headers — they create JSON keys that require bracket notation in JavaScript.

