DataToolsLab

The Ultimate CSV Guide

Everything about CSV: format spec, quoting, line endings, tools, and troubleshooting.

CSV is the most ubiquitous tabular data format. This guide covers the spec, the common pitfalls, and the tools that move you between CSV and other formats.

What is CSV?

CSV (Comma-Separated Values) stores tabular data as plain text. Each line is a record, fields are separated by commas, and the first row is typically a header. RFC 4180 is the canonical spec.

Quoting rules

A field that contains a comma, a newline, or a double quote must be enclosed in double quotes. Inside quoted fields, double quotes are escaped by doubling them. Use our CSV to JSON tool to convert arbitrary CSV safely.

Common pitfalls

Mixing tabs and commas, omitting quotes around commas inside fields, line-ending mismatches (CRLF vs LF) and trailing empty rows are the typical source of CSV bugs.

Tools

Use our CSV to JSON converter to inspect a CSV as JSON for debugging, or back-convert when shipping data to an API.

Related tools

Online