Text
Add Prefix / Suffix to Lines
Paste one item per line, then add text around each line, join them with a separator, or pick a preset such as SQL IN or JSON array.
Your own text before and after each line; {n} = line number
Numbers are used where you type {n} in the prefix or suffix, e.g. {n}. . Pad 3 gives 001, 002, 003.
Processed on your device and remembered in this browser only — nothing is sent anywhere.
Works in your browser. No account needed.
Frequently asked questions
How do I turn a list into comma-separated values?
Paste the list, keep the Prefix / suffix format with both boxes empty, and choose Join into one line with the Comma + space separator. The lines red, green and blue become red, green, blue. Choose Comma for red,green,blue with no spaces. Semicolon, tab, pipe and a custom separator such as " OR " are also available.
How do I make a SQL IN list with quotes?
Choose SQL IN (…). Each item is wrapped in single quotes and any single quote inside a value is doubled, which is standard SQL escaping, so O'Brien becomes 'O''Brien'. With Join into one line you get ('a', 'b', 'c'). With One per line you get the same list across several lines. Paste it after WHERE column IN. There is no trailing comma. Backslashes are left as they are. MySQL and MariaDB treat a backslash as an escape character by default, so tick "Also escape \ as \\ (MySQL)" if your values contain backslashes.
Is the JSON, Python and JavaScript output escaped correctly?
Yes. The JSON array uses the browser's own JSON encoder, so double quotes, backslashes and control characters are escaped and the result parses back to exactly your lines. The Python list and JavaScript array use single-quoted strings with \ and ' escaped and control characters written as \t or \x01. Accented letters, CJK text and emoji are kept as they are, which is valid in all three.
How do I number each line or pad the numbers with zeros?
Choose Numbered lines to get 1. apple, 2. banana and so on. Set Start number, Step and Pad to digits: pad 3 turns 1, 2, 3 into 001, 002, 003, and a step of -1 counts down. With the Prefix / suffix format, type {n} where the number should go, for example "{n}) " or "item-{n}: ", and the same start, step and padding apply.
What do the trim, empty-line and duplicate options do?
Trim spaces removes spaces and tabs from the start and end of each line. Skip empty lines drops blank lines, including lines that contain only spaces, and it is on by default. Turn it off if you want blank lines wrapped like any other line. Remove duplicates keeps only the first copy of each line and keeps the original order. The check is case-sensitive and runs after trimming. A single line break at the end of your paste never counts as an extra line.
Is my text uploaded anywhere?
No. Everything runs in your browser. Your input and settings are saved in this browser's local storage so they are still there when you come back. Very large inputs (over 200,000 characters) are not saved. Click Clear to empty the input.
About this tool
This tool changes a list, one item per line, in three ways. It can add the same text before and after every line, join all lines into one line with a separator you choose, or turn the list into a ready-to-paste snippet for SQL, JSON, Python, JavaScript, CSV, HTML or Markdown. That saves editing hundreds of rows by hand or writing a spreadsheet formula like ="'"&A1&"',". The result updates as you type.
Worked example. Input, one per line: apple, O'Brien, banana, an empty line, banana. With Remove duplicates ticked and Skip empty lines on, there are 5 input lines and 3 items. SQL IN (…) with Join into one line gives ('apple', 'O''Brien', 'banana'). JSON array gives ["apple", "O'Brien", "banana"]. Prefix / suffix with Join into one line and Comma + space gives apple, O'Brien, banana. Numbered lines with pad 2 gives 01. apple, 02. O'Brien, 03. banana.
The presets escape values so the output still works when an item contains quotes or backslashes. SQL doubles single quotes. Quoted CSV doubles double quotes, so say "hi" becomes "say ""hi""". JSON uses standard JSON escaping. Python and JavaScript escape backslashes and single quotes. The HTML list escapes &, <, >, " and ', so a line like <b> shows as text instead of becoming a tag. The Prefix / suffix format adds your text exactly as typed and escapes nothing. Use it for bullets, comment markers, file extensions, URL prefixes or your own quoting.
Numbered lines and the {n} placeholder share the start, step and zero-padding settings, so you can make 001-style IDs or count down. The Join into one line layout also works with quoted CSV, where you choose the separator, and with the SQL, JSON, Python, JavaScript and HTML presets, which then fit on one line. Markdown bullets and numbered lines are always one per line. Everything is processed in your browser and nothing is uploaded.