User Rating 0.0 β˜…β˜…β˜…β˜…β˜…
Total Usage 0 times
Drop CSV file here or click to browse Max 100 MB • .csv, .tsv, .txt
or paste CSV text
Excludes header
Is this tool helpful?

Your feedback helps us improve.

β˜… β˜… β˜… β˜… β˜…

About

Working with large CSV datasets often means handling files with thousands of rows and dozens of columns when only a subset is needed. Feeding an oversized file into a pipeline that expects 500 rows or 10 columns causes memory overflows, slow imports, and silent data corruption in downstream tools. This truncator parses your CSV with a finite-state machine that correctly handles RFC 4180 edge cases: quoted fields containing delimiters, escaped double-quotes, and multi-line cell values. You control three independent axes of truncation: row count (keep first n rows), column selection (keep or drop by index), and cell-level character limits. The tool processes everything client-side; no data leaves your browser.

Limitations: the parser assumes consistent column counts across rows. If your source file uses mixed delimiters or non-UTF-8 encoding without BOM, auto-detection may fail. In that case, set the delimiter and encoding manually. Files above 100 MB are rejected to prevent browser tab crashes. For datasets that large, consider a CLI tool like csvkit or awk.

csv truncator csv cutter csv row limit csv column remover csv trimmer csv editor csv tool truncate csv online

Formulas

Truncation operates on three independent axes applied sequentially:

Row Truncation: Rout = min(Rtotal, nmax)

Column Truncation: Cout = { ci | i ∈ Sselected }

Cell Truncation: cellout = cell[0 : min(len(cell), Lmax)]

Where Rtotal is the number of data rows (excluding header), nmax is the user-specified row limit, Sselected is the set of selected column indices, and Lmax is the maximum character count per cell. The parser uses a four-state FSM: FIELD_START β†’ IN_UNQUOTED or IN_QUOTED β†’ QUOTE_IN_QUOTED (for escaped quotes) β†’ back to FIELD_START on delimiter or newline.

Reference Data

ParameterDefaultRange / OptionsNotes
Delimiter, (comma), ; \t | customAuto-detected from first 5 lines
Quote Character"" 'RFC 4180 standard uses double-quote
Max RowsAll1 - 1,000,000Excludes header row if β€œhas header” is on
Column SelectionAllCheckbox per columnSelect which columns to keep
Cell Character LimitNone1 - 10,000Truncates individual cell content with ellipsis
Header RowYesYes / NoFirst row preserved separately from count
EncodingUTF-8UTF-8, ISO-8859-1, Windows-1252BOM auto-detected
Line EndingLFLF, CRLF, CROutput normalized to chosen format
Max File Size - 100 MBBrowser memory constraint
Empty Row HandlingKeepKeep / RemoveRows where all cells are empty
Whitespace TrimmingOffOn / OffTrims leading/trailing spaces per cell
Output FormatCSVCSV / TSVChanges output delimiter accordingly

Frequently Asked Questions

The parser uses a finite-state machine compliant with RFC 4180. When it encounters an opening double-quote at the start of a field, it enters the IN_QUOTED state. In this state, commas, newlines, and other delimiters are treated as literal characters inside the cell. A field ends only when a closing quote is followed by a delimiter or end-of-line. Escaped quotes (two consecutive double-quotes) are collapsed into a single quote character.
No. When the "Has Header Row" toggle is enabled, the header is preserved separately and is not counted toward the row limit. For example, setting a limit of 100 rows on a file with a header produces an output of 101 lines total: 1 header + 100 data rows.
The cell text is sliced to the specified length and an ellipsis character (…) is appended. If the truncation point falls inside a multi-byte UTF-8 character, the cut is moved backward to the nearest valid character boundary to prevent encoding corruption.
Yes. The tool reads the first 5 lines of the input and counts occurrences of common delimiters: comma, semicolon, tab, and pipe. The character with the most consistent count across lines is selected. If counts are ambiguous (e.g., a file uses both commas inside quoted fields and as delimiters), the auto-detection may choose incorrectly. In that case, set the delimiter manually.
Browser tabs typically have a memory ceiling of 1 - 4 GB depending on the browser and OS. Parsing a CSV requires holding the raw text, the parsed array structure, and the output string simultaneously, which roughly triples memory usage. A 100 MB file can consume 300 - 500 MB of RAM during processing. The limit prevents tab crashes.
Empty row removal is applied before the row limit. If your file has 1000 rows with 200 empty rows and you set a limit of 500, the tool first strips the 200 empty rows (leaving 800) then takes the first 500 of those.