CSV Data Profiling: Read a File Before You Import It

CSV profiling is the act of reading a CSV file before you trust it: counting its rows and columns, working out what type each column holds, and finding the missing values, the duplicates and the quoting traps — before the file is imported, migrated or analysed. A CSV file carries no schema, so nothing in it promises that the delimiter is a comma, that a number column holds only numbers, or that a row appears once. A profile is the first look that answers those questions in one pass, and this article explains what it tells you, how to read each column, the delimiter and quoting pitfalls that break imports, and how to profile a file with the CSV Data Profiler — entirely in your browser, so the file never leaves your machine.

What a profile tells you

A profile starts with the file-level facts: how many rows and columns the file has, which delimiter was actually detected, whether the first row is a header, and how many rows are exact duplicates of an earlier row. Those four numbers already catch the most common import failures — a file that was supposed to have 10,000 rows but parses as 9,998, a semicolon file read as one wide comma column, a header row counted as data, or an export that repeated a batch.

Below that, every column gets its own line: the inferred type — number, date, boolean, text, mixed or empty — how many values are empty and what share of the column that is, how many distinct values there are, and the five most common values with their counts. Numeric columns add min, max, mean, median and sample standard deviation; text columns add the shortest, longest and average length; date columns add the earliest and latest date. Read together, those lines are a usable summary of the whole file — the shape of the data, before a single row is imported.

How to read each column

Type inference is a judgement call, and a good profiler makes the rule explicit. This one calls a column a number when at least 80% of its non-empty values parse as numbers, a date when at least 80% parse as dates — ISO dates like 2026-11-03, slash dates and dotted dates — a boolean for true/false, yes/no and on/off, and text otherwise. A column with no values at all is empty, and one with no dominant type is mixed. The 80% threshold is deliberate: real files have a stray “N/A” or a mistyped row, and a single bad value should not turn a numeric column into text.

The three numbers to check first on any column are the empty share, the distinct count and the top values. An empty share above a few percent means the column cannot be trusted as a key or a required field until you know why the values are missing. A distinct count close to the row count means the column is nearly unique — right for an order id, wrong for a status column that should hold three values. And the top values are where the strays show up: if “N/A” is the third most common value in a quantity column, the data needs cleaning before it needs analysis.

Numbers, text and dates: which stats matter

For a numeric column, the mean and the median answer different questions, which is why both are reported. The mean is pulled by outliers — one $299.00 order among $12.50 ones moves it visibly — while the median, the middle value when the column is sorted, barely notices. When the two disagree, look at the min, the max and the standard deviation: a large spread with a small median usually means a few extreme values, not a column that is wrong overall. And remember that a column of years like 2024, 2025, 2026 is numbers, not dates — a bare year has no month or day, so it cannot be placed on a calendar.

Text columns are judged by length and variety: the shortest, longest and average length expose the truncated value and the pasted paragraph hiding in a name field, while the distinct count next to the top values exposes the same value spelled two ways. Date columns are judged by range and format: the earliest and latest date tell you whether the file covers the period you expect, and a date column that reports as text is almost always two formats in one column — 2026-11-03 in some rows and 11/03/2026 in others — which the parser reads as text because no single format reaches the threshold.

Delimiter and quoting pitfalls

CSV is a loose format, and the delimiter is the first thing that varies. The comma is the default, but exports from European tools often use a semicolon, because the comma is the decimal separator there, and tab- or pipe-separated files are common enough that a profiler must sniff the first lines and pick the delimiter whose column counts are consistent. Fields may be quoted, and a quoted field may contain the delimiter itself, an escaped double-quote (“”) or even a newline — a parser that splits on commas or line breaks without tracking quotes will shred those fields, and every statistic built on them.

The quieter traps sit at the edges of the file. A UTF-8 byte-order mark (BOM) at the start becomes part of the first header name unless it is stripped, so the first column silently stops matching. CRLF and LF line endings mix when a file has passed through Windows and Unix tools. Trailing spaces after a delimiter become part of the next value. And the first row may or may not be a header — a profiler detects it and lets you override the guess, because counting a header as data shifts every statistic by one row. RFC 4180 documents the quoting rules; the Frictionless CSV Dialect spec documents the variations, including delimiter, line terminator and quote character.

A worked example: the demo sales table

