Excel can import and display JSON data as structured tables, letting you analyze nested data without coding. This is useful for extracting values from APIs, logs, or configuration files into rows and columns for sorting, filtering, or charting. You need Excel 2016 or later (including Microsoft 365) and a valid JSON file with consistent structure.
What You'll Need
- Microsoft Excel 2016 or later (including Microsoft 365)
- A JSON file with a flat or nested structure (e.g., array of objects)
- Basic familiarity with file locations on your computer
Step-by-Step
- Open Excel and create a new blank workbook.
- Go to the Data tab on the Ribbon.
- Click on Get Data, then select From File, and choose From JSON.
- Use the file browser to locate your JSON file, select it, and click Open.
- Excel will open the Power Query Editor and show a preview of the JSON data. If the JSON contains an array of objects (e.g., [{"name":"Alice","age":30},{"name":"Bob","age":25}]), you'll see a single column labeled Value with a table icon.
- Click the double-arrow icon (Expand) next to the Value column header. A dialog will appear listing all available fields from the JSON objects.
- Select all fields you want to import (e.g., name, age). Ensure "Use original column name as prefix" is unchecked unless you need it for clarity. Click OK.
- Excel will now display each JSON object as a row with columns for each key. Review the data types—Excel may auto-detect text, number, or date formats incorrectly.
- To fix data types, click the icon next to each column header (e.g., ABC for text, 123 for number), then choose the correct type (e.g., Whole Number, Decimal Number, Text).
- Once all columns are correctly formatted, click Close & Load in the top-left corner of Power Query Editor to import the data into your worksheet.
- Excel will create a new sheet with the imported data as a table. You can now sort, filter, or create pivot tables as needed.
Common Mistakes
- Trying to import a single JSON object (e.g., {"name":"Alice","age":30}) instead of an array. Excel requires an array (square brackets) to expand into rows. Wrap single objects in square brackets: [{"name":"Alice","age":30}].
- Leaving nested objects unexpanded.
- Ignoring data type mismatches. Excel may interpret numbers as text if they contain commas, spaces, or leading zeros. Always check and convert types manually.
- Using malformed JSON with trailing commas, unquoted keys, or inconsistent nesting. Validate your JSON using a tool like jsonlint.com before importing.
- Assuming Excel can read JSON from a URL directly. It cannot. You must download the file first and import from your local drive.
Tips
- Keep your JSON structure consistent across all entries. If one object has a key like "phone" and another doesn’t, Excel will create a blank column for that key, which may break automated workflows.
- Use the Power Query Editor’s "Transform" tab to clean data before loading—remove duplicates, split columns, or replace nulls.
- Save your Excel file as .xlsx or .xlsm to preserve the query connection. If you reopen it later, you can refresh the data by right-clicking the table and selecting Refresh.
- If your JSON is large (10,000+ rows), Excel may slow down. Consider filtering or sampling data in Power Query before loading.
- For recurring imports, rename the query (e.g., "API_Responses") in the Queries & Connections pane for easier identification.
Troubleshooting
- "The file cannot be opened" error: Confirm the file is saved as .json and not .txt or .log. Right-click the file, select Properties, and check the file type.
- Empty table after import: The JSON may be invalid. Open the file in a text editor and check for syntax errors like missing commas or braces. Use jsonlint.com to validate.
- Only one column appears with "Value": This means Excel sees the JSON as a single object or array, but it hasn’t been expanded. Click the expand icon next to Value and select the fields you need.
- Columns are missing or show "null": Some objects in your JSON array may be missing keys. Excel creates a column for every key found in any object, but leaves blanks where the key is absent. Add the missing key with a null or empty string value in those objects if consistency is needed.
- Excel crashes or freezes: Restart Excel. If the issue persists, try importing a smaller sample of your JSON to isolate the problem. Large files may exceed Excel’s memory limits—consider splitting the file into smaller chunks.
- Refresh doesn’t update data: Ensure the original JSON file hasn’t been moved or renamed. If it has, right-click the query in Queries & Connections, select Properties, and update the file path.