All Over Tools logo
Tool Combiner
Analyze Tools Clean Tools Compare Tools Convert Tools Data Validation Extract Tools Format Tools Generate Tools Organize Tools Transform Tools
Audio Tools Font Tools Image Tools Subtitle Tools Video Tools
Archive Tools Document Tools Ebook Tools File Management Tools PDF Tools Presentation Tools
Config Tools Database Tools Dataset Tools JSON Tools Parser Tools Spreadsheet Tools XML Tools
Business Calculators Construction Calculators Date And Time Calculators Education Calculators Financial Calculators Food Calculators Health Calculators Math Calculators Science Calculators Sports Calculators Statistics Calculators
Blog About Us Contact Us

Add Prefix & Suffix

Add custom text before and after every line in your text.

How to add a prefix and suffix to lines

The tool works one line at a time. It splits Input text at each newline, puts the value from Prefix at the start of each line, and puts the value from Suffix at the end. Select Skip empty lines when lines made only of spaces or other whitespace should stay as entered.

How to add text before and after each line

  1. Enter or paste your lines in Input text.
  2. Enter the text to add before each line in Prefix.
  3. Enter the text to add after each line in Suffix.
  4. Select Skip empty lines when blank or whitespace-only lines should stay unchanged.
  5. Review Formatted output, then choose Copy when the result is ready.

What Prefix and Suffix add to each line

The complete Prefix value goes before the original line, and the complete Suffix value goes after it. The line text stays as entered, including spaces. Both fields are treated as literal text.

Input text:
apple
banana
cherry

Prefix: '
Suffix: ',

Formatted output:
'apple',
'banana',
'cherry',

Entering <li> and </li> writes those characters around each line. The page keeps them in the text output instead of interpreting them as HTML.

How empty lines are handled

When Skip empty lines is unchecked, the tool adds Prefix and Suffix to empty lines as well. When it is checked, a line whose characters are only spaces or other whitespace stays unchanged. Lines with other characters are processed in either setting.

An empty Input text keeps Formatted output hidden. The tool does not trim the source lines or check the text entered in Prefix and Suffix.

Where adding a prefix and suffix comes up

For an HTML list, enter <li> as the Prefix and </li> as the Suffix. The resulting tags remain visible in Formatted output for review before you paste the lines elsewhere.

For a quoted list, enter a quote as the Prefix and a quote followed by a comma as the Suffix. To mark notes, enter - as the Prefix; leave Suffix empty and select Skip empty lines to keep blank spacing.

When another text formatting tool fits better

See Text Formatting & Layout Tools for related text tasks. Text Formatter combines line numbers, prefixes and suffixes, and indentation in one workflow.

Use Text Wrapper to wrap lines to a chosen width while preserving paragraph breaks. Use Indent Text for indentation, tab-to-space conversion, space-to-tab conversion, or a hanging indent.

Frequently asked questions

How do I add text before and after each line?

Enter the source in Input text, put the leading text in Prefix, and put the trailing text in Suffix. The result appears in Formatted output after a field changes.

Can I add a prefix and suffix without changing blank lines?

Yes. Select Skip empty lines. Empty and whitespace-only lines stay as entered, while lines containing other characters receive the Prefix and Suffix.

Does Add Prefix & Suffix preserve spaces in each line?

Yes. The line text stays as entered, including spaces. The Prefix and Suffix are placed around it without trimming the line.

Where does the formatted text appear?

The processed text appears in the read-only Formatted output area. Use Copy to copy the result when it is available.

Related Tools

88 views