JavaScript CSV libraries

Updated Nov 2026

JavaScript CSV libraries parse comma-separated text into rows and turn rows back into CSV. A streaming parser reads a large file row by row rather than loading the whole file into memory. These libraries handle spreadsheet uploads, data exports, and bulk imports in web apps and Node.js services.

Popularity

d3-dsv has the most monthly downloads in this comparison, at 132.6M.

LibraryMonthly downloadsStarsLast releaseLicense
d3-dsv
132.6M
446Nov 2026ISC
@fast-csv/format
114.3M
1.8KOct 2026MIT
@fast-csv/parse
114.0M
1.8KOct 2026MIT
csv-parse
109.4M
4.3KSep 2026MIT
ExcelJS
105.0M
15.5KOct 2023MIT
Papa Parse
96.6M
13.6KNov 2026MIT
xlsx
60.5M
36.3KJul 2024Apache-2.0
csv-stringify
50.3M
4.3KSep 2026MIT
Downloads: npm, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

Features compared

LibraryParse CSVWrite CSVIncremental CSV input
d3-dsvBuilt-inBuilt-inUnsupported
@fast-csv/formatUnsupportedBuilt-inUnsupported
@fast-csv/parseBuilt-inUnsupportedBuilt-in
csv-parseBuilt-inUnsupportedBuilt-in
ExcelJSBuilt-inBuilt-inBuilt-in
Papa ParseBuilt-inBuilt-inBuilt-in
xlsxBuilt-inBuilt-inUnsupported
csv-stringifyUnsupportedBuilt-inUnsupported
Built-inNot supported

Libraries and code examples

Parses and formats CSV, TSV and other single-character delimited text.

Downloads / mo
132.6M
Stars
446
Last release
3.0.2
License
ISC

Strengths

  • Parses and formats CSV/TSV. Convert delimited text into rows and serialize records back to text.
  • Converts row values explicitly. Supply a row conversion function when numbers or dates are required.

Limitations

  • Object parsing needs unsafe-eval. Use parseRows when the content security policy blocks generated code.
  • Duplicate column names overwrite values. Use parseRows to retain every value under repeated column names.

Quickstart

From API reference
$ npm install d3-dsv
import { csvParse } from 'd3-dsv';

const rows = csvParse('name,score\nAda,42');
console.log(rows);

d3-dsv examples

From open-source projects on GitHub

@fast-csv/format

Formats rows into CSV or other delimited text in Node.js.

Downloads / mo
114.3M
Stars
1.8K
Last release
5.0.8
License
MIT

Limitations

  • Single-character delimiters only. Pick a one-character field delimiter such as a semicolon or a tab.
  • Disabled quoting can add columns. Keep quoting on when a field can contain the delimiter.

Quickstart

From index.d.ts
$ npm install @fast-csv/format
import { writeToString } from '@fast-csv/format';

const csv = await writeToString([{ name: 'Ada', score: 42 }], { headers: true });
console.log(csv);

@fast-csv/format examples

From open-source projects on GitHub

@fast-csv/parse

Parses CSV or other delimited files in Node.js.

Downloads / mo
114.0M
Stars
1.8K
Last release
5.0.8
License
MIT

Strengths

  • Streams large files. Parsing streams rows without holding a large file in memory.
  • Reads headers from the first row. Setting headers to true keys each row by the names in the first row.

Limitations

  • Single-character delimiters only. Pick a one-character delimiter such as a semicolon or a tab.

Quickstart

From index.d.ts
$ npm install @fast-csv/parse
import { parseString } from '@fast-csv/parse';

parseString('name,score\nAda,42', { headers: true })
  .on('error', console.error)
  .on('data', console.log);

@fast-csv/parse examples

From open-source projects on GitHub

Parses CSV into records through streaming, callback, and synchronous APIs.

Downloads / mo
109.4M
Stars
4.3K
Last release
7.0.3
License
MIT

Strengths

  • Offers streaming and synchronous APIs. Choose streamed records or a direct call returning the complete result.
  • Maps columns to object fields. Read named records using header-derived or explicitly configured columns.

Limitations

  • Sync parsing retains every record. Use streaming when the complete input and result exceed available memory.

Quickstart

From Sync API
$ npm install csv-parse
import assert from "node:assert";
import { parse } from "csv-parse/sync";

const input = `
"key_1","key_2"
"value 1","value 2"
`;
const records = parse(input, {
  columns: true,
  skip_empty_lines: true,
});
assert.deepStrictEqual(records, [{ key_1: "value 1", key_2: "value 2" }]);

csv-parse examples

From open-source projects on GitHub

Reads and writes Excel workbooks and CSV files.

Downloads / mo
105.0M
Stars
15.5K
Last release
4.4.0
License
MIT

Quickstart

From README.md
$ npm install exceljs
const ExcelJS = require('exceljs');

const workbook = new ExcelJS.Workbook();
workbook.csv.readFile('input.csv').then(worksheet => {
  console.log(worksheet.rowCount);
});

ExcelJS examples

From open-source projects on GitHub

Parses delimited text in browsers and Node.js and serializes records back to CSV.

Downloads / mo
96.6M
Stars
13.6K
Last release
5.7.1
License
MIT

Strengths

  • Detects common delimiters automatically. Leave delimiter blank to infer a separator from the configured candidates.
  • Runs parsing in browser workers. Use worker mode to keep the page responsive during parsing.

Limitations

  • Streaming changes completion results. Read streamed rows in step or chunk callbacks, rather than complete.
  • European numbers need normalization. Swap decimal commas and grouping dots before enabling dynamicTyping.

Quickstart

From Papa Parse docs
$ npm install papaparse
import Papa from 'papaparse';

const result = Papa.parse('name,score\nAda,42', { header: true });
console.log(result.data);

Papa Parse examples

From open-source projects on GitHub
export default function serialize(
  rows: Array<Record<string, unknown>>,
  { columns, header = true }: SerializeOptions = {},
): string {
  return papaparse.unparse(rows, { columns, header, escapeFormulae: true });
}

Parses and writes spreadsheet data.

Downloads / mo
60.5M
Stars
36.3K
Last release
0.20.3
License
Apache-2.0

Limitations

  • readFile skips browsers. In the browser, pass file data to read instead of a filename.

Quickstart

From API reference
$ npm i --save https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz
import * as XLSX from 'xlsx';

const workbook = XLSX.read('name,score\nAda,42', { type: 'string' });
console.log(workbook.SheetNames);

Converts records into CSV text through the Node.js stream API, with synchronous and callback options.

Downloads / mo
50.3M
Stars
4.3K
Last release
6.9.0
License
MIT

Strengths

  • Custom formatters and headers. Options set formatters, delimiters, quotes, escape characters, and the header row.
  • No external dependencies. The package installs with no external dependency.

Limitations

  • Writes only. Parse CSV with its companion package csv-parse.

Quickstart

From Sync API
$ npm install csv-stringify
import { stringify } from "csv-stringify/sync";
import assert from "node:assert";

const output = stringify([
  ["1", "2", "3", "4"],
  ["a", "b", "c", "d"],
]);

assert.equal(output, "1,2,3,4\na,b,c,d\n");

csv-stringify examples

From open-source projects on GitHub

FAQ

Papa Parse parses delimited text in browsers and Node.js and serializes records back to CSV. It detects common delimiters when the delimiter option is left blank.

csv-parse parses CSV into records in Node.js through streaming, callback, and synchronous APIs. Its companion package csv-stringify writes CSV.

Papa Parse parses files in the browser, with worker mode to keep the page responsive. csv-parse implements the Node.js stream Transform API for server-side imports.

In the browser, Papa.unparse from Papa Parse turns an array of objects into CSV text. In Node.js, csv-stringify converts records into CSV through a stream or a synchronous call.

Leave Papa Parse delimiter blank to try common delimiters or configured guesses.

parseRows works where a policy blocks the unsafe-eval that object parsing needs.

For coding agents

Found your CSV library? Help your agent use it.

Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.

Run in your terminal

claude plugin install exa@claude-plugins-official