Productive Toolbox

Add Prefix and Suffix to Lines

Add text to the start or end of every line, number a list, or turn lines into Markdown bullets, checklists, quoted CSV values or HTML list items.

3 lines
3 lines
- apples - bananas - cherries

Examples

Markdown Bullet List

Prefix: -
Output:
- Apple
- Banana
- Cherry

Numbered List

Numbering: Enabled (1.)
Output:
1. Apple
2. Banana
3. Cherry

Checklist

Prefix: [ ]
Output:
[ ] Apple
[ ] Banana
[ ] Cherry

CSV Format

Suffix: ,
Output:
Apple,
Banana,
Cherry,

Formatting a List Line by Line

Lists copied from a spreadsheet column, an email or a text file usually need the same few characters added to every line before they can be used somewhere else: a dash for a Markdown list, quotes and commas for code, or tags for HTML. Doing it by hand is slow and easy to get wrong on line 47 of 80.

result = prefix + [number] + line + suffix

Numbering is added after the prefix, so a prefix of Step with numbering and a colon gives Step 1: Preheat the oven. Blank lines are left untouched and are not counted.

Prefix and Suffix Recipes

To getPrefixSuffixResult
Markdown bullet list- โ€“- apples - bananas
Markdown checklist- [ ] โ€“- [ ] apples - [ ] bananas
JSON or Python array items"", (no comma on last line)"apples", "bananas"
SQL IN (...) values'', (no comma on last line)'apples', 'bananas'
HTML list items<li></li><li>apples</li> <li>bananas</li>
Email or chat quote> โ€“> apples > bananas
Code comments// โ€“// apples // bananas
Hashtags#โ€“#apples #bananas
Full URLs from pathshttps://example.com/โ€“https://example.com/apples https://example.com/bananas

How to Add a Prefix or Suffix to Every Line

  1. 1Paste your list: Paste one item per line, from a spreadsheet column, a document or a text file; Windows and Mac line breaks both work.
  2. 2Choose a template or type your own: Pick Markdown bullet, numbered list, checklist, quote, code comment, CSV, quoted list or HTML <li>, or type any prefix and suffix yourself.
  3. 3Fine-tune the list: Turn on numbering with a start number and separator, remove empty lines, trim spaces, and drop the trailing comma from the last line.
  4. 4Copy the result: The formatted list updates as you type; copy it or download it as a TXT file.

Frequently Asked Questions

How do I add quotes and commas to each line?

Choose the "Quoted", list template. It wraps every line in double quotes and adds a comma, leaving the comma off the last line: apples, bananas and cherries become "apples", "bananas", "cherries", ready to paste into a JSON array, a Python list or a SQL IN (...) clause. For SQL, which uses single quotes, type ' as the prefix and ', as the suffix.

How do I number every line of a list?

Tick Enable numbering or pick the Numbered List template. You can start from any number and choose 1. 1) 1- or 1: as the style. Empty lines are skipped, so the numbers stay in sequence.

Can I add a prefix to lines in Excel or Google Sheets instead?

Yes, with a formula: ="- "&A1 in Excel or Google Sheets adds a prefix, and =A1&"," adds a suffix; then fill the formula down. This tool is quicker for a one-off list and keeps line breaks and blank lines as they are.

What happens to blank lines?

They are kept blank, without a prefix, suffix or number, so a list split into groups keeps its layout. Tick Remove empty lines to drop them altogether.

How do I make a Markdown checklist?

Use the Checklist template, which starts every line with - [ ] . GitHub, GitLab, Obsidian and many other Markdown editors show these as tick boxes; change [ ] to [x] to mark an item done.

Is my list uploaded anywhere?

No. We do not collect or store what you enter.