CSV Parser

Paste CSV below and we'll parse itEnter CSV here

Paste CSV to see the parsed rows

What is the CSV Parser?

If you've ever written `line.split(",")` on a CSV file and watched it blow up on a single quoted address containing a comma, you already know why a real parser matters. This tool parses CSV the way the RFC 4180 spec describes: quoted fields stay together, `""` inside quotes becomes a literal `"`, and both `\n` and `\r\n` line endings work.

Paste a CSV like customer_id,order_date,notes with messy real-world values (a comma inside a note, a line break inside quotes, padding around a value) and the parser turns each row into a JavaScript object. Problems such as an unterminated quote or a row longer than the header are reported rather than swallowed. You never pick a separator: the parser tries comma, semicolon, tab and pipe against the opening rows and keeps whichever gives a consistent column count. The table on the right shows exactly what was parsed, with any problems listed above it next to the line they start on. For streaming-scale work, libraries like Papa Parse and csv.js.org are excellent; this page is for the everyday "does this file parse?" check.

Parsing happens entirely in your browser. Nothing goes to a server. CSV is registered with IANA as `text/csv`, and despite how simple the name sounds, the edge cases are real: this page exists to handle them so you don't have to.

What the Parser Actually Handles

RFC 4180 Quoted Fields

Fields wrapped in double quotes can contain commas, newlines, and escaped `""` sequences. The parser tracks quote state across characters instead of naively splitting on commas.

Per-Column Validation Filters

After parsing, filter any column to sanity-check values. Handy for spotting bad zip codes, malformed dates, or unexpected enum values before you ship the data downstream.

Type Inference

The table shows every cell exactly as written. On JSON export, plain numbers become numbers and true/false become booleans. Anything that would change, like 00123, +15551234567 or a 19-digit ID, stays a string.

Parsed JSON Export

Download the parse result as JSON so you can feed it into a script, REST API, or database import without re-parsing anywhere else.

File Upload

Drop a `.csv` or `.txt` file and it loads into the editor. Big files stay in the browser, no upload bar, no server round-trip.

Column Trim

Drop columns you don't need from the parsed output. Useful when the source CSV has 40 columns and your pipeline only cares about 6.

How to Parse a CSV

1

Paste or Upload

Drop your CSV into the left pane. The sample button loads an order-log style CSV with quoted fields, escaped quotes, and an embedded newline so you can see all the edge cases parsed correctly.

2

Watch the Parse Result

The right pane shows each parsed row as a table. If a quote is unterminated or a row has fewer columns than the header, you'll see it immediately. Use the filter inputs to spot-check values.

3

Export Parsed Data

Hit `JSON` to download the parse result as structured JSON, or `Download` to save the cleaned CSV. The JSON output is what most data pipelines actually want.

When You'd Use a Real CSV Parser

ETL and Data Pipelines

Before loading a vendor CSV into Postgres COPY or BigQuery, parse it here to confirm row counts, column alignment, and that nothing has an unterminated quote that will poison the import.

Parsing LLM-Generated CSV

When a language model outputs a CSV table, it often breaks on quote escaping or inconsistent row widths. Paste the output here to see which rows are malformed before you consume them programmatically.

Validating Customer Uploads

If your app accepts CSV uploads, use this page to reproduce a user's failing file locally. The error surface tells you exactly which row broke the parse: much faster than reading your own error logs.

Quick Structural Checks

Does column 3 always hold an ISO date? Does SKU-101 appear in every expected row? Parse and filter in 10 seconds without spinning up a notebook.

CSV Parsing Questions

How does the parser handle quoted fields with commas inside?

It tracks whether the current character is inside a quoted region. Commas inside quotes are treated as literal characters, not delimiters. See RFC 4180 §2 for the formal rules. A value like `"Gift wrap, red ribbon"` parses as one field.

What about escaped double quotes?

Inside a quoted field, two consecutive double quotes (`""`) represent a single literal `"`. So `"Contains ""fragile"" items"` parses to `Contains "fragile" items`. This is the standard RFC 4180 escape.

Does it handle CRLF vs LF line endings?

Yes. The parser reads the text one character at a time, so Windows (`\r\n`), Unix (`\n`), old Mac (`\r`) and mixed files all parse the same. A newline inside a quoted field is kept as part of the value instead of starting a new row.

What happens when rows have different column counts?

Missing fields become empty strings and extra fields are dropped, but the row is not hidden from you: it shows up in the warning list above the table with its line number and how many fields it has compared with the header.

Is the CSV uploaded to a server?

No. Everything parses in your browser with plain JavaScript. Nothing is transmitted. If you need server-side parsing at scale, the IANA text/csv media type is handled by every serious CSV library: node's `csv-parse`, Python's `csv` module, etc.

Will it parse semicolon-separated or tab-separated files?

Yes. The parser looks at the first rows and picks whichever of comma, semicolon, tab or pipe splits them into a consistent number of columns. Semicolon files from European Excel installs and TSV exports work without any setting. A file with only one column is read as comma-separated.

Related CSV Tools

Parsing is step one. When the CSV is clean, these tools do the rest: