csvkit.org
CSV (Comma-Separated Values) utilities, in the browser
Say hi →

Fill Blank Cells in a CSV

constant · zero · fill down · fill up · column mean or median

Replace empty cells with something usable. Fill down to repeat a value that only appears on the first row of each group — the classic shape of a spreadsheet export with merged cells — or drop in a constant like N/A, a zero for a numeric column, or the column's own mean or median.

fill
Or drop a .csv file here, or
ready

How to fill blanks

  1. Paste the CSV or drop a file.
  2. Choose the scope: one column, or every column at once.
  3. Pick a fill method. For a constant, type it in the value box.
  4. Check the count in the status line — it tells you how many cells were actually filled — then copy or download.

Fill down: the merged-cell fix

Exports from spreadsheets often look like this, because the region was a merged cell covering three rows:

region,month,amount
North,jan,120
,feb,95
,mar,140
South,jan,80

Every tool that groups or joins treats those blanks as a real (empty) value, so grouping by region gives you a phantom group. Fill down copies the last non-empty value into the gaps and the file becomes properly tabular. Fill up does the same in reverse, for exports where the label sits on the last row of each block.

Mean and median: use with care

Filling a numeric column with its mean keeps row counts intact for tools that can't handle nulls, but it is imputation, not data — it shrinks the variance and pulls correlations toward zero. Median is safer when the column is skewed or has outliers. If the blanks mean "not measured" rather than "zero", consider keeping them blank and fixing the consumer instead; Data profile shows you how much of the column is actually missing before you decide.

FAQ

Does it overwrite cells that already have values?

Never. Only blank cells change, and the status line counts exactly how many.

What counts as blank?

An empty cell always. With the whitespace option on (the default), a cell containing only spaces or tabs counts too. Placeholders like N/A or - are real values — swap them for blanks first with Find & replace if you want them filled.

Why is my mean fill empty?

Because nothing in the column parsed as a number. Clean currency symbols and thousands separators first, or fill with a constant instead.

Is anything uploaded?

No — it runs in your browser.

Privacy

100% client-side. No upload. See the privacy policy.