tsvkit.org
TSV Toolkit
Sample data Say hi →

Truncate TSV Columns

cap every cell at N characters · optional ellipsis

Shorten long cell values to a maximum length. Two uses: making a wide file readable in a terminal or a viewer, and fitting data into a destination with a hard column limit — a varchar(255), an API field cap, a legacy import that rejects anything longer. Truncation is lossy by definition, so it belongs at the display or load boundary rather than in your source file.

truncate
Drop a .tsv file here, or
ready

How to use

  1. Paste or drop the file.
  2. Set the maximum cell length in characters.
  3. Tick ellipsis to mark truncated values with , so the cut is visible rather than silent.
  4. Copy or download.

Use the ellipsis

Without a marker, a truncated value is indistinguishable from a short one — nothing in the file records that it was cut, and anyone reading it later will treat it as complete. That's how a truncated description ends up quoted as though it were the whole thing. The ellipsis costs one character and makes the loss self-documenting. The exception is loading into a fixed-width destination, where the marker itself may not fit or may not be wanted.

If the goal is only to make a file readable, consider the ASCII table or aligned text columns instead — both have a max-cell-width option that affects the display without rewriting your data.

Character counts and length limits

Counting is by character, not by byte. That's the right unit for a display width but the wrong one for a byte-limited destination: a UTF-8 accented character is two bytes and an emoji can be four, so 255 characters of non-ASCII text can exceed a 255-byte column. Databases differ — Postgres varchar(n) counts characters, some other systems count bytes. When it matters, truncate well short of the limit.

FAQ

Is the header truncated too?

Yes, every cell including row one. If a long header name matters, rename it first with header tools so you control the shortened form.

Does it cut on a word boundary?

No — at exactly N characters, mid-word if that's where it falls. Word-aware truncation would make the maximum length approximate, which defeats the purpose when you're fitting a hard limit.

Can I truncate only one column?

Not here; it's file-wide. For one column, find and replace in regex mode with a pattern like ^(.{50}).*$ replaced by $1.

Does the ellipsis count toward the limit?

It's appended after the cut, so a truncated cell can be one character longer than the maximum. Set the limit one lower if the cap is absolute.

Privacy

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