JSON to Excel converter online
Paste JSON or upload a .json file, check the table, then download it as an Excel (.xlsx) file. Nested objects get their own columns. The conversion runs in your browser, so your data never leaves your computer. The download button on this page is vue3-json-to-excel, a Vue 3 component you can add to your own app.
How JSON becomes a spreadsheet
- Each object in the array is one row. A single object gives a one-row sheet.
- Keys become the header row, in the order they first appear.
-
Nested objects are flattened into dotted column names, so
{"shipping": {"city": "Berlin"}}lands in ashipping.citycolumn. - Arrays inside an object are written to one cell as JSON text, for example
["keyboard","mouse"]. - Numbers and booleans keep their type in Excel.
nullleaves the cell empty. - Top-level values that are not objects go into a column named
value.
Going the other way? The Excel to JSON converter reads an .xlsx, .xls, .ods or .csv file and gives you the rows as a JSON array.
Vue 3 JSON to Excel: use the component in your app
The converter above is a thin page around one component. In your own Vue 3 app it renders a link, and a click builds the workbook with SheetJS and starts the download. There is no server involved.
Install it:
npm i vue vue3-json-to-excel
Use it with an object or an array of objects:
<vue3-json-to-excel :jsonData="{ hello: 'world', world: 'hello' }" />
Full example from the README:
<script>
import { defineComponent } from 'vue';
import Vue3JsonToExcel from 'vue3-json-to-excel';
export default defineComponent({
name: 'ServeDev',
components: {
Vue3JsonToExcel
}
});
</script>
<template>
<div id="app">
<vue3-json-to-excel fileName="myFile" buttonText="Download Halit's excel file" :jsonData="{ hello: 'world', world: 'hello' }" />
</div>
</template>
The default export has an install() method, so you can also register it once for the whole
app:
import { createApp } from 'vue';
import Vue3JsonToExcel from 'vue3-json-to-excel';
import App from './App.vue';
createApp(App).use(Vue3JsonToExcel).mount('#app');
Arrays and nested objects in jsonData need a release newer than 1.0.5. Version 1.0.5 on npm
writes one flat object as a single row.
Options
| Prop | Type | Required | Default |
|---|---|---|---|
jsonData |
Object or Array | yes | |
fileName |
String | no | output (.xlsx is added to the name) |
buttonText |
String | no | Download |
The component renders a single <a> element, so a class or
style you put on it lands on that link. The green button on this page is styled that way.
JSON to xlsx in JavaScript with SheetJS
Under the hood the component makes four SheetJS calls. If you are not using Vue, the same calls turn an array of flat objects into an .xlsx download in plain JavaScript:
import * as XLSX from 'xlsx';
const sheet = XLSX.utils.json_to_sheet(rows);
const workbook = XLSX.utils.book_new();
XLSX.utils.book_append_sheet(workbook, sheet);
XLSX.writeFile(workbook, 'output.xlsx');
json_to_sheet cannot write an object into a cell, which is why the component flattens nested
objects into dotted keys first.
Guides
- How to open a JSON file in Excel
- How to open a JSON file
- Sample JSON files to download and test
- How to convert JSON to CSV
- Nested JSON to Excel: how objects and arrays become columns
- Convert Excel to JSON in JavaScript
- JSON to Excel in JavaScript with SheetJS
- Vue 3 export to Excel: download JSON as an .xlsx file
FAQ
How do I convert JSON to Excel?
Paste your JSON into the box on this page or upload a .json file. The table on the right shows how the rows and columns will look. Click Download .xlsx and open the file in Excel.
Is this JSON to Excel converter free?
Yes. There is no sign-up and no usage limit. The page and the vue3-json-to-excel component behind it are open source under the MIT license.
Is my JSON uploaded anywhere?
No. This is a static page on GitHub Pages with no backend. Your browser parses the JSON and SheetJS builds the .xlsx file on your computer.
Which JSON can I convert to Excel?
An array of objects, which gives one row per object, or a single object, which gives one row. Nested objects
become dotted columns such as shipping.city, and arrays inside an object are written to one
cell as JSON text. See how JSON becomes a spreadsheet.
Is there a size limit?
The converter sets none. Large files are limited by your browser's memory. The preview shows the first 50 rows, and the download has all of them.
Can I convert Excel back to JSON?
Yes, with the Excel to JSON converter on this site. It reads .xlsx, .xls, .ods and .csv files and can rebuild nested objects from dotted column names.
Can I open the file in Google Sheets or LibreOffice?
Yes. The download is a standard .xlsx workbook, which Excel, LibreOffice Calc and Google Sheets all open.
Does the component work with Vue 2?
No. It is written for Vue 3 and lists vue ^3.0.5 as its peer dependency.