SIMD-accelerated, allocation-free CSV reader and strict RFC 4180 writer for .NET
open sourceMS-PL OR Apache-2.0free
CsvHelper is a CSV reader and writer for .NET, built for speed. Its reader parses UTF-8 directly with SIMD and exposes fields as zero-copy spans, adapts to most real-world files with explicit options for malformed ones, and also reads escaped, unescaped and fixed-width files. Its writer produces strict RFC 4180 output by default. It maps rows to and from classes (records), and the CsvHelper.Linq package queries CSV with LINQ, reading only the columns and rows a query uses and joining with Entity Framework Core. It targets .NET 10 and .NET 8 and runs on .NET Framework 4.7+ and .NET Standard 2.0 and 2.1. Version 34 is a rewrite, with a migration guide from 33.
Problems it solves
- read a large CSV file fast in C#
- map CSV rows to C# classes and write them back
- parse messy CSV exports in .NET
Features
- SIMD UTF-8 parsing with zero-copy field spans
- Strict RFC 4180 writer, plus escaped, unescaped and fixed-width modes
- Maps CSV rows to and from classes
- Options for messy and malformed files
- CsvHelper.Linq for LINQ queries over CSV
Limitations
- Version 34 is a rewrite: upgrading from 33 needs the migration guide1