The profiler’s demo is a 12-row sales table with six columns — customer, product, quantity, unit_price, order_date and paid — built to exercise every feature on one screen. It has two empty cells, a missing customer on one row and a missing quantity on another; a product name with a quoted comma and an escaped quote, “Monitor, 27"" 4K”; a product name with an embedded newline, “Cable, USB-C” on one line and “2 m” on the next; and one order repeated exactly, Alice Chen’s first order appearing twice.

The profile reads: 12 rows, 6 columns, 1 duplicate row. Quantity runs 1–3 with a mean of 1.55; unit prices run $12.50–$299.00; order dates run 2026-11-03 to 2026-11-13; 9 of 12 orders are paid. Customer has 9 distinct values — Alice Chen appears 3 times — and product has 7, with Wireless Mouse on top at 3. The two empty cells show up as one empty customer and one empty quantity, each 8% of its column. Nothing here is broken: the file is small enough to read by eye, and the profile agrees with what the eye sees — which is exactly what makes it a useful check on files too large to read. The CSV Data Profiler showing the demo sales profile: 12 rows, 6 columns, 1 duplicate row, with per-column type, empty and distinct counts and numeric stats

Why profiling in the browser matters

Real CSV files are rarely toy data. They hold customer lists, payroll rows, order histories and patient records — the kind of data you do not paste into a random website to check. Profiling in the browser removes that trade entirely: the file is read with the browser’s FileReader API, parsed in the page’s memory, and never posted anywhere, because there is no endpoint for this tool at all. Once the page has loaded it works with the network cable unplugged, and the only download is the profile export you ask for.

The limits are there to keep the browser responsive: files up to 1 MB, 100,000 rows and 2,000,000 cells. A file past that is split and profiled in parts, which is usually the right move anyway — a 500 MB export is rarely one clean table. The profile itself exports as a CSV report with a UTF-8 BOM, so it opens correctly in Excel, and the summary line — rows, columns, delimiter, duplicates — is the one to paste into the ticket or the message when the import fails and someone asks what the file actually contained.

Profile yours with the companion tool

The CSV Data Profiler runs the whole check described here. Paste CSV text or drop a .csv file, and it sniffs the delimiter across comma, semicolon, tab and pipe, detects the header row (with a toggle to override), infers one type per column and computes the full profile — empty and distinct counts with percentages, top 5 values, numeric min/max/mean/median/sample standard deviation, text length statistics, date ranges, exact duplicate rows and a preview of the first 8 rows. It sits alongside the SQLite Inspector: profile the CSV first, then inspect the SQLite database you import it into.

What the profile does not do matters as much as what it does. It does not clean your data, and it does not guess what a column means: a column of 2026-11-03 values is a date, but the profiler cannot tell whether it is an order date or a ship date — that comes from the header name and your knowledge of the file. It does not join files, deduplicate rows for you, or validate values against a schema, because there is no schema to validate against, only the file itself. Treat the profile as the first look, not a clean bill of health.

The demo file, trimmed

customer,product,quantity,unit_price,order_date,paid
Alice Chen,Wireless Mouse,2,24.99,2026-11-03,true
Bob Li,USB-C Hub,1,39.50,2026-11-04,true
Alice Chen,Keyboard,1,59.00,2026-11-05,false
Carol Wang,"Monitor, 27"" 4K",1,299.00,2026-11-06,true

Sources

Frequently asked questions

My file has 100,000 rows — can I still profile it in the browser?

Yes, up to the caps: 1 MB, 100,000 rows and 2,000,000 cells. The profile is computed in the page, so a large file takes a moment but never leaves the machine. Past the caps, split the file and profile the parts — a 500 MB export is rarely one clean table, and the per-part profiles usually show where the shape changes.

Why does the profiler call a column "mixed"?

Because no single type reaches the 80% threshold: the column holds more than one kind of value, for example mostly numbers with a few “N/A” strings, or dates written in two different formats. Look at the top values — they show exactly which values break the pattern, and usually the fix is to clean those rows rather than to change the rule.

My spreadsheet opens the file fine — why does the import fail?

A spreadsheet guesses the file’s dialect silently and hides the guess; a database importer applies a fixed dialect and fails on the first row that breaks it. The usual culprits are a semicolon delimiter read as commas, a BOM the importer does not strip, a quoted comma, or an embedded newline. Profile first: the detected delimiter and the column shapes tell you which one it is before you touch the importer’s settings.