usefmtly

Add or Remove Prefix & Suffix from Lines

Add / Remove Prefix & Suffix — Free online tool to add or remove a prefix and suffix from every line of text at once. Perfect for bulk editing lists, code, markdown, CSV, and more.

Prefix
Suffix
0Input lines
0Modified
0Skipped
0Output lines
Input
Output

How to add or remove prefix and suffix

  1. Choose a modeAdd to prepend/append text to every line, or Remove to strip matching text from the start or end of lines.
  2. Enter your prefix and/or suffix in the toolbar fields. You can fill one or both — they are applied simultaneously.
  3. Paste your text. Changes appear instantly. Toggle Skip blank lines to leave empty lines untouched.
  4. Copy the output using the copy button at the top of the output panel.

Common uses

Convert plain lines into a markdown list

Add "- " as a prefix to turn a plain list into a valid markdown bullet list in one click.

Add quotes around every line

Add '"' as both prefix and suffix to wrap every line in double quotes — handy for SQL IN clauses or JSON arrays.

Strip list markers

Remove "- " or "• " prefix to clean up bullet lists copied from documents into plain text.

Add line terminators

Add ";" as a suffix to turn a block of SQL column names into valid statements, or add "," for JSON values.

Wrap lines in HTML tags

Add "<li>" as prefix and "</li>" as suffix to convert a plain list into HTML list items.

Remove file extensions

In Remove mode, add ".txt" or ".csv" as suffix to strip file extensions from a list of filenames.

Add vs. Remove mode

Add mode always modifies every non-blank line, regardless of what it already contains. The prefix or suffix is appended unconditionally — useful for bulk-applying a consistent format.

Remove mode only modifies lines that actually start with the given prefix or end with the given suffix. Lines that don't match pass through untouched. The Unchanged stat in the counter shows you exactly how many lines were not affected — useful for spotting inconsistencies in your data.

Related tools: Remove Empty Lines to clean up blank lines first, Alphabetical Sorter to sort your list after editing, or Line Counter to verify line counts.

Frequently Asked Questions

How do I add text to the beginning of every line?

Make sure the mode is set to "Add", type your prefix in the Prefix field, and paste your text. The prefix is added to the start of every non-blank line instantly.

How do I remove a prefix from every line?

Switch to "Remove" mode, enter the prefix you want to strip, and paste your text. The tool removes the prefix from every line that starts with it. Lines that don't match are left unchanged.

Can I add both a prefix and a suffix at the same time?

Yes. Fill in both the Prefix and Suffix fields and both are applied simultaneously. In Remove mode, both are stripped from matching lines.

What does "Skip blank lines" do?

When enabled, blank lines pass through untouched — no prefix or suffix is added to them. This keeps paragraph spacing clean when working with prose or structured text.

What happens in Remove mode when a line does not match?

Lines that do not start with the given prefix (or end with the given suffix) are passed through unchanged. The "Unchanged" count in the stat strip tells you how many lines were not modified.

Related Tools