Esta página aún no está traducida al español, así que la mostramos en inglés.

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.

Actualizado el
Open file (.xlsx, .csv, .json)
Input
Shape
Indent

Input preview

Tus datos nunca salen de tu ordenador. Todo se procesa localmente en tu navegador.

Cómo usar: 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.

También se busca como: 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.

Herramientas que combinan con: 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.
  • Generador de datos ficticios — Crea hasta 10 000 filas de datos de prueba realistas —usuarios, productos, pedidos, direcciones, empresas o registros API anidados— o diseña tu propio esquema.
  • JSON to Excel — Turn a JSON array into a real Excel workbook.

Preguntas frecuentes

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.
¿Puedo instalar Excel, CSV & JSON to JS Array como aplicación web y utilizarla sin conexión?
Sí. Excel, CSV & JSON to JS Array es una aplicación web instalable (PWA): se instala desde el navegador, no se descarga desde una tienda de aplicaciones. Haz clic en «Instalar aplicación» en la parte superior de esta página en Chrome o Edge (Windows, macOS, Linux, ChromeOS) o, en Android, utiliza «Compartir» → «Añadir a la pantalla de inicio» en iPhone y iPad, o «Archivo» → «Añadir al Dock» en Safari 17+ en un Mac. A continuación, se abrirá en su propia ventana con su propio icono y, como se ejecuta íntegramente en tu navegador, seguirá funcionando sin conexión. Firefox en el ordenador de sobremesa no permite instalar aplicaciones web. Cómo funciona la instalación.

Herramientas relacionadas