πŸ“ Add Prefix and Suffix to Every Line β€” Free Online

Paste a list and instantly add the same text to the beginning or end of every line. Great for formatting, commenting code or preparing data.

Text Free Β· no sign-up Reviewed 2026-11-03
Input
Result

Private by design. This tool runs entirely in your browser β€” nothing you enter or add is uploaded to any server.

What this tool does

Prefix Lines adds the same fixed text to the beginning of every line and, optionally, a second fixed text to the end of every line. It turns a plain list into a bullet list, a block of comments, a set of quoted strings or any other uniformly decorated format in a single click.

Because the transformation is purely textual and local, it is safe for confidential notes, source-code fragments or customer data. Empty lines receive the prefix and suffix as well, which keeps the visual structure of the original block intact.

When to use it

  • Convert a shopping list into Markdown bullets by prefixing each line with β€œ- ”.
  • Comment out a block of configuration by adding β€œ# ” or β€œ// ” at the start of each line.
  • Wrap every line in quotation marks for inclusion in a CSV or JSON array.
  • Add a consistent label or timestamp prefix to log lines.

How it works

  1. Paste the lines you want to modify.
  2. Enter the text that should appear at the start of each line (prefix) and, if wanted, at the end (suffix).
  3. Press Apply. Empty lines receive the prefix and suffix as well.
  4. Copy the formatted result. All work happens in your browser.

Worked example

The three lines apple, banana and cherry are entered. The prefix field is set to β€œ- ” and the suffix field is left blank. After pressing Apply the output becomes β€œ- apple”, β€œ- banana” and β€œ- cherry”. Changing the suffix to β€œ.” produces β€œ- apple.”, β€œ- banana.” and β€œ- cherry.”. The status line reports that the prefix and suffix were applied to three lines.

  • Turn a plain list into a Markdown bullet list by prefixing each line with "- ".
  • Add "// " to the start of every line to comment out a block of code.
  • Wrap each line in quotes by using a prefix of '"' and a suffix of '"'.

Accuracy and limitations

  • The prefix and suffix are literal strings; there is no automatic numbering or variable substitution.
  • Very long prefixes combined with very long input can produce large result strings.
  • The tool does not trim existing whitespace; any spaces already present on a line remain.
  • It operates on whole lines only and does not modify text inside a line.

Privacy and data handling

All prefixing and suffixing happens inside your browser. The original text and the result stay on your device.

Frequently asked questions

What if I leave the prefix blank?

Lines will only receive the suffix. You can use either field independently.

Does it affect the last line if it has no trailing newline?

Yes. Every line, including the final one, receives the prefix and suffix.

Can I use it for numbering?

This tool adds a fixed string. For automatic numbering use a different utility or combine it with other text tools.

What if my list already has bullets?

The new prefix is simply added in front of whatever is already there. You can first clean the lines with another tool if needed.

More Text tools β†’