Your country

Tools that support it use your country for local currency, number formats, units and paper size. Your choice is saved only in this browser.

Type a name or a two-letter code. Use the up and down arrow keys to move through the countries, Enter to choose one and Escape to close.

Trim Lines

Cut, shorten or split every line of a list in one step, with a before-and-after view.

Free preview, no sign-upIncluded in your pass Pro tool Pro pass: ₹179 / $5.99 for 30 days On this device: nothing is sent
+3 +1 more details No uploadWorks offline once opened Text

Free preview: every count, with the first words of the result (up to 100) and the first rows of the before-and-after table. Locked until you unlock it: download and copy.

Pro pass ₹179 for 30 days or ₹79 for 1 week, one‑time. Pro pass $5.99 for 30 days or $2.99 for 1 week, one‑time. How to unlock

Try before you buy.

  • Free preview: every count, with the first words of the result (up to 100) and the first rows of the before-and-after table.
  • Locked until you unlock it: download and copy.
  • Unlock: Pro pass, ₹179 for 30 days or ₹79 for 1 week, a one-time payment unless you choose automatic renewal. Unlock: Pro pass, $5.99 for 30 days or $2.99 for 1 week, a one-time payment unless you choose automatic renewal.

Ways to unlock shows how to get the full result.

See passes (opens in a new tab)

Printing this result is locked in the free preview.

Every line is trimmed the same way. Nothing leaves your device.

How to trim each line

Characters to strip

Each character you type is stripped.

From

Keep
Use the

1 is the first field; −1 is the last, −2 the one before it.

Next steps Done. What next?

Start over

A Pro pass unlocks the full result. See passes

All text tools

About the Trim Lines

Paste a list and trim every line the same way in one step. Remove a fixed number of characters from the start or end (item codes, file extensions), shorten long lines to a maximum length with an ellipsis, strip quotes, commas or other characters from the ends, or keep only the text before or after a delimiter — or one field of a comma-, tab- or space-separated line.

The Before and after table shows the lines with the removed text struck through, so you can check the result before you use it. Characters are counted the way you see them: an emoji or an accented letter is one character. Windows line endings are kept. For general clean-ups such as double spaces and blank lines, use the Whitespace Remover.

Without a pass you see a free preview: every count, with the first words of the result and the first rows of the before-and-after table. A Pro pass unlocks every line, with Copy, Download and Use as input.

How to use it

  1. Paste your lines, or use Open file (or drop a file on the box) for a .txt, .csv or .log file.
  2. Choose how to trim each line, for example Remove the first characters or Keep one field (column).
  3. Set the options that appear: the number of characters, the maximum length, the characters to strip or the delimiter and field.
  4. Check Before and after — removed text is struck through. Without a pass, the result and the table show a free preview of the first part; with a pass, or after unlocking this result, copy or download the result, or press Use as input to apply a second trim.

Examples

Remove an item code from the start of each line (first 7 characters)
Input
ID-001 Apple
ID-002 Pear
ID-003 Mango
Result
Apple
Pear
Mango
Shorten titles to 20 characters with an ellipsis, at a space
Input
How to brew better coffee at home
Short title
Result
How to brew better…
Short title
Keep the user name of e-mail addresses (text before “@”)
Input
asha@example.com
vikram.iyer@example.in
Result
asha
vikram.iyer

Choose Keep text before or after a delimiter, delimiter Other… and type @.

Keep the second field of comma-separated lines
Input
"Asha Rao", Pune, 2024
"Vikram Iyer", Chennai, 2023
Result
Pune
Chennai

Common uses

  • Removing line numbers, codes, prefixes or file extensions from exported lists.
  • Shortening product names, titles or log lines to a length limit.
  • Unquoting values copied from code, CSV files or spreadsheets.
  • Pulling one column out of comma-, tab- or space-separated data without a spreadsheet.

What each option does

  • Remove the first / last characters — removes N characters from every line; shorter lines become empty.
  • Cut to a maximum length — lines longer than the limit are cut. The ending (… or ...) counts towards the limit unless you untick it, and Cut at a space avoids splitting a word when there is a space before the limit.
  • Strip characters from the ends — removes spaces and tabs, quotes, commas, full stops, semicolons and any other characters you type, from the start, the end or both. Tick At most one character from each end to remove a single pair of quotes and keep the rest.
  • Keep text before or after a delimiter — splits each line at the first or last delimiter and keeps one side.
  • Keep one field — splits each line at every delimiter and keeps field N (1 is the first, −1 the last).

For the last two, choose what happens to lines without the delimiter: keep them, make them empty or remove them.

How characters and lines are counted

A character is what you see as one symbol: an emoji with a skin tone, a flag or an accented letter typed as two code points all count as one, so they are never cut in half. Each line is trimmed on its own; the line breaks between lines are kept exactly as they were, including Windows (CRLF) endings in opened files.

Limitations

  • Fields are split at every delimiter, including delimiters inside quoted values such as "Mumbai, India". Use the CSV to JSON Converter for CSV files with quoted commas.
  • Wide characters (Chinese, Japanese) count as one character each, so a maximum length is not a display width.
  • The before-and-after table shows the first 200 lines (the free preview its first rows); with a pass, the result always includes every line.

Privacy

On this device: nothing is sent

Everything happens in your browser. What you enter or open here is not uploaded or stored by MySmartCoPilot.

How to check that nothing is uploaded

Frequently asked questions

What do I get without a pass?

Without a pass, Trim Lines shows every count, with the first words of the result (up to 100) and the first rows of the before-and-after table. Until you unlock it, the result can’t be downloaded or copied. A Pro, Premium or Ultimate pass, a one-time payment unless you choose automatic renewal, unlocks the full result. The pricing page lists the passes and their prices.

How do I remove the first 3 characters of every line?

Choose Remove the first characters and enter 3. Lines with 3 characters or fewer become empty.

How do I remove everything after a comma?

Choose Keep text before or after a delimiter, delimiter Comma, keep Text before, and the First delimiter. Lines without a comma are kept unchanged unless you choose to empty or remove them.

How do I shorten lines without cutting words in half?

Choose Cut to a maximum length and tick Cut at a space, not inside a word. If a single word is longer than the limit, it is cut at the limit.

Is this the same as removing extra spaces?

Stripping spaces here removes them only at the ends of lines. To collapse double spaces, remove blank lines or convert tabs, use the Whitespace Remover.

Is my text uploaded?

No. Every line is trimmed in your browser, and nothing you paste or open is sent anywhere.

Quick answers and tool search

Type to search tools or to get a quick answer, for example 18% of 2500. Use the up and down arrow keys to move through the results, Enter to choose, and Escape to close.