FastCSV: fast, lightweight, and easy to use β the production-proven CSV library for Java.
Itβs the most-starred CSV library for Java and trusted by leading open-source projects such as Apache NiFi, JUnit and Neo4j.
Features
Here are the top reasons to choose FastCSV β see fastcsv.org for the full feature list.
- Fast CSV processing β optimized for high-speed reading and writing
- Tiny footprint β only ~90 KiB, with zero runtime dependencies
- Developer-friendly API β clean, intuitive, and easy to integrate
- Well-documented β Quickstart guides and complete Javadoc
- High test coverage β including mutation testing for reliability
- RFC 4180 compliant β handles edge cases correctly
- Robust & maintainable β uses SpotBugs, PMD, Error Prone, NullAway, and Checkstyle to ensure code quality; never returns null unexpectedly
- Secure β fuzz-tested via OSS-Fuzz and following OpenSSF best practices
- Production-proven β trusted by open-source projects like JUnit
- Java 17+, Android 34+ compatible β including GraalVM Native Image and OSGi
Performance
Based on the Java CSV library benchmark suite.
Quick Start
Writing CSV
try (CsvWriter csv = CsvWriter.builder().build(Path.of("output.csv"))) {
csv
.writeRecord("header 1", "header 2")
.writeRecord("value 1", "value 2");
}
Reading CSV
try (CsvReader<CsvRecord> csv = CsvReader.builder().ofCsvRecord(Path.of("input.csv"))) {
csv.forEach(IO::println);
}
For more examples and detailed documentation, visit fastcsv.org. If you find FastCSV useful, consider leaving a star!