᠎᠎᠎          
51K

List item trimmer

World's simplest list tool

This is a super simple browser-based application that trims items in a list. It can remove unnecessary spaces, tabs, and line breaks from the left and/or right side of each item. It works with simple lists that use a single item separator symbol and also complex lists that use multi-symbol patterns as item separators. Created by list geeks from team Browserling.
More tools! gif tools
We just created Online GIF Tools with dozens of utilities for editing GIFs. Check it out!
Separator for the Input List
A specific symbol is used to separate input items.
A multi-character pattern is that can be matched with a regex is used to separate input items.
Specify the character or regex that separates list items here.
Separator for the Output List
Specify a character, multiple characters, or a short string that will separate output list items.
Trimming Side
Remove whitespaces from the left side of list items.
Remove whitespaces from the right side of list items.
List item trimmer tool What is a list item trimmer?
With this utility, you can clean up excess whitespaces that surround list items. You can trim list items from both the left and right side (or optionally, just from one side). The trimming method does not affect printable characters and whitespaces in the middle of items. It only removes invisible leading and trailing spaces, tabs, and newlines. By default, the program separates the list items via a specific character, which is usually a comma, a semicolon, or a dash (you can change this input separator character in the options). If the input list uses several different separator characters or a changing multi-character pattern between the items, then you can switch to the regular expression separator mode. In this case, you can enter a regular expression in the same field as a specific character and the regexp will find these more complicated separators. After removing whitespaces, the program returns a cleaned list of the same items. The new items can have a new separator format that you can specify in the options. Listabulous!
List item trimmer examples Click to use
List of Leap Years
In this example, we apply the trimming algorithm on a list of 21st century leap years. To match the input list format, we select the "Character Split Mode" and enter a slash symbol in the item delimiter field. The list is in a dirty state and many of the items are surrounded by spaces, tabs, and even newlines on both sides. To clean it up and trim list elements, we enable pre- and post-trim options. The pre-trim option (also known as left-trim) cleans the beginning of each item and the post-trim (also known as right-trim) option cleans the end of each item. For the trimmed output list, we enter a pipe character in the output delimiter field and get a super clean pipe-separated list of leap years.
2004 / 2008 / 2012 / 2016 / 2020 / 2024 / 2028 / 2032 / 2036 / 2040 / 2044 / 2048 / 2052 / 2056 / 2060 / 2064 / 2068 / 2072 / 2076 / 2080 / 2084 / 2088 / 2092 / 2096
2004|2008|2012|2016|2020|2024|2028|2032|2036|2040|2044|2048|2052|2056|2060|2064|2068|2072|2076|2080|2084|2088|2092|2096
Required options
These options will be used automatically if you select this example.
A specific symbol is used to separate input items.
Specify the character or regex that separates list items here.
Specify a character, multiple characters, or a short string that will separate output list items.
Remove whitespaces from the left side of list items.
Remove whitespaces from the right side of list items.
List of Chemical Elements
This example loads Mendeleev's periodic table of chemical elements as the input. Unfortunately, the elements are chaotically surrounded by trailing whitespaces, which makes the table ugly and unusable for scientific publishing. What's worse, sometimes there are commas between the elements, sometimes semicolons, and sometimes dots. To catch all these delimiters, we switch to the "Regexp Delimiter Mode" and set the regular expression equal to "/[,;.]/". Once elements are found, we remove spaces from the right side of the elements and create a new element table that's separated by commas.
H , He ; Li, Be ; B , C , N , O , F, Ne ; Na , Mg . Al, Si, P, S, Cl, Ar , K, Ca , Sc , Ti, V, Cr , Mn , Fe ; Co , Ni, Cu , Zn , Ga , Ge ; As, Se ; Br , Kr , Rb , Sr , Y, Zr , Nb , Mo , Tc , Ru , Rh , Pd , Ag . Cd , In , Sn , Sb , Te ; I, Xe ; Cs, Ba , La , Ce ; Pr , Nd , Pm , Sm , Eu , Gd , Tb , Dy, Ho , Er , Tm , Yb , Lu , Hf, Ta , W, Re ; Os, Ir , Pt, Au , Hg . Tl, Pb , Bi, Po , At, Rn , Fr , Ra , Ac , Th , Pa , U , Np, Pu , Am , Cm , Bk, Cf, Es, Fm , Md , No , Lr , Rf, Db , Sg . Bh , Hs, Mt
H, He, Li, Be, B, C, N, O, F, Ne, Na, Mg, Al, Si, P, S, Cl, Ar, K, Ca, Sc, Ti, V, Cr, Mn, Fe, Co, Ni, Cu, Zn, Ga, Ge, As, Se, Br, Kr, Rb, Sr, Y, Zr, Nb, Mo, Tc, Ru, Rh, Pd, Ag, Cd, In, Sn, Sb, Te, I, Xe, Cs, Ba, La, Ce, Pr, Nd, Pm, Sm, Eu, Gd, Tb, Dy, Ho, Er, Tm, Yb, Lu, Hf, Ta, W, Re, Os, Ir, Pt, Au, Hg, Tl, Pb, Bi, Po, At, Rn, Fr, Ra, Ac, Th, Pa, U, Np, Pu, Am, Cm, Bk, Cf, Es, Fm, Md, No, Lr, Rf, Db, Sg, Bh, Hs, Mt
Required options
These options will be used automatically if you select this example.
A multi-character pattern is that can be matched with a regex is used to separate input items.
Specify the character or regex that separates list items here.
Specify a character, multiple characters, or a short string that will separate output list items.
Remove whitespaces from the left side of list items.
Remove whitespaces from the right side of list items.
Pro tips Master online list tools
You can pass input to this tool via ?input query argument and it will automatically compute output. Here's how to type it in your browser's address bar. Click to try!
https://onlinelisttools.com/trim-list-items?input=%0A2004%09%2F%202008%20%20%2F%202012%09%2F%202016%20%20%2F%0A%202020%20%2F%202024%09%2F%202028%20%20%2F%202032%09%2F%202036%20%20%2F%202040%20%2F%202044%09%2F%202048%20%20%2F%202052%09%2F%202056%0A%20%20%0A%20%20%0A%20%20%2F%202060%20%2F%202064%09%2F%202068%20%20%2F%202072%09%2F%202076%20%20%2F%202080%20%2F%202084%09%2F%202088%20%20%2F%202092%09%2F%202096%0A%0A&string-separator=true&input-separator=%2F&output-separator=%7C&left-trim=true&right-trim=true
All list tools
Didn't find the tool you were looking for? Let us know what tool we are missing and we'll build it!
Quickly print all distinct items of a list.
Quickly print all repeating items of a list.
Quickly count the number of items in a list.
Quickly display list items in multiple colors.
Quickly generate a list of arbitrary length with arbitrary items.
Quickly generate a random length list with random items.
Quickly find certain items in a list.
Quickly replace certain items in a list with new items.
Quickly remove items from a list that match a pattern.
Quickly print all list items in reverse order.
Quickly sort list items alphabetically or numerically.
Quickly shuffle list items and make it random.
Quickly randomly pick one or more items from a list.
Quickly create a downloadable image from a list.
Quickly set a new delimiter for items in a list.
Quickly remove the symbol that separates list items.
Quickly change list item delimiters to the same symbol.
Quickly remove items from the beginning or end of a list.
Quickly join all items of a list together.
Quickly create groups of multiple list items.
Quickly extract a part of a list.
Quickly remove all empty items from a list.
Quickly remove whitespace characters around list items.
Quickly create multiple copies of a list.
Quickly rotate list items to the left or right (or up and down).
Quickly enumerate list items and add a counter to them.
Quickly add bullet markers to all items in a list.
Quickly remove all bullet markers from list items.
Quickly wrap all list items in quotes.
Quickly remove all quotation marks from around list items.
Quickly add text on the left and right sides of all list items.
Quickly remove text from the left and right sides of all list items.
Quickly prepend a prefix before each list item.
Quickly delete any prefix from the beginning of all list items.
Quickly append a suffix after each list item.
Quickly delete any suffix from the end of all list items.
Quickly add or remove list items to make it a certain length.
Quickly create multiple columns from a single list.
Quickly create a palindromic list from the given list.
Quickly add new items at the beginning or end of a list.
Quickly left-pad a list with one or more items.
Quickly right-pad a list with one or more items.
Quickly remove items that repeat in a list.
Quickly apply a filter on all list items (extract certain items).
Quickly analyze a list and print its item statistics.
Coming soon These list tools are on the way
Edit a List
View and edit lists in a neat browser-based list editor.
Split a List
Split list items into chunks.
Generate the Powerlist
Create the powerlist of the given list.
Find the Car of a List
Extract the first item from a list.
Find the Cdr of a List
Extract all items except the first of a list.
Apply a Function on a List
Run a JavaScript function on every list item.
Find Certain List Items
Quickly find and print items that interest you in a list.
Find Repeating List Items
Quickly find and print items that repeat in a list.
Delete Unique List Items
Quickly find and remove items that are unique in a list.
Extract a Sublist from a List
Given start and stop indexes, extract a sublist from a list.
Shift List Items
Shift list items to the left or right (or up and down).
Indent List Items
Add indentation to all list items.
Mirror a List
Quickly create a mirror copy of a list.
Invert a List
Invert the order of items in a list (last becomes first, etc).
Reduce a List
Run the reduce function on a list.
Convert a List to Rows
Create multiple rows from a single list.
Convert a List to Excel
Create an Excel file from a list.
Convert a List to PDF
Create a PDF file from a list.
Convert a Text List to a LaTeX List
Create a LaTeX list from a regular text list.
Convert a Text List to a HTML List
Create a HTML list from a regular text list.
Convert a Text List to a Markdown List
Create a Markdown list from a regular text list.
Compare Two Lists
Find the difference between two lists.
Compare Three Lists
Find the difference between three lists.
Remove One List from Another
Remove elements from a list that appear in the other list.
Zip Two Lists
Join two lists together item by item.
Merge Two Lists
Append a second list at the end of the first list.
Pair List Items
Create pairs from all list items.
Pop List Items
Remove list items at certain index positions.
Push List Items
Add new items at the end of a list.
Splice a List
Modify a list in-place by adding, replacing, or removing items.
Flatten a List
Remove all indentation levels from a list and make it flat.
Make List Items Title Case
Quickly change the letter case of all items to title case.
Make List Items Proper Case
Quickly change the letter case of all items to proper case.
Make List Items Random Case
Quickly randomly change the letter case of all items.
Make List Items Lowercase
Quickly change the letter case of all items to small letters.
Make List Items Uppercase
Quickly change the letter case of all items to capital letters.
Remove List Item Counter
Quickly remove any numeration from a list of items.
Create the Empty List
Generate a list with no items.
Visualize a List
Quickly create a graphical representation of a list.
Create a List Cloud
Create an image with a cloud of list items.
Create a Spiral List
Create an image with list items going in a spiral.
Base64-encode a List
Convert any list to base64 encoding.
Base64-decode a List
Convert any list from base64 encoding back to a list.
Let Zalgo Destroy a List
Let Zalgo loose on a list and create list-chaos.