Convertidor CSV a JSON

Transforma texto CSV en JSON bonito al instante.

// about

Sobre esta herramienta

Convierte datos CSV de hojas de cálculo a formato JSON o viceversa. Ideal para trasladar información entre Excel y aplicaciones web.

Cómo usarla

  1. Pega tu texto CSV o datos en JSON.
  2. Verifica el separador (por defecto coma).
  3. Haz clic en 'Convertir' y copia el resultado.

Por qué usar esta herramienta

  • Intercambia datos fácilmente entre Excel y programas web.
  • Soporta separadores por coma o punto y coma.
  • Conversión rápida sin instalar nada.

Preguntas frecuentes (FAQ)

¿Qué es un archivo CSV?

Es una tabla de texto simple donde los valores se separan por comas.

¿Debo incluir encabezados en la primera fila?

Sí, poner nombres a las columnas ayuda a nombrar las claves en JSON.

¿Qué delimitador selecciono?

La mayoría usa coma (,), aunque en algunos países se usa punto y coma (;).

Guías · Datos · 8 min de lectura

CSV o JSON: cuándo usar cada uno y qué vigilar al convertir

Enviar una exportación de hoja de cálculo a una API, o abrir una respuesta de API en Excel, implica convertir entre CSV y JSON. Conocer las diferencias entre formatos evita que los datos se dañen por el camino.

CSV (Comma-Separated Values) es una tabla. La primera línea contiene los nombres de columna y cada línea siguiente es un registro, con valores separados por comas. Es la forma más simple y ligera de guardar datos planos en los que todas las filas tienen las mismas columnas.

name,city,score
Kim,Seoul,92
Lee,Busan,85

[
  {"name": "Kim", "city": "Seoul", "score": 92},
  {"name": "Lee", "city": "Busan", "score": 85}
]
CSV o JSON: diferencias de estructura, por qué Excel desordena los CSV UTF-8, escape de comas y comillas y cómo aplanar datos anidados.
Leer guía →
Créalo con IA

Crea esta herramienta tú mismo con IA

¿Quieres tu propia versión? Copia el prompt en un chat de IA o guarda el archivo de skill para un agente de programación. Incluyen las funciones, casos límite y pruebas que usamos al crearla.

El prompt y la skill están en inglés, que las herramientas de IA entienden perfectamente.

Prompt de instrucciones para IA

Pégalo tal cual en Claude, ChatGPT o Gemini.

You are an experienced full-stack web developer. Build a web tool called "Convertidor CSV a JSON" that meets the requirements below.

## Goal

Build a converter between CSV and JSON.

## Core features

- CSV → JSON (array of objects) and JSON → CSV
- Auto-detect comma, semicolon or tab delimiters
- Header row on/off
- Optional conversion of numbers and booleans
- Download CSV with a UTF-8 BOM for Excel

## Inputs

- CSV or JSON text/file
- Delimiter, header and type options

## Outputs

- Converted data
- Row and column counts

## Edge cases and handling rules

- Follow RFC 4180 for quoted commas, line breaks and doubled quotes
- Keep values with leading zeros (postal codes) as strings
- Flatten nested JSON into dotted columns (user.name)
- Warn when rows have different column counts

## Implementation requirements

- Build it as a single page (HTML, CSS, JavaScript) that runs entirely in the browser, and never send the user's input to a server.
- Make the UI responsive and easy to use on mobile; label every input and keep everything keyboard accessible.
- Add a Copy button for results and show clear, friendly error messages for invalid input.
- Keep the core logic in functions separate from the UI so it can be unit-tested.

## Definition of done (test cases)

- '"Seoul, Korea"' stays a single value
- '01234' is not turned into a number
- Round-tripping keeps the same row count

First outline your implementation plan in at most five lines, then write the complete code, and finally explain how to check the test cases above.

Skill (SKILL.md)

Guárdalo como .claude/skills/build-csv-json-converter/SKILL.md para que agentes como Claude Code lo reutilicen cada vez que crees o cambies la herramienta.

---
name: build-csv-json-converter
description: Use when building or changing a Convertidor CSV a JSON tool. Build a converter between CSV and JSON.
---

# Build: Convertidor CSV a JSON

## Goal

Build a converter between CSV and JSON.

## Workflow

1. Review the required features, inputs and outputs below and ask about anything missing first.
2. Implement the core logic as pure functions separate from the UI.
3. Check the logic against the test cases in the verification list.
4. Build a responsive UI with an input form, a result area and a Copy button.
5. Reproduce each edge case listed under Rules and refine the error messages.

## Core features

- CSV → JSON (array of objects) and JSON → CSV
- Auto-detect comma, semicolon or tab delimiters
- Header row on/off
- Optional conversion of numbers and booleans
- Download CSV with a UTF-8 BOM for Excel

## Inputs

- CSV or JSON text/file
- Delimiter, header and type options

## Outputs

- Converted data
- Row and column counts

## Rules

- Follow RFC 4180 for quoted commas, line breaks and doubled quotes
- Keep values with leading zeros (postal codes) as strings
- Flatten nested JSON into dotted columns (user.name)
- Warn when rows have different column counts
- Build it as a single page (HTML, CSS, JavaScript) that runs entirely in the browser, and never send the user's input to a server.

## Verification

- [ ] '"Seoul, Korea"' stays a single value
- [ ] '01234' is not turned into a number
- [ ] Round-tripping keeps the same row count

Consejos para trabajar con IA

  • Indica tu stack (React, Vue o HTML puro) en la primera línea para obtener código adecuado.
  • Pide que ejecute las pruebas listadas y muestre los resultados antes de aceptar el código.
  • No pegues contraseñas reales, datos de clientes ni claves de API; usa valores de ejemplo.