Multi-line and Array convert
Multi-line and Array convert tool helps you convert between multi-line text and array formats.
All tools on this site run entirely in your browser locally. No data is uploaded to any server.
Features:
- Lines to Array: Convert multi-line text to array format (e.g. [1,2,3])
- Array to Lines: Convert array format to multi-line text
- Add Quotes: When converting, you can select whether to add quotes to each item
Example:
- Lines to Array: 1↵2↵3 → [1,2,3]
- Lines to Array (with single quotes): apple↵banana → ['apple','banana']
- Array to Lines: [1,2,3] → 1↵2↵3
How to use
- Type or paste multi-line text into the editor, or drag and drop a local file (.txt, .csv, .json).
- Click Lines to Array to wrap each line into an array element. Tick Add Quotes and pick single or double quotes if needed.
- Click Array to Lines to split a
[ ]array back into one element per line. - Use Copy to copy the result, or the download icon to save it as a .txt file.
FAQ
- Q: What if my values already contain quotes?
A: The tool wraps each line as-is, so any inner quote will still be there. Either escape it first (e.g. change'to\') or pick the opposite quote style from the dropdown. - Q: What array formats does "Array to Lines" accept?
A: Standard JSON arrays ([1, 2, 3]), Python lists, or any comma-separated values with or without spaces. Elements can be numbers or quoted strings. - Q: Does it handle Windows line endings (\r\n)?
A: Yes. The tool splits on any line break (\r\n or \n) and silently ignores trailing blank lines.