Blog
Wild & Free Tools

How to Merge Multiple JSON Files Into a Single Excel File

Last updated: February 2026 5 min read
Quick Answer

Table of Contents

  1. Browser Method: Merge Arrays First
  2. Python: Merge Into One Sheet
  3. Python: Separate Sheet Per File
  4. Handling Mismatched Keys
  5. Frequently Asked Questions

The browser converter handles one JSON array at a time — but merging multiple files into one Excel workbook is straightforward with either a manual array join or a short Python script. Here are both approaches depending on your situation.

Merge JSON Arrays in the Browser Before Converting

If you have a small number of files (2-5) with the same structure, the fastest approach is to manually combine them into one array:

  1. Open a text editor (Notepad, VS Code, or the browser console)
  2. Paste your first JSON array, remove the closing ]
  3. Add a comma, then paste the content of the next array (without its opening [)
  4. Close with ]

Example — combining two files:

// file1.json
[{"id":1,"name":"Alice"},{"id":2,"name":"Bob"}]

// file2.json
[{"id":3,"name":"Carol"},{"id":4,"name":"Dave"}]

// Combined
[
  {"id":1,"name":"Alice"},
  {"id":2,"name":"Bob"},
  {"id":3,"name":"Carol"},
  {"id":4,"name":"Dave"}
]

Paste the combined array into the converter above and download the result.

Python: Merge Multiple JSON Files Into One Excel Sheet

import json
import glob
import pandas as pd

# Read all JSON files in a folder
all_data = []
for filepath in glob.glob('data/*.json'):
    with open(filepath, 'r') as f:
        data = json.load(f)
        # Handle both list and single-object files
        if isinstance(data, list):
            all_data.extend(data)
        else:
            all_data.append(data)

# Convert to DataFrame and export
df = pd.DataFrame(all_data)
df.to_excel('merged_output.xlsx', index=False)
print(f'Exported {len(df)} rows from {len(all_data)} records')

Install dependencies: pip install pandas openpyxl

This flattens all records into one sheet. If files have different keys, pandas fills missing values with NaN (blank cells in Excel).

Sell Custom Apparel — We Handle Printing & Free Shipping

Python: Put Each JSON File on a Separate Excel Sheet

import json
import glob
import os
import pandas as pd

output_path = 'multi_sheet_output.xlsx'

with pd.ExcelWriter(output_path, engine='openpyxl') as writer:
    for filepath in glob.glob('data/*.json'):
        with open(filepath, 'r') as f:
            data = json.load(f)

        df = pd.DataFrame(data if isinstance(data, list) else [data])

        # Use filename (without extension) as sheet name
        sheet_name = os.path.splitext(os.path.basename(filepath))[0]
        # Excel sheet names max 31 chars
        sheet_name = sheet_name[:31]

        df.to_excel(writer, sheet_name=sheet_name, index=False)

print(f'Created {output_path} with one sheet per file')

What Happens When Files Have Different Keys

When merging JSON files that have different fields, you have two options:

Option 1 — Union columns (pandas default): All columns from all files appear in the output. Files missing a field get a blank cell in that column. This is what the Python script above does automatically via pd.DataFrame(all_data).

Option 2 — Common columns only: Only keep columns that appear in all files.

# Find common keys across all files
common_keys = None
for item in all_data:
    keys = set(item.keys())
    common_keys = keys if common_keys is None else common_keys & keys

# Filter to common keys only
filtered = [{k: v for k, v in item.items() if k in common_keys} for item in all_data]
df = pd.DataFrame(filtered)

For most use cases, Option 1 (union) is more useful — you see all available data and can identify which records have missing fields by looking for blank cells.

Convert a Single JSON File Right Now

For one file at a time — paste your JSON array above and download an Excel file instantly. No install required.

Open Free JSON to Excel Converter

Frequently Asked Questions

Can the browser converter handle multiple JSON files?

The browser converter accepts one JSON array at a time. To merge multiple files, combine them into a single array first (as shown in the browser method above), then paste the combined array.

What is the fastest way to merge 100+ JSON files to Excel?

Use the Python glob approach — it reads all matching files in a folder automatically. On a modern machine, 100 files with a few thousand records each converts in seconds.

How do I merge JSON files from different API endpoints?

Fetch each endpoint, store the responses as JSON files or in memory, then combine the arrays and convert. The Python script works with in-memory data too — just build the all_data list by appending API responses directly instead of reading files.

Marcus Webb
Marcus Webb Full-Stack Developer

Marcus leads spreadsheet and charting tool development at WildandFree, with five years of data engineering experience.

More articles by Marcus →
Launch Your Own Clothing Brand — No Inventory, No Risk