Skip to content
← Utility Tools

CSV Row Filter

Pick the rows you want, drop the rest — entirely in your browser

CSV Row Filter (Predicate-Based Row Selection)

Filtering rows of a CSV is the most common follow-up to opening one. Show me the rows where the status is open, or where the price is over 100, or where the email column matches a regex. Excel does it with AutoFilter and Google Sheets does it with FILTER formulas, but both require opening the file in a spreadsheet app first. This tool runs the same filters without leaving the browser, supports multiple predicates combined with AND or OR, and downloads the result as a new CSV with the original header.

How Predicates Work

A predicate is a single rule against a single column: status equals open, price greater-than 100, email contains @anthropic.com. Each predicate has a column picker, an operator picker, and a value field. The available operators depend on the inferred column type: text columns get equals, not-equals, contains, does-not-contain, starts-with, ends-with, matches-regex; numeric columns get greater-than, less-than, between (with two values), and the equality operators. The is-empty operator works on any column. Multiple predicates are combined either all-must-match (AND) or any-must-match (OR), set as a global switch.

Use Cases for Quick Filtering

Customer-list segmentation: pull only the rows where the signup date is in the last 30 days. Sales-list pruning: keep rows where the deal stage is closed-won and the amount is over a threshold. Email-list cleanup: drop rows where the email column does not contain an at-sign. Log-file analysis: keep rows where the response code starts with 5. Survey-result slicing: extract only respondents in a specific region. The tool is fast enough that interactive trial-and-error is realistic — add a predicate, see the row count update, refine.

Regex Support and Safety

The matches-regex operator accepts a JavaScript regular expression (the same flavor browsers run natively). The expression is wrapped in new RegExp(value), with a safe-execute pattern that catches catastrophic-backtrack patterns by timing out after 100 milliseconds per row. Common regex use cases: extract rows where a column matches an email format, a UUID pattern, an internal SKU code, or a date format you do not want to depend on auto-parsing. The flags input lets you set i for case-insensitive, m for multiline.

Why Filter in the Browser Instead of in Excel

Excel's AutoFilter and Google Sheets' FILTER are good. They are also tied to opening the file in a heavyweight app, applying filters as a view (not as a transformed file), and remembering to copy-paste the filtered range out. The browser approach is one-click: filter, get a real CSV file back, ready to feed into the next pipeline step. It also avoids the Excel-specific bugs where leading zeros disappear, large integer IDs lose precision, and date columns get reformatted in unwanted ways. For one-shot filtering with a clear predicate in mind, this is the faster path.

Common follow-ups: CSV Cleaner to dedupe and normalize the filtered subset, CSV to SQL to load the subset into a database, CSV to Markdown Table if the filtered rows are headed for documentation, and JSON ↔ CSV Converter if the next step needs JSON instead of CSV.

Frequently Asked Questions

Is the CSV uploaded during filtering?+
No. The file is parsed by PapaParse 5.4 in your browser, filtered in memory, and the matched rows are offered as a download. Nothing is uploaded. The Network tab confirms zero requests during the filter operation.
Which operators are supported?+
Text columns: equals, not-equals, contains, does-not-contain, starts-with, ends-with, matches-regex, is-empty. Numeric columns: equals, not-equals, greater-than, less-than, greater-or-equal, less-or-equal, between, is-empty. The is-empty operator works on any column.
Can I combine multiple predicates?+
Yes. Add as many predicates as you need. A global switch sets the combination logic: AND (all predicates must match) or OR (any predicate must match). For more complex expressions (mixed AND/OR), apply predicates in two passes — filter once, then re-filter the result.
How does regex matching work?+
The matches-regex operator wraps your input in JavaScript's new RegExp(value, flags) and tests each cell. Flags can include i for case-insensitive and m for multiline. Invalid regex syntax shows an inline error rather than silently matching nothing. Each row's regex match runs with a 100-millisecond timeout to catch catastrophic backtracking.
Does the column-type inference affect available operators?+
Yes. Columns whose values are all numeric show greater-than, less-than, and between in addition to the text operators. Mixed-type columns (numeric values plus some text) fall back to text operators only, since numeric comparisons would not be meaningful. You can force a column to be treated as text or numeric in the options.
Are the column comparisons case-sensitive?+
Text equality (equals, not-equals) is case-sensitive by default. Contains and starts-with are also case-sensitive. The matches-regex operator can be made case-insensitive with the i flag. A future option may add a global case-insensitive toggle for the text operators — for now, the regex flag is the workaround.
What is the maximum file size?+
There is no hard cap because filtering runs entirely in your browser memory. Files up to a few hundred megabytes work without issue on a modern laptop. Very large files (multi-gigabyte) may stall a single tab; in those cases split the file first, filter each piece, and concatenate the results.
Can I keep the original column order in the output?+
Yes. The output CSV has the same columns as the input, in the same order, with the original header row. Only the row set changes — columns are not added, removed, or reordered. Use CSV Cleaner if you need to drop or reorder columns after filtering.

Built by Derek Giordano · Part of Ultimate Design Tools

Privacy Policy · Terms of Service