Trim List Items
Trim whitespace, tabs, and newlines from the left and/or right side of each item in a list with customizable delimiters and instant browser-side processing
What Is a List Item Trimmer?
The Trim List Items tool lets you clean up whitespace around each item in a list. Whether you have extra spaces, tabs, or newlines before or after your list items, this tool removes them instantly. You can choose to trim from the left side, right side, or both, and you can split your list by a specific character or a regular expression pattern.
Specify how your input list is separated using a literal character or a regex pattern, then choose whether to left-trim, right-trim, or both. The trimmed items are joined back together using your chosen output separator.
How to Trim List Items
- Paste or type your list into the Input List text area.
- Choose a Separator Mode — use Literal for a fixed character or Regex for a pattern.
- Enter the Input Separator that currently divides your items (e.g.,
\nfor newlines). - Set the Output Separator for the trimmed result.
- Toggle Left-trim items and Right-trim items as needed.
- The trimmed list appears instantly in the output area.
Common Use Cases
- Clean up messy data copied from spreadsheets or documents with inconsistent spacing.
- Normalize list items before further processing, such as sorting or filtering.
- Remove leading or trailing whitespace from items imported from CSV or TSV files.
- Prepare clean data for database imports or API payloads.
Frequently Asked Questions
What does "Left-trim" do?
Left-trim removes all whitespace characters (spaces, tabs, newlines) from the beginning of each list item. For example, " Hello" becomes "Hello".
What does "Right-trim" do?
Right-trim removes all whitespace characters from the end of each list item. For example, "Hello " becomes "Hello".
Can I use a regular expression as a separator?
Yes. Switch the mode to Separate by Regex and enter a valid regex pattern. For example, \s+ will split on any whitespace, and [,;|] will split on commas, semicolons, or pipes.
Does trimming affect the content of my items?
No. Trimming only removes invisible whitespace characters from the start and end of each item. It does not modify any printable characters or whitespace in the middle of items.
Is my list data sent to a server?
No. Everything happens entirely in your browser using JavaScript. Your list data is never sent to any server, ensuring complete privacy and security.
Related tools
Your recent visits