EditSafely

Compress a List

Trim items, drop empty ones and join them with no spaces.

Runs on your device, nothing uploaded

Join with
Try:

0 chars · 0 lines

Output

Trim items, drop empty ones and join them with no spaces.

Type or paste above to see the result here.

Example: Compress a list

What you paste never leaves this tab

Compress a List is JavaScript that your browser has already downloaded, and it does the whole job on your own machine. On a normal site, the text you paste is sent to a server that can log it, cache it or keep it. Here it is read and transformed inside this tab and nowhere else.

  • No upload
  • No length limit
  • Works offline once loaded
  • Nothing stored or logged

How to use Compress a List

  1. 1. Paste your list. Put the list into the input pane, including any stray blank lines or extra spacing around items that you want cleaned up and condensed.
  2. 2. Pick what to join with. Tap a comma, semicolon, pipe or (nothing) in Join with, or type your own. Turn on Remove duplicates under More options to keep each item once. The summary shows how many characters you saved.
  3. 3. Copy the compressed list. Copy the result, with whitespace trimmed, blank lines removed, and items joined by your separator into one condensed line.

When to use Compress a List

Compress a List trims whitespace, drops blank lines, and joins every item onto a single line with a separator you choose. Reach for Compress a List whenever a sprawling, loosely formatted list needs to become a compact, single-line value.

  • Turning a messy pasted list into a CSV cell value. You copied a list with inconsistent spacing and blank lines and need it as one comma-separated value for a spreadsheet cell. Compress it with a comma separator.
  • Preparing a compact value for a URL parameter. A multi-line list needs to fit into a single query string value. Compress it into one line joined by commas before appending it to the URL.
  • Cleaning up a list copied from a PDF or web page. Text copied from a PDF often brings extra blank lines and inconsistent spacing along with it. Compress the list to strip the mess and get a clean single line.
  • Shrinking a list for a compact log entry. You want to log a list of values as a single line in a log file rather than several lines. Compress the list with your chosen separator before writing the log entry.

Examples

Compress a list

Input

  apple  

banana
 cherry

Output

apple,banana,cherry

About the Compress a List tool

Compress a List does its work locally, right in the browser. Trim items, drop empty ones and join them with no spaces. There is no upload step, no queue and no account, and your data never travels over the network.

It belongs to the List Tools collection on EditSafely, a set of 114 small, focused List utilities that share the same instant, private workspace.

You can shape the output with 2 settings, including Join with and Remove duplicates, and the result refreshes the moment you change one. A worked example further down the page shows exactly what the tool produces for a real input.

Running locally also makes the tool fast and dependable: results appear as soon as your input does, there is no server outage that can take it down mid-task, and confidential data can be processed without a second thought.

Frequently asked questions

Does Compress a List cost anything?

Yes, it is completely free. All 2,943 tools on EditSafely work without an account, a subscription or usage limits.

Is it safe to paste sensitive or confidential data?

No data leaves your device. The whole tool is JavaScript that runs inside your browser tab, so there is no upload, no server-side processing and no log of what you did. If you disconnect from the internet after the page loads, it keeps working.

How much text can I process at once?

There is no fixed limit; your device's memory is the ceiling. Up to 10 MB the result updates as you type, after a short pause that grows with the size. Above 10 MB a Run button appears so typing stays smooth, and files open up to 50 MB. A very long result shows its first 2,000 lines on screen, while Copy and Download always include all of it.

Do I need to sign up or install anything?

Nothing to install and no account needed. Open the page in any up-to-date browser, including on a phone or tablet, and the tool is ready.

How do I use the result?

The output panel has a one-click copy button, and you can keep refining the input while you work; the result updates in place as you type.

Related tools

All List Tools →