Diese Seite ist noch nicht auf Deutsch verfügbar, daher zeigen wir die englische Version.

Excel, CSV & JSON to JavaScript Array Converter

Paste spreadsheet rows or JSON and get a clean JavaScript array or object literal for your code, tests, mock data or config.

Aktualisiert am
Open file (.xlsx, .csv, .json)
Input
Shape
Indent

Input preview

Deine Daten verlassen nie deinen Computer. Die Verarbeitung erfolgt zu 100 % lokal im Browser.

So nutzt du: Excel, CSV & JSON to JS Array

  1. Paste CSV, Excel cells or JSON, or open a file.
  2. Choose the shape: an array of objects, rows as arrays, or an object keyed by the first column.
  3. Pick the declaration (const, export const, module.exports…), quote style and indentation.
  4. Copy the code or download it as a .js file.

What does a CSV to JavaScript array converter do?

It turns rows of a spreadsheet into a JavaScript literal you can drop into source code — handy for mock data, Storybook stories, unit tests, dropdown options, small lookup tables and static sites that do not need a database or a runtime CSV parser.

export const products = [
  { id: 1, name: 'Ada Lovelace', active: true },
  { id: 2, name: 'Grace Hopper', active: true },
];

JavaScript literal vs JSON

JSON is a strict subset of JavaScript syntax, but hand-written JavaScript is usually more relaxed. This tool writes idiomatic JavaScript:

  • Unquoted keys when the key is a valid identifier (name:), quoted only when needed ('first name':).
  • Single or double quotes to match your Prettier or ESLint settings.
  • Trailing commas, which keep diffs to one line when you add rows.
  • Real types: numbers, booleans and null are not quoted; values with leading zeros stay strings.

Shapes and declarations

OptionOutput
Objects[{ id: 1, … }, …] — the usual array of records
Rows (lists)[['id', 'name'], [1, 'Ada']] — header first, like a spreadsheet
Keyed by 1st column{ 'KB-001': { … } } — instant lookups by ID
export const / export defaultES modules (Vite, Next.js, modern Node)
module.exportsCommonJS (older Node.js code)

With JSON input, Keep original JSON structure converts nested objects and arrays as they are. Need TypeScript types for the data? Generate them with JSON to TypeScript. For PHP projects use CSV to PHP array.

Auch gesucht als: csv to js array, excel to javascript array, csv to array of objects, json to javascript object, csv to js object, spreadsheet to javascript, csv to typescript array.

Passende Tools zu: Excel, CSV & JSON to JS Array

  • Excel to JSON — Open an .xlsx workbook or paste cells straight from Excel or Google Sheets and get clean JSON.
  • CSV to JSON — Paste CSV or TSV and get a JSON array of objects.
  • Generator für Scheindaten — Erstelle bis zu 10.000 Zeilen realistischer Testdaten – Nutzer, Produkte, Bestellungen, Adressen, Unternehmen oder verschachtelte API-Datensätze – oder erstelle dein eigenes Schema.
  • JSON to Excel — Turn a JSON array into a real Excel workbook.

Häufige Fragen

How do I convert CSV to an array of objects in JavaScript?
Paste the CSV with a header row and keep the Objects shape. Each row becomes an object whose keys are the column names.
Can I use the output in TypeScript?
Yes — the literal is valid TypeScript. Add a type annotation, or generate an interface from the data with the JSON to TypeScript tool.
Why are some numbers in quotes?
Values such as ZIP codes or IDs with leading zeros, and integers too large for JavaScript numbers, are kept as strings so they are not changed.
Is the data uploaded?
No. Conversion runs entirely in your browser.
Kann ich Excel, CSV & JSON to JS Array als Web-App installieren und offline nutzen?
Ja. Excel, CSV & JSON to JS Array ist eine installierbare Web-App (PWA) – sie wird über Ihren Browser installiert und nicht aus einem App-Store heruntergeladen. Klicken Sie oben auf dieser Seite in Chrome oder Edge (Windows, macOS, Linux, ChromeOS) auf „App installieren“ oder verwenden Sie auf Android-Geräten „Teilen“ → „Zum Startbildschirm hinzufügen“ auf dem iPhone und iPad bzw. „Datei“ → „Zum Dock hinzufügen“ in Safari 17+ auf einem Mac. Die App öffnet sich dann in einem eigenen Fenster mit einem eigenen Symbol, und da sie vollständig in Ihrem Browser ausgeführt wird, funktioniert sie auch offline. Firefox auf dem Desktop kann keine Web-Apps installieren. So funktioniert die Installation.

Ähnliche Tools