Add Prefix and Suffix to Lines

Add an entered prefix, suffix or both to each line while keeping the list order and explicit empty-line choices.

On-device No sign-up Free to use

Add prefix and suffix controls

Showing an example. Edit to see your own.

?

Up to 1,000,000 characters. Line endings are normalised to LF and the line order is kept.

?

Literal text added before each line, up to 500 characters with no line break.

?

Literal text added after each line, up to 500 characters with no line break.

?

When selected, an empty line stays empty instead of receiving the prefix and suffix. The line is still present.

?

The result is capped at 1,000,000 characters.

Processed in your browser. Your inputs stay on this device.

Result

Showing an example.

Add a bullet and a space before each of three list items.

Added the prefix and suffix to 3 of 3 lines; line endings were normalized to LF; the result does not end with a newline.

Loading the tool. Your result will appear here.

https://usefreetools.net/line-prefix-suffix · 20 November 2026

Was this helpful?

How to use Add Prefix and Suffix to Lines

  1. Paste one item per line.
  2. Enter the exact prefix and suffix, including any spaces you want.
  3. Choose whether empty lines receive the prefix and suffix, and set the final line break.
  4. Copy the result after checking the first and last items.

Example: Add Prefix and Suffix to Lines

Add a bullet and a space before each of three list items.

You add
Text: "first line\nsecond line\nthird line" Prefix: "- " Suffix: "" Leave empty lines unchanged: false End of the result: "preserve"
You get
Added the prefix and suffix to 3 of 3 lines; line endings were normalized to LF; the result does not end with a newline.

Options

Literal affixes
The prefix and suffix are inserted as entered. Include a space in the prefix when a label should be separated from the line.
Empty lines and final newline
Skipping empty lines controls whether they receive affixes. The final-newline policy determines whether an ending line break is preserved, added or removed.

Supported inputs and limits

  • Up to 1,000,000 input characters, 500 characters per affix and 1,000,000 output characters.
  • Prefixes and suffixes are literal text, not templates or regular expressions.
  • Line endings normalize to LF; the original final-newline policy is stated with the result.
  • Empty-line handling follows your selection.
  • Quote, bracket and bullet presets fill the literal prefix and suffix fields.
More details

They operate on lines, not individual words.

Where your input is processed

This tool does not upload your inputs. See the limits for anything saved on your device.

Keep list boundaries with the output

Line order stays unchanged, but line endings become LF. A prefix can turn a list into commands or spreadsheet-like text, so inspect the combined lines before using them in another application. This is a literal transformation without template expansion or escaping for a destination language.

Questions about Add Prefix and Suffix to Lines

Can I use a regular expression in the prefix?

No. The entered characters are added literally, so punctuation and braces stay as typed.

Are words sorted or deduplicated?

No. Each retained line stays in its original position, including repeated values.

How do I add a space after a prefix?

Type that space in the prefix field. The tool does not guess separators between the affix and your item.

Page updated · Project managed by Tony Hines · Report a problem with Add Prefix and Suffix to Lines

Related reading

All guides