{}

Excel to JSON

Convert a selected worksheet into object arrays or row arrays

No file selected.

Excel to JSON — what it does

Convert a worksheet to JSON in either of the two shapes programs expect: an array of objects keyed by the header row, or plain two-dimensional row arrays. Object mode feeds APIs and front-end code; array mode preserves the grid for tools that want positions rather than names.

Worked example

staff-5.xlsx (worksheet Staff) converted in the default 'Objects using header row' mode; the download is Staff.json.

Input — staff-5.xlsx › Staff

name       | email                  | department  | start_date | salary
Ann Lee    | ann.lee@example.com    | Sales       | 2021-03-15 | 52000
Ben Ortiz  | ben.ortiz@example.com  | Engineering | 2019-11-02 | 88000
Chloe Park | chloe.park@example.com | Sales       | 2023-06-01 | 47500
Dev Patel  | dev.patel@example.com  | Support     | 2020-01-20 | 41000
Emma Rossi | emma.rossi@example.com | Engineering | 2022-09-12 | 91000

Output — Staff.json (first three of five objects)

[
  {
    "name": "Ann Lee",
    "email": "ann.lee@example.com",
    "department": "Sales",
    "start_date": "2021-03-15",
    "salary": 52000
  },
  {
    "name": "Ben Ortiz",
    "email": "ben.ortiz@example.com",
    "department": "Engineering",
    "start_date": "2019-11-02",
    "salary": 88000
  },
  {
    "name": "Chloe Park",
    "email": "chloe.park@example.com",
    "department": "Sales",
    "start_date": "2023-06-01",
    "salary": 47500
  },
  … (2 more objects)
]

The last two objects (Dev Patel, Emma Rossi) are cut here for space. Salary is a JSON number; the date column comes through as the text shown in the sheet. In 'Two-dimensional row arrays' mode the same sheet gives six arrays, the first being the header.

When this tool helps

  • Handing spreadsheet reference data to a developer in the shape their code consumes.
  • Bundling a lookup table into a web application as a static JSON asset.
  • Moving worksheet data into a document database or a configuration file.

How to use it

  1. Choose the Excel file and the worksheet.
  2. Pick the output mode: objects from headers, or row arrays.
  3. Process the conversion.
  4. Download the JSON.

Accuracy, limits, and good practice

  • Object mode needs a clean single header row; merged or two-row headers produce keys nobody wants.
  • Header text becomes keys verbatim, spaces included — snake_case headers save bracket notation in code later.
  • Check how dates look in the output before shipping: spreadsheet date handling is the usual source of surprises in JSON exports.
  • Check a date column in the output before shipping it: spreadsheet dates are stored as serial numbers and can arrive as bare numbers rather than readable dates.

Frequently asked questions

Which mode should I choose?

Objects for APIs and application code, arrays when the consumer expects a grid or the sheet has no meaningful headers.

Are numbers typed as numbers?

Numeric cells export as JSON numbers and text as strings, following what the cell actually holds.

Can I convert several sheets at once?

One worksheet per pass; run each sheet you need and combine the files in your project.

What happens to empty cells?

They come through as empty values, so consuming code should handle a missing field rather than assuming every key is populated.

Why does the preview stop at 100 rows?

The on-page preview shows the first 100 rows only, to keep the page responsive; the downloaded <sheet name>.json contains every row.

How do date cells come out?

As the text displayed in the cell: 2021-03-15 here because the column uses a yyyy-mm-dd format. A column displayed as 15/03/2021 produces that string instead; there is no conversion to ISO or to timestamps, so set the number format in Excel before converting if a particular form is needed.

Related tools on this site

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

Excel 轉 JSON能做什麼

把工作表轉成程式期待的兩種 JSON 形態之一:以標題列為鍵名的物件陣列,或單純的二維列陣列。物件模式餵 API 與前端程式;陣列模式保留網格,給以位置而非名稱取值的工具。

實際範例

以預設的「Objects using header row」模式把 staff-5.xlsx(Staff 工作表)轉成 JSON,下載檔為 Staff.json。

來源:staff-5.xlsx › Staff

name       | email                  | department  | start_date | salary
Ann Lee    | ann.lee@example.com    | Sales       | 2021-03-15 | 52000
Ben Ortiz  | ben.ortiz@example.com  | Engineering | 2019-11-02 | 88000
Chloe Park | chloe.park@example.com | Sales       | 2023-06-01 | 47500
Dev Patel  | dev.patel@example.com  | Support     | 2020-01-20 | 41000
Emma Rossi | emma.rossi@example.com | Engineering | 2022-09-12 | 91000

產生的檔案:Staff.json(五個物件只列前三個)

[
  {
    "name": "Ann Lee",
    "email": "ann.lee@example.com",
    "department": "Sales",
    "start_date": "2021-03-15",
    "salary": 52000
  },
  {
    "name": "Ben Ortiz",
    "email": "ben.ortiz@example.com",
    "department": "Engineering",
    "start_date": "2019-11-02",
    "salary": 88000
  },
  {
    "name": "Chloe Park",
    "email": "chloe.park@example.com",
    "department": "Sales",
    "start_date": "2023-06-01",
    "salary": 47500
  },
  … (2 more objects)
]

最後兩個物件(Dev Patel、Emma Rossi)因篇幅省略。salary 是 JSON 數字;日期欄則是工作表上顯示的文字。改成「Two-dimensional row arrays」模式,同一張表會得到六個陣列,第一個是標題列。

什麼時候用得上

  • 把試算表的參考資料交給開發者,格式正好是程式要吃的形狀。
  • 把對照表打包成靜態 JSON 資產放進網頁應用。
  • 把工作表資料移入文件型資料庫或設定檔。

使用步驟

  1. 選擇 Excel 檔案與工作表。
  2. 選擇輸出模式:標題轉物件,或列陣列。
  3. 執行轉換。
  4. 下載 JSON。

精確度、限制與實務建議

  • 物件模式需要乾淨的單列標題;合併儲存格或雙列標題會產出沒人想要的鍵名。
  • 標題文字會原樣成為鍵名(含空格)——用 snake_case 標題可省去程式裡的中括號寫法。
  • 交付前先確認日期在輸出中的樣子:試算表的日期處理是 JSON 匯出最常見的意外來源。
  • 交付前請先看一眼輸出中的日期欄:試算表日期以序號儲存,可能會變成一串數字而不是可讀日期。

常見問題

該選哪種模式?

API 與應用程式碼選物件;使用端期待網格、或工作表沒有有意義標題時選陣列。

數字會輸出成數字型別嗎?

數值儲存格輸出為 JSON 數字、文字輸出為字串,依儲存格實際內容而定。

可以一次轉多個工作表嗎?

一次一個工作表;需要的表逐一執行,再在專案中合併檔案。

空白儲存格會怎樣?

會輸出成空值,因此使用端程式應處理欄位缺漏,而不是假設每個鍵都有值。

為什麼預覽只到 100 列?

頁面上的預覽只顯示前 100 列,讓頁面保持順暢;下載的「工作表名.json」含有全部列。

日期格會變成什麼?

變成儲存格顯示的文字:這裡是 2021-03-15,因為該欄的格式是 yyyy-mm-dd。顯示成 15/03/2021 的欄就會得到那個字串;不會轉成 ISO 或時間戳記,需要特定格式時先在 Excel 把數字格式設好再轉。

本站相關工具

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