Remove Empty Rows and Columns

Blank rows and dead columns come out, everything else stays exactly where it was. You decide what blank means, from truly empty to placeholders like NA and NULL, and whether a column has to be 100% empty to go. Every column removed is named in the report. It runs in your browser, so nothing is uploaded.

Want to see how empty each column is first? The profiler counts the blanks.

Where the emptiness comes from

Empty rows and columns are not usually a mistake. They are the residue of how the file was made. A spreadsheet remembers the largest rectangle anyone ever touched, so a stray click in column AB puts twenty-six columns of nothing into the export. A report generator writes a spacer row between sections because it was designed to be printed. A CRM export includes every field in the schema, and most organizations use maybe a third of them, so the rest arrive as columns of pure blank. Somebody deletes the contents of a block of rows without deleting the rows.

None of that hurts while the file is being looked at. It hurts when the file is loaded: a dataframe with forty columns you have to scroll past to find the four you want, a chart tool offering a dropdown full of dead fields, a schema inference step that types every empty column as text and then argues with the next file that has values in it.

Compacting is a small operation with one genuine risk attached, which is removing something that mattered. That is why the report on this page names every column it took.

Worked example: a regional report with holes in it

Six data rows, two of them completely blank, and two columns nobody ever filled in:

region,q1,q2,q3,legacy_code,notes
East,120,,140,,
,,,,,
West,200,185,,,
North,,,,,
,,,,,
South,90,95,100,,

Every control on its default: Remove set to Empty rows and columns, blank means only spaces, and a column has to be entirely blank to go.

region,q1,q2,q3
East,120,,140
West,200,185,
North,,,
South,90,95,100

With this above it:

4 rows in · 4 rows out · 0 empty rows removed
2 columns removed of 6 · whitespace-only cells count as blank

Dropped 2 rows with no values in any cell.
Columns removed: legacy_code (100% blank), notes (100% blank).

Read that carefully, because it says something slightly odd and the oddness is honest. The tool reports zero empty rows removed even though the input clearly had two. They were already gone: rows with no values in any cell are dropped when the file is read, before this page's logic runs, and the separate line above says so. The row work here is a safety net for files that arrive by other routes, not the main event.

The North row survives, correctly, because region holds a value even though every quarter is missing. And the two columns that went are named with their blank percentage, so you can decide in a glance whether legacy_code was something a downstream job expects to find.

Blank is a decision, not a fact

Ask a program whether a cell is empty and it compares the string to nothing. Ask a person and they mean something wider. Both are right, so the definition is a control rather than an assumption.

  • It holds nothing at all is the literal reading: zero characters. Use it when a space might be meaningful, which happens in fixed-width extracts and in a few scientific formats.
  • It holds only spaces also treats a cell of spaces or tabs as empty. This is the default, because a cell holding a single space looks empty to everyone who reads the file and is invisible until it breaks a comparison.
  • It holds NA, NULL, - or similar adds the strings systems write when they mean nothing: na, n/a, n.a., null, nil, none, nan, -, --, ?, #n/a, #null!, (blank), (none) and undefined. Case is ignored and surrounding spaces are trimmed before the comparison.

The placeholder list is worth one caution. A single hyphen is on it, and there are files where - is a real category code rather than a missing value. Check what the tool is about to remove before you trust that setting on an unfamiliar file, which is what the named report is for.

The threshold, and what it costs you

A column does not have to be completely empty to be useless. The one where a field was added last spring and filled in eleven times contributes nothing to a report and everything to the width of the table. Drop a column when lets you say so: Every cell is blank, 90% or more are blank, or Half or more are blank.

The cost is exact and it is not hidden. At 90%, a column with nine hundred blanks and a hundred real values goes, and those hundred values go with it. So a warning appears whenever the threshold is below 100%, saying in plain terms that real values were removed and pointing at the list. On the example file above, loosening it to Half or more are blank takes q2 and q3 as well, both reported at 50% blank, which leaves a two-column table that is tidy and much less useful.

A sensible way to work is to run the file at 100% first, look at the percentages in the report, and only then decide whether a looser threshold is buying you anything.

Practical notes

  • A row survives if any one cell has a value. There is no threshold for rows, only for columns, because a partially filled row is a real record with gaps and a partially filled column is a design decision.
  • The last column is never removed. If every column would qualify, none are, and the report says nothing was taken. An empty download helps nobody.
  • Blank percentages are measured after the row pass. Rows removed as empty are not counted against a column's blank share, which is what you want: a column should be judged on the rows that survive.
  • Row order and cell contents are untouched. Surviving values are written back exactly as they were read, so a leading zero, a currency symbol or an odd date format all come through unchanged.
  • Unnamed columns need their own switch. Blank header cells become column_4 when the file is read; turning Unnamed columns to Drop them too removes those that hold at least some blanks, which is the fastest way to clear the phantom columns to the right of a spreadsheet export.
  • The download is a new file. regions.csv comes back as regions-compacted.csv.

Frequently Asked Questions

I ran it and nothing was removed. Why?

Most likely because the file arrived clean. Rows with no values in any cell are dropped when the file is read, before this tool sees them, and you are told how many went. So a spreadsheet export whose only problem was trailing blank rows is already fixed by the time the table appears. Loosen the blank rule to catch placeholders such as NA if you think there is more to remove.

What counts as a blank cell?

That is your choice, and it is the most important control on the page. It holds nothing at all is the strictest. It holds only spaces also catches a cell with a space or a tab in it, which is the default. It holds NA, NULL, - or similar adds the placeholder strings a system writes when it means nothing: na, n/a, n.a., null, nil, none, nan, -, --, ?, #n/a, #null!, (blank), (none) and undefined, compared without regard to case.

Why would I drop a column that is only 90% blank?

Because a field somebody added and populated four times out of nine thousand is noise rather than data, and it makes every wide table harder to read. Setting a threshold under 100% does remove real values along with the blanks, so a warning appears whenever you use one, and every removed column is listed by name with the percentage that was blank.

How do I know which columns were removed?

They are named in a list above the result, each with the share of blanks that got it removed. This is deliberate rather than decorative. Dropping a column silently is exactly how a scheduled job starts failing on a missing field weeks later, so the report is always shown and always complete.

Can it delete my entire file?

No. If every column in the file would qualify for removal, none of them are removed and the report says nothing was taken out. A download containing zero columns is never a useful answer, so that case is caught explicitly.

Can I remove only the rows, or only the columns?

Yes. Remove offers Empty rows and columns, Empty rows only, or Empty columns only. Rows only is useful when a wide sparse table is legitimate and you just want the gaps out. Columns only is useful when the row count has to stay exactly as it is for a reconciliation.

What does Unnamed columns do?

A header cell that was blank in the file is given a name like column_4 when the file is read, so the column can be referred to at all. Switch Unnamed columns to Drop them too and any of those that hold at least some blanks are removed, which clears out the phantom columns a spreadsheet adds to the right of the real data. It is off by default, because a nameless column occasionally holds real values.

Does the file leave my browser?

No. The counting and the filtering happen in JavaScript in your own tab, and there is no upload endpoint. Row order is preserved, surviving values are written back byte for byte, and the download is named after your file with -compacted on the end.

Nothing removed without saying so

Free, no account, no upload. Set what blank means, read the list, take the CSV.

Back to the compactor