▤

JSON to Excel

Turn JSON arrays into an XLSX worksheet with optional flattening

JSON to Excel — what it does

Turn a JSON array into an XLSX worksheet with a name you choose, optionally flattening nested objects into dotted column headers. Compared with the CSV route this produces a file that opens straight into Excel — no import dialog, no delimiter question, no encoding guesswork.

Worked example

Three staff records with a nested office object and a skills array, converted with 'Flatten nested objects' ticked and the worksheet named Staff.

Input — JSON array

[
{"name":"Ann Lee","dept":"Sales","office":{"city":"Taipei","floor":3},"skills":["CSV","Excel"]},
{"name":"Ben Ortiz","dept":"Engineering","office":{"city":"Austin","floor":1},"skills":["JSON"]},
{"name":"Chloe Park","dept":"Sales","office":{"city":"Taipei","floor":3},"skills":[]}
]

Output — json-data.xlsx › Staff

name       | dept        | office.city | office.floor | skills
Ann Lee    | Sales       | Taipei      | 3            | ["CSV","Excel"]
Ben Ortiz  | Engineering | Austin      | 1            | ["JSON"]
Chloe Park | Sales       | Taipei      | 3            | []

Status: 3 rows. office.floor is a numeric cell; the skills array is written as JSON text. Without flattening, the office and skills columns exist but every cell in them is empty.

When this tool helps

  • Handing API data to a colleague who works in Excel and does not want to see JSON.
  • Building a report worksheet from a system export without an intermediate CSV step.
  • Getting nested payload data into a flat table that finance or operations can filter.

How to use it

  1. Paste the JSON array.
  2. Enter a worksheet name.
  3. Turn on flattening if the objects are nested.
  4. Process and download the XLSX workbook.

Accuracy, limits, and good practice

  • Flattening turns address.city into its own column, which is what makes deeply nested payloads usable in a spreadsheet at all.
  • Excel may reformat values that look like dates or long numbers on open; check identifiers with leading zeros afterwards.
  • Give the worksheet a meaningful name — it is the first thing a recipient sees when the file opens.

Frequently asked questions

What if objects have different fields?

The columns are the union of all keys; records without a given field leave that cell empty.

Why XLSX rather than CSV?

It opens without prompts, preserves the sheet name and avoids the delimiter and encoding issues CSV brings with it.

Can I convert back to JSON later?

Yes, the Excel to JSON tool converts a worksheet into objects or row arrays.

What happens to nested data when Flatten is not ticked?

It is silently lost: the office and skills columns are created but every cell in them is empty. Tick Flatten nested objects to get office.city and office.floor columns; arrays are then written as JSON text such as ["CSV","Excel"].

What is the file called, and can I convert a single object?

Always json-data.xlsx, with the worksheet named from the field (Data when blank). A single object is accepted and becomes a one-row sheet; the status line reports the row count.

Related tools on this site

Everything above runs inside this page. JSON to Excel needs no account, no upload, and no server round trip — close the tab and nothing is left behind.

JSON 轉 Excel能做什麼

把 JSON 陣列轉成 XLSX 工作表,名稱由你指定,並可選擇把巢狀物件攤平成點路徑欄位標題。與走 CSV 相比,這裡產出的檔案能直接在 Excel 開啟——沒有匯入對話框、沒有分隔符問題、也不必猜編碼。

實際範例

三筆帶巢狀 office 物件與 skills 陣列的員工資料,勾選「Flatten nested objects」並把工作表取名 Staff 後轉換。

來源:JSON 陣列

[
{"name":"Ann Lee","dept":"Sales","office":{"city":"Taipei","floor":3},"skills":["CSV","Excel"]},
{"name":"Ben Ortiz","dept":"Engineering","office":{"city":"Austin","floor":1},"skills":["JSON"]},
{"name":"Chloe Park","dept":"Sales","office":{"city":"Taipei","floor":3},"skills":[]}
]

產生的檔案:json-data.xlsx › Staff

name       | dept        | office.city | office.floor | skills
Ann Lee    | Sales       | Taipei      | 3            | ["CSV","Excel"]
Ben Ortiz  | Engineering | Austin      | 1            | ["JSON"]
Chloe Park | Sales       | Taipei      | 3            | []

狀態顯示 3 rows。office.floor 是數值格;skills 陣列以 JSON 文字寫進去。若不攤平,office 與 skills 兩欄仍會建立,但裡面每一格都是空的。

什麼時候用得上

  • 把 API 資料交給習慣用 Excel、不想看 JSON 的同事。
  • 從系統匯出直接做出報表工作表,不必經過 CSV 中繼。
  • 把巢狀載荷變成財務或營運能篩選的平面表格。

使用步驟

  1. 貼上 JSON 陣列。
  2. 輸入工作表名稱。
  3. 物件有巢狀時請開啟攤平。
  4. 執行處理並下載 XLSX 活頁簿。

精確度、限制與實務建議

  • 攤平會把 address.city 變成獨立欄位,這正是深層巢狀載荷在試算表中變得可用的關鍵。
  • Excel 開啟時可能重新格式化看起來像日期或長數字的值,之後請檢查帶前置零的識別碼。
  • 工作表請取有意義的名稱——那是收件人開檔第一眼看到的東西。

常見問題

物件欄位不一致怎麼辦?

欄位取所有鍵的聯集,沒有該欄位的紀錄留空。

為什麼用 XLSX 而不是 CSV?

它開檔不必回答問題、保留工作表名稱,也避開 CSV 帶來的分隔符與編碼問題。

之後可以轉回 JSON 嗎?

可以,Excel 轉 JSON 工具能把工作表轉成物件或列陣列。

沒勾 Flatten 時巢狀資料會怎樣?

會無聲地消失:office 與 skills 欄會建立,但每一格都是空的。勾選 Flatten nested objects 才會得到 office.city 與 office.floor 欄;陣列則寫成 ["CSV","Excel"] 這樣的 JSON 文字。

檔案叫什麼?單一物件也能轉嗎?

一律是 json-data.xlsx,工作表名稱取自欄位(留白時為 Data)。單一物件也接受,會變成只有一列的工作表;狀態列會報列數。

本站相關工具

以上步驟全部在這個頁面內完成,JSON 轉 Excel 不需要註冊、不上傳檔案、也不經過伺服器,關閉分頁後不會留下任何資料。