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 Never doubles up
Free Online Prefix and Suffix Adder For Lines Of Text
Share this tool
Advertisement Slot (Top Banner) Google AdSense Unit • Responsive Banner
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
Sponsored Content (Below Tool) Google AdSense Placement

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 is one of those jobs that sounds like it needs no tool at all, right up to the point where the list is four hundred lines long. The spreadsheet approach works, but it wants a helper column, a formula, a paste back, and it quietly leaves blank rows looking like real ones.

The useful behaviour here is the part that refuses to work. A line that already carries the prefix is left untouched, so you can run the tool over a list somebody has been halfway through editing and the half that is done stays done. Without that, the second pass gives you a double prefix on every line that was already correct, and spotting those by eye in four hundred lines is not realistic.

The line number token covers the common case where a prefix and numbering are the same job. Building file names, numbering a checklist, or generating identifiers all want a counter inside a fixed pattern, and doing it in two passes with two tools means the numbering is wrong the moment a line is inserted.

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.
Advertisement Slot (Bottom Banner) Google AdSense Unit • Responsive Banner