Free online text tool

Prefix Suffix

Prefix Suffix adds text to the beginning and the end of every line. Paste your lines, type a prefix and a suffix and copy the result. It is free and runs in your browser.

Prefix/Suffix Tool

0Character Count
0Character Count (without spaces)
0Word Count
0Sentence Count
0Paragraph Count
0Line Count

Prefix/Suffix Example

Before (prefix (" suffix "))
Hello
After
("Hello")

Bookmark: press Ctrl+D (Windows) or Cmd+D (Mac) to save this tool.

Suggest a New ToolProvide Feedback on This Tool

What does Prefix Suffix do?

This tool adds a prefix to the beginning and a suffix to the end of every line. A prefix is the text that goes before each line and a suffix is the text that goes after it.

Type exactly what you want in the two boxes, spaces included. You can use only a prefix, only a suffix, or both. Empty lines are skipped by default, and you can turn that off. The words in your lines are not changed.

Use it to wrap each line in quotes or brackets, to add HTML tags, bullets or commas, or to add a domain or a file extension to a list.

Prefix suffix examples

Each example shows the prefix and suffix used. Skip empty lines is on unless the example says it is off.

SettingBeforePrefix and suffixAfter
Prefix and suffix
Hello
Prefix: ("
Suffix: ")
("Hello")
Bullet list
apples
bananas
cherries
Prefix: - 
- apples
- bananas
- cherries
Quotes and comma
red
green
blue
Prefix: "
Suffix: ",
"red",
"green",
"blue",
HTML list items
Home
About
Contact
Prefix: <li>
Suffix: </li>
<li>Home</li>
<li>About</li>
<li>Contact</li>
Empty lines skipped (default)
a

b
Prefix: [
Suffix: ]
[a]

[b]
Empty lines kept
a

b
Prefix: [
Suffix: ]
[a]
[]
[b]
Suffix only
one
two
Suffix: !
one!
two!

How to add a prefix and suffix to each line

  1. 1
    Add your lines
    Type or paste your lines into the box, or import a text file.
  2. 2
    Enter the prefix and suffix
    Type the text for the start of each line in Prefix and the text for the end in Suffix. You can leave one empty.
  3. 3
    Click Add Prefix/Suffix
    Every line gets the prefix and suffix at once. Use Undo if you change your mind.
  4. 4
    Copy it
    Click Copy and paste the lines where you need them.

When to add a prefix and suffix

Good for

Wrapping lines in quotes, brackets or HTML tags, adding bullets or comment marks, adding a comma at the end of each line and building lists for code, spreadsheets or a database.

Check first

The prefix and suffix are used exactly as you type them, so add a space yourself if you want a gap. A line that only has spaces counts as empty when Skip empty lines is on. Use Undo right after if the result is not what you wanted.

Other tools

To add text to the middle of a line, try Specified Position Text Addition. To take a prefix and suffix off again, try Remove Prefix and Suffix.

Prefix suffix FAQ

What does the Prefix Suffix tool do?

It adds text to the beginning and the end of every line. The text you type in Prefix goes at the start of each line and the text in Suffix goes at the end.

How do I add a prefix and suffix to each line?

Type or paste your lines, enter the prefix and the suffix, and click Add Prefix/Suffix. The new lines replace the text in the box. Click Copy to use them, or Undo to go back.

Can I add only a prefix or only a suffix?

Yes. Leave the other box empty and only the box you filled is used.

What happens to empty lines?

By default empty lines are skipped, so they stay empty and do not get a prefix or suffix. Untick Skip empty lines if you want the prefix and suffix added to them too.

Are spaces kept?

Yes. Whatever you type in Prefix and Suffix is used exactly, including spaces, so type a space at the end of the prefix if you want a gap after it. The text of your lines is not changed.

What can I use it for?

Wrapping lines in quotes, brackets or HTML tags, adding bullets or comments, adding a comma after each line, or adding a domain or a file extension to a list of names.

Does it work on a long list?

Yes. It works on any number of lines at once, and the line count above the box shows how many lines you have.

Is this tool free and is my text private?

Yes. It is free, needs no account and runs in your browser, so your text is not uploaded to a server.

Looking for more text tools?

Browse Modify Tools

Last updated: 31 October 2026