List ↔ line
Turn a list (one item per line) into a single text with separators, quotes and brackets, ready for an SQL query, a JSON array, a CSV file or a command, and back. With one-click presets and escaping done right.
Your data stays on your computer. Files are processed in your browser and are never uploaded.
0 characters
Result
Type or paste something to see the result.
How to use it
- Pick the direction: list to line or line to list, then paste the text.
- List to line: choose a preset (SQL, JSON, CSV…) or set separator, quotes, prefix and suffix by hand.
- Set the cleaning: spaces, empty items, duplicates, order, case. The number of items obtained is always shown.
- Copy or download the result, or use "Swap direction" to take it as the new starting text.
Frequently asked questions
How are quotes inside items protected?
It depends on the preset. SQL and CSV double the quote (O'Brien becomes 'O''Brien'); JSON uses JSON sequences (\", \\, \n); JavaScript and Python add a backslash; the command line uses shell single quotes and closes and reopens the quote for each inner quote.
Why do numbers sometimes have no quotes?
With "No quotes around numbers" (on in the SQL and JSON presets) items that are real numbers (12, -3.5, 2e5) stay unquoted. Codes such as 007 or 1,5 remain text and are quoted, so they keep their leading zeros.
Line to list: does a comma inside quotes split the item?
No. An item in quotes ("a,b" or 'a,b') stays whole, and two quotes in a row inside quotes ("") mean one quote. An unclosed quote, or one in the middle of a word (l'albero), stays plain text. For JSON and JavaScript turn on "Interpret backslash sequences".
How does the automatic separator work?
It tries tab, semicolon, pipe and comma (outside quotes) in that order, then space: the first one that really splits the text wins. If it is not what you want, pick it by hand.
Can I use the SQL preset to build queries with other people's data?
It is meant for pasting a list of values into a query you write yourself, such as an IN (…). It does not replace parameterised queries: for code running in an application always use your database's parameters.
Are there any limits?
The text can be up to 2 MB. Lists of hundreds of thousands of items convert in a moment.
Privacy
Everything happens in your browser: the text is not sent or saved.