CSV para JSON

Em alta 🔥

Converta dados CSV para o formato JSON.

Como usar CSV para JSON

  1. 1Cole seus dados CSV (primeira linha = cabeçalhos)
  2. 2Clique em Converter para JSON
  3. 3Copie ou baixe a saída JSON

Sobre CSV para JSON

O conversor CSV para JSON recebe dados de valores separados por vírgula (CSV) e os transforma em um array JSON de objetos. A primeira linha do CSV é tratada como nomes de propriedade. Toda a conversão é executada completamente no seu navegador.

Principais recursos de CSV para JSON

  • Convert CSV data to a JSON array of objects instantly
  • First row of CSV is automatically used as property keys
  • Handles quoted fields containing commas, quotes, or newlines
  • Supports both Windows (CRLF) and Unix (LF) line endings
  • Outputs formatted, pretty-printed JSON for readability
  • Works entirely in-browser — no file upload or server required
  • Copy or download the JSON output with one click
  • Handles large CSV files smoothly in the browser

Formatos suportados

Formatos de entrada

CSV (valores separados por vírgula)CSV com campos entre aspasCSV with CRLF or LF line endings

Formatos de saída

Array JSON de objetos (formatado)

A primeira linha deve ser uma linha de cabeçalho. Todos os valores são produzidos como strings.

Exemplos

Convert a product list CSV to JSON

Transform an exported spreadsheet into a JSON array ready for an API or database import.

Entrada

name,price,stock
Widget A,9.99,120
Widget B,24.50,45

Saída

[{"name":"Widget A","price":"9.99","stock":"120"},{"name":"Widget B","price":"24.50","stock":"45"}]

Convert CSV with quoted fields containing commas

Handle CSV fields that contain commas by wrapping them in double quotes.

Entrada

city,country
"New York, NY",USA
"London, UK",UK

Saída

[{"city":"New York, NY","country":"USA"},{"city":"London, UK","country":"UK"}]

Casos de uso comuns

  • Transforming database export CSV files into JSON for API ingestion
  • Converting Excel/Google Sheets exports to JSON for JavaScript applications
  • Preparing CSV data from legacy systems for modern REST APIs
  • Prototyping with real data by quickly converting spreadsheet exports
  • Converting survey result exports from CSV to JSON for analysis tools
  • Migrating data between systems that use different serialization formats

Solução de problemas

Extra empty objects appear at the end of the JSON array

Solução

This is caused by trailing newlines in the CSV. Remove any blank lines at the end of your CSV before converting.

Fields with commas are split incorrectly

Solução

Fields containing commas must be wrapped in double quotes in the CSV (e.g., "New York, NY"). Ensure your source data is properly quoted per the CSV standard.

Numbers appear as strings in the JSON output

Solução

The converter outputs all values as strings for safety. If your application requires numeric types, parse the strings in your code using parseInt() or parseFloat() after importing.

Perguntas frequentes

What delimiter is used?

The tool expects comma-separated values (CSV). Tab-separated (TSV) and semicolon-separated files are not currently supported. If your file uses a different delimiter, replace it with commas before converting.

How are numbers and booleans handled?

All values are output as JSON strings. Type conversion is not applied automatically — if you need numeric or boolean types, parse the output in your application code.

What happens if a field contains a comma?

Fields containing commas must be enclosed in double quotes in the CSV (e.g., "value with, comma"). The parser correctly handles RFC 4180-compliant quoted fields.

What if my CSV has no header row?

The first row is always treated as the header row. If your CSV has no headers, manually add a header row with column names before pasting it into the tool.

Can I convert a CSV file directly?

Yes, you can paste CSV content directly or, if a file upload option is available, load the file from your device. No data is sent to a server — the conversion runs entirely in your browser.

What is the maximum CSV size I can convert?

There is no server-imposed limit. The practical limit depends on your browser's memory. CSVs with tens of thousands of rows typically convert in under a second on modern hardware.

How do I handle CSV with special characters?

The tool handles UTF-8 encoded CSV, including accented characters, emoji, and other Unicode characters. Ensure your source CSV is saved as UTF-8 to avoid encoding issues.

Is my data sent to a server?

No. All processing is done entirely in your browser. Your CSV data never leaves your device and is not stored or logged anywhere.