Skip to main content
WizTools123
Free Online Tools

Tool Categories


Text Tools New Tool

Free Online Prefix and Suffix Adder For Lines Of Text

Put the same text in front of every line, behind every line, or both, entirely in your browser. Blank lines are left alone, text that is already there is not added twice, and a line number can be inserted where you want it. The same page removes a prefix or suffix that is already on the lines.

Free Forever Nothing Uploaded Add or Remove Line Number Token
Free Online Prefix and Suffix Adder For Lines Of Text
Share this tool
Line Prefix and Suffix Everything happens in this tab. Nothing you paste is sent anywhere.
Your lines
0 characters 0 words 0 lines
Result
0 characters 0 lines
What to do
The text
Rules
The last line
Line number

Write {n} anywhere in the text above and it becomes the line number. {nn} and {nnn} pad it with zeros to two or three digits.

Removing

0 lines 0 changed 0 left alone 0 blank

Buy Us A Coffee

Enjoying WizTools123? Help keep our server infrastructure 100% free and open for everyone.

Buy Us A Coffee

How to Use Line Prefix and Suffix

Step by step, start to finish.

1
Paste your lines

One item per line. A .txt file can be dropped onto the box instead of pasting.

2
Type what goes in front, behind, or both

Either box can be left empty. A domain in front and a comma behind is the usual pair for building a list.

3
Decide about blanks and repeats

Blank lines are skipped by default, and a line that already has the text is left as it is, so running the tool twice changes nothing.

4
Copy, or switch to remove

The counters show how many lines changed. Switch the first menu to remove to take the same text off again.

Key Features

What this tool does, and what it does not do.

Front, behind or both

One pass wraps every line the same way, with either box left empty if you only need one side.

No doubling up

A line that already has the text is left alone, so running it again on a half finished list is safe.

Line numbers built in

The {n} token becomes the line number, with padded forms for file names that have to sort properly.

Removes as well

The same page strips a prefix or suffix again, with options for letter case and repeats.

The last line choice

Leave the trailing comma off the final line, which is what most lists and most data formats want.

Nothing is uploaded

Lists of addresses, file names and customer records stay in this tab.

About Line Prefix and Suffix

Putting the same text in front of every line sounds too simple to need a tool, until the list is four hundred lines long. A spreadsheet can do it with a helper column and a formula, but then you paste it back, and blank rows end up looking like real entries. This page wraps every line in one pass: type what goes in front, what goes behind, or both, and copy the result.

Typical jobs

  • Turn a list of paths into full addresses by putting https://example.com/ in front.
  • Wrap each value in quotes and add a comma behind, ready to paste into code or a SQL IN (...) list.
  • Add - or * to make a Markdown bullet list.
  • Add a file extension such as .jpg to a list of names.

Safe to run twice

Skip a line that already has it is on by default. A line that already starts with your prefix, or already ends with your suffix, keeps exactly what it has, so you can run the tool over a list someone was halfway through editing and the finished half stays correct. The left alone counter shows how many lines were skipped this way, so a second pass is easy to check even on hundreds of lines.

Line numbers inside the pattern

Write {n} anywhere in either box and it becomes the line number. {nn} and {nnn} pad it with zeros to two or three digits, and you can choose the starting number. A front box of photo-{nnn}- gives photo-001-, photo-002- and so on, which is how file names and identifiers usually need to look, with the counter and the fixed text built in one pass.

The details that matter in data

The last line setting can leave the behind text off the final line, which is what you want for a comma separated list where a trailing comma would be an error. Blank lines are skipped unless you include them, and Trim each line before adding removes stray spaces first so the prefix sits right against the text.

Switch the first menu to remove it to take a prefix or suffix off again, with options to ignore letter case and to remove repeats. All of it runs in your browser tab, so address lists and customer records stay on your computer.

Frequently Asked Questions

Common questions about this tool.

Put a comma in the behind box and set "The last line" to leave the behind text off it. That is the shape most lists and most data formats want, because a trailing comma on the final item is often an error.

Yes. Write {n} in the front box where you want the number, for example "{n}. " for a plain numbered list. Use {nn} or {nnn} to pad with zeros, and set the starting number if it should not begin at one.

Either they were blank, which is skipped by default, or they already began or ended with the text you are adding. The counters show how many were left alone so you can tell which it was.

Switch on "Ignore letter case when matching". The text is then matched regardless of capitals, which is useful for protocols and file extensions written inconsistently.

In remove mode, switch on removing it more than once. Without that, only one is taken off, which is safer when the text could legitimately appear again inside the line.

More Text Tools

Other tools from the same hub, free and in your browser.

All Text Tools

Feedback

No feedback on this tool yet. Yours would be the first.