To read a JSON file in Excel, use the Power Query tool by navigating to the Data tab, selecting Get Data, and choosing From File > From JSON. This process converts the hierarchical, text-based JSON format into a structured table that Excel can analyze. Because JSON files are often nested (containing lists within lists), you will need to use the Power Query Editor to "expand" the data into columns and rows before it appears in your spreadsheet.
What You'll Need
- A computer with Microsoft Excel installed (Excel 2016 or newer is recommended, as Power Query is built-in).
- A valid .json file saved locally on your hard drive or a network path.
- Basic familiarity with the Excel ribbon interface.
Step-by-Step
- Open the Data Import Menu: Launch Excel and open a blank workbook or the file where you want the data to reside. Click on the Data tab in the top ribbon. Note that menu labels may differ slightly depending on your version of Excel or regional settings.
- Select the JSON Source: Click on Get Data, hover over From File, and then select From JSON from the fly-out menu.
- Locate Your File: A file browser window will appear. Navigate to the folder where your .json file is stored, select the file, and click Import.
- Enter the Power Query Editor: Excel will not immediately put the data into the cells. Instead, it opens the Power Query Editor window. You will likely see a single entry labeled "Record" or a list of records. This is because JSON is a nested format and Excel needs to know which levels of the data you want to extract.
- Convert to Table: If your data appears as a single "Record," look at the top left of the Power Query toolbar and click the To Table button. A dialog box will appear asking about delimiters; usually, the default settings are fine. Click OK.
- Expand the Columns: You will now see a column (often named "Column1") containing "Record" or "List" entries. Look for the small icon in the top-right corner of the column header that looks like two arrows pointing away from each other. Click this icon.
- Select Your Fields: A list of all the keys (field names) found in the JSON file will appear. Uncheck "Use original column name as prefix" to keep your headers clean, then select the specific fields you want to import into your spreadsheet. Click OK.
- Handle Nested Lists: If some columns still say "List," it means there is another layer of data inside that field. Click the expand icon for that specific column again. You may be asked if you want to "Expand to New Rows." Choose this option if you want each item in the list to have its own row in Excel.
- Format Data Types: Check the data types of your columns. Click the icon next to the column header (e.g., ABC or 123) to ensure dates are marked as Dates, numbers as Decimals or Whole Numbers, and text as Text. This prevents errors during later calculations.
- Load to Excel: Once the data looks exactly how you want it in the preview window, click Close & Load in the top-left corner of the ribbon. The data will now be inserted into your worksheet as a formatted Excel Table.
Common Mistakes
One of the most frequent errors is attempting to open a JSON file by using File > Open. While Excel might open the file, it will treat it as a plain text document, dumping the entire raw code into a single cell or a long column of text. This makes the data impossible to analyze. Always use the Get Data path to ensure the JSON parser is activated.
Another common mistake is forgetting to uncheck the "Use original column name as prefix" box during the expansion step. If you leave this checked, Excel will name your columns something like "Column1.FirstName" and "Column1.LastName" instead of just "FirstName" and "LastName." While this isn't a technical error, it creates cluttered headers that make formulas and pivot tables harder to manage.
Users also frequently overlook the "Expand to New Rows" step. When dealing with JSON arrays, simply expanding the column might not be enough. If you don't expand to new rows, you may end up with a cell that says "List," which provides no usable information in the final spreadsheet. You must explicitly tell Power Query to flatten these lists into individual rows.
Tips
To keep your workbook efficient, use the Transform Data option instead of loading everything immediately. If your JSON file is massive (thousands of rows), you can use the filters within the Power Query Editor to remove unnecessary columns or rows before they are loaded into the Excel sheet. This reduces the file size and improves performance.
If the JSON file is hosted on a website or an API rather than a local folder, you can use Get Data > From Other Sources > From Web. You enter the URL of the JSON endpoint, and Excel will follow the same Power Query steps described above. This is particularly useful for live data feeds that update automatically.
Once you have set up the import process, you don't have to repeat the steps if the source JSON file is updated. Simply right-click anywhere in the resulting Excel table and select Refresh. Excel will re-run the Power Query steps and pull in the latest data from the file, maintaining all your formatting and data type settings.
Troubleshooting
The file won't import or gives a "Format Error": This usually happens if the JSON file is malformed. JSON requires strict syntax (e.g., matching curly braces and double quotes). Use a free online JSON validator to check if the file is valid. If the file is corrupted, Excel cannot parse it.
Data appears as "Error" in cells: This often occurs when the data type in the JSON file doesn't match the data type assigned in Power Query. For example, if a field is mostly numbers but contains one "N/A" text string, Excel may throw an error. Go back into Transform Data and change the column type to "Text" to see the original values, then clean the data using the "Replace Values" feature.
The "Get Data" menu is missing: If you are using a very old version of Excel (pre-2016), Power Query is not built-in. You will need to download and install the "Power Query" add-in from the official Microsoft website. If you are using Excel for the Web, some "Get Data" features are limited; try opening the file in the desktop application.
The expand icon is missing: If you don't see the two-arrow icon in the column header, the data in that column is likely already a simple value (text or number) rather than a Record or List. You can only expand columns that contain complex JSON objects.
Frequently Asked Questions
Can I import multiple JSON files at once?
Yes, but you must use Get Data > From File > From Folder. This allows Excel to look at every JSON file in a specific directory and combine them into a single table, provided they share the same structure.
Does this method work for very large JSON files?
Power Query is designed to handle large datasets more efficiently than standard cell entry. However, if the file is several gigabytes in size, your computer's RAM may become a bottleneck. In such cases, filtering data within the Power Query Editor before loading is essential.
Can I export an Excel sheet back to JSON?
Excel does not have a native "Save As JSON" feature. To do this, you would typically need to use a third-party add-in, an online converter, or a script (like Python or VBA) to transform the table back into JSON format.
What is the difference between a Record and a List in Excel?
A Record is like a single row of data with various fields (e.g., one person's name, age, and email). A List is a collection of similar items (e.g., a list of all the emails for ten different people). You expand Records into columns and Lists into rows.
Will the data update automatically if the JSON file changes?
It will not update in real-time, but it is linked. You must click Data > Refresh All or right-click the table and select Refresh to pull the latest changes from the source file.
Can I use this to read JSON from a URL?
Yes. Instead of selecting "From JSON," select Get Data > From Other Sources > From Web. Paste the URL of the JSON file, and Excel will treat it the same way as a local file.