Truncate a List

Truncate your list to a fixed number of items using the Truncate a List Tool. Limit the result from the start or end of the list. Includes live preview, file import, export, and copy features.

Paste your input above or import a file below.
No file chosen
Supported file types: .txt, .csv, .tsv, .log, .json, .xml, .md, .ini, .yaml, .yml, .html, .htm, .css
Total items: 0
Options
Truncate from start

How to Use:

  1. Paste or import a list into the input box.
  2. Set the maximum number of items to keep.
  3. Enable Truncate from start to keep the first N items, or leave off to keep the last N.
  4. View the updated output immediately.
  5. Copy or export the result as needed.

What Truncate a List Tool Can Do:

  • Limits the number of items in a list based on a numeric value.
  • Optionally truncates from the start or end.
  • Works with pasted or imported text.
  • Live preview, output counter, and export options are included.

Example:

Input:

Apple
Banana
Cherry
Date
Elderberry
Fig
Grape

Max Items: 3 Output (from end):

Elderberry
Fig
Grape

Output (from start):

Apple
Banana
Cherry

Common Use Cases:

Ideal for shortening long datasets, selecting top or recent items, previewing trimmed results, or cleaning up imported lists. Great for writers, data processors, and developers.

Useful Tools & Suggestions:

If you’re trimming a list down, Change the Length of a List gives you more flexibility to either cut or expand to a specific size. And if you’re cleaning things up before or after the cut, Trim List Items helps make sure everything that’s left is neat and tidy. It’s a fast way to reduce clutter, limit output, or prep a list for display when space is tight.