Skip to content
MyToolkit.pro

Text & Lists

Add Prefix and Suffix

Wrap every line of your list with text. Add a prefix at the start, a suffix at the end, or both. Optionally skip empty lines. Your text stays in this browser.

Private by design: no text is uploaded or stored.

Private by design: no text is uploaded or stored.

Result — options

Try an example

Result

Updates when you apply or change an option.

Lines affected
0

How does adding a prefix and suffix work?

The prefix is added to the beginning of each line and the suffix to the end. Leave a field empty to skip it. Turn on “Skip empty lines” to leave blank lines untouched — they are also excluded from the lines-affected count. Text is inserted literally, so characters like <, > or & appear exactly as typed and are never treated as markup.

How to add text to the start and end of each line

  1. Paste your list into Lines to modify, one item per line. You can also load a .txt or .csv file with Load from file, drop a file on the box, or pick one of the samples under Try an example.
  2. Type the text that should go before each line into the Prefix field. Leave it empty if you only need a suffix.
  3. Type the text that should go after each line into the Suffix field. Leave it empty if you only need a prefix.
  4. If your list has blank lines that should stay blank, tick Skip empty lines.
  5. The result updates as you type. Check the Lines affected counter, then press Copy result, or save the output as a file with Download result.

Both fields are inserted exactly as you type them, including spaces. To get - item and not -item, type the space after the dash in the prefix.

Examples: quoting, checklists and SQL statements

Quote each item for a code array (prefix ", suffix ",):

apple
banana
cherry
"apple",
"banana",
"cherry",

The last line keeps its trailing comma as well, because the suffix goes on every line. Delete it by hand if your language does not allow trailing commas.

Turn a to-do list into a Markdown task list (prefix - [ ] , no suffix):

- [ ] Buy milk
- [ ] Call the bank
- [ ] Water plants

Build one statement per ID (prefix SELECT * FROM t WHERE id = , suffix ;):

SELECT * FROM t WHERE id = 42;
SELECT * FROM t WHERE id = 17;
SELECT * FROM t WHERE id = 99;

Wrap lines in HTML list items (prefix <li>, suffix </li>). Add the surrounding <ul> and </ul> yourself:

<li>a</li>
<li>b</li>

Where adding a prefix or suffix saves time

  • Turning a single column copied from a spreadsheet into quoted values for a SQL IN (...) clause or a JavaScript or Python array. Copy one column only. Several columns arrive as tab-separated rows, and the prefix and suffix then wrap the whole row, not each cell.
  • Making full URLs from a list of paths by adding https://example.com/ as the prefix, for example before a bulk redirect or a crawl.
  • Commenting out a block of config lines by adding # or // at the start of each one.
  • Adding a file extension such as .jpg or .csv to a list of base file names for a rename script.
  • Turning plain lines into Markdown bullets or blockquotes (> ) before you paste them into a document.
  • Adding the same label, tag or category column to every row, for example ,pending as a suffix on CSV lines.

If you want the quoted items on one line, for example "a", "b", "c", add the quotes here and then use Join lines to join the lines with a separator of your choice. For numbered lines, Line Numberer adds sequential numbers, which a fixed prefix cannot do.

Blank lines, spacing and other details

  • What counts as a line: every line break in the input starts a new line. Windows (CRLF) and old Mac (CR) line breaks are converted to plain line feeds, so the copied result always uses LF.
  • Blank lines: with the checkbox off, an empty line still gets the prefix and suffix, so * alone on a line is a common surprise. A list copied from a spreadsheet usually ends with a line break, so with quoting the last line comes out as an empty "",. Tick Skip empty lines or delete the final break. With the option on, lines that are empty or hold only spaces or tabs come out unchanged and are not counted.
  • Existing spaces are kept: the tool does not trim your lines. x with brackets as the prefix and suffix becomes [ x ]. To clean up spacing first, run the list through Whitespace Normalizer.
  • No placeholders, counters or regular expressions; nothing already in your lines is replaced.
  • Size: you can paste or type up to 1,000,000 characters. A text file loaded with Load from file or dropped on the box can be up to 2 MB. Everything is processed on your device, so very large lists depend on your browser's speed.

Frequently asked questions

How do I wrap each line in single quotes for a SQL IN list?

Use a single quote as both the prefix and the suffix, so 42 becomes '42'. Then paste the result into Join lines and choose Comma + space (, ) to get '42', '17', '99', ready to put inside IN (...).

Can I add text to the beginning of each line in Excel or Google Sheets instead?

Yes, a formula such as ="prefix"&A1&"suffix" filled down a column does the same thing. Pasting the column here is quicker for a one-off list and needs no helper column.

Can I add a prefix only to some lines?

Not in this tool, because the prefix and suffix go on every line that isn't skipped. In Find and Replace, turn on Use regular expression and Match case, put (.*TODO.*) in Find and - $1 in Replace with. That adds "- " only to the lines that contain TODO; without Match case, lines with todo or Todo are changed too.

How do I remove a prefix from each line?

Use Find and Replace with Use regular expression on: put (^|\n)# in Find (with the space after #) and $1 in Replace with. This removes "# " only where it starts a line and leaves a # in the middle of a line alone.

Can I add a line break or tab as a prefix or suffix?

The Prefix and Suffix fields are single-line inputs, so you cannot type a line break into them. A tab character pasted into a field is kept and inserted like any other character.

All in Text & Lists

Line Numberer

Add line numbers to any list or text. Choose a starting number, separator, zero padding and skip blank lines. Works entirely in your browser.

Text & Lists In your browser

Lines, words & characters counter

Count lines, words, Unicode characters, UTF-8 bytes, paragraphs and reading time locally in your browser.

Text & Lists In your browser

Duplicate line remover

Remove duplicate lines from any list, with optional case-insensitive and whitespace-trimmed matching. Works entirely in your browser.

Text & Lists In your browser

Random Picker

Pick one or more random items from a list, with or without replacement. Private, fair selection entirely in your browser.

Text & Lists In your browser

Sort lines

Sort lines alphabetically, numerically, in natural order or by length. Reverse, ignore case and remove duplicates. Works entirely in your browser.

Text & Lists In your browser

List randomizer

Shuffle the order of any list randomly with an unbiased Fisher-Yates shuffle. Works entirely in your browser.

Text & Lists In your browser

What do you need?

Swipe up for the next one