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

  1. Open Excel and create a new blank workbook.
  2. Go to the Data tab on the Ribbon.
  3. Click on Get Data, then select From File, and choose From JSON.
  4. Use the file browser to locate your JSON file, select it, and click Open.
  5. 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.
  6. Click the double-arrow icon (Expand) next to the Value column header. A dialog will appear listing all available fields from the JSON objects.
  7. 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.
  8. 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.
  9. 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).
  10. 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.
  11. 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.

Frequently Asked Questions

Can I import JSON from a website directly in Excel?

No. Excel cannot fetch JSON directly from URLs. You must download the file to your device first, then use Get Data > From JSON to import it locally.

What if my JSON has arrays inside objects?

Excel can expand arrays nested within objects. Click the expand icon on the column containing the array, then select the items within it. Each item will become a new row if you choose to expand all entries.

Does Excel support JSON with mixed data types in one key?

No. If a key sometimes holds a number and sometimes a string (e.g., "price": 29.99 or "price": "n/a"), Excel may treat it as text or fail to parse. Clean the data in the source JSON to use consistent types.

Can I edit the imported JSON data in Excel and save it back as JSON?

No. Excel can only import JSON. To export back, you must manually reformat the data or use a script (e.g., Python or PowerShell) to convert the table back to JSON.

Why do some numbers appear as text after import?

Excel sometimes misreads numbers with commas, leading zeros, or non-standard formatting as text. After importing, select the column, go to the Data tab, and use "Text to Columns" with the Delimited option, or change the format manually via the Home tab’s Number group.

Is this feature available in Excel for Mac?

Yes. Excel for Mac 2016 and later supports Get Data > From JSON. The steps are identical, though the ribbon layout may vary slightly.