Skip to content
M2TOOLKIT

Add Prefix and Suffix to Lines

Add the same text to the start or end of every line in seconds.

  • Free
  • No sign-up
  • Nothing is sent or stored

Tip: {n} inserts the line number.

0 characters

The calculation happens instantly in your browser. The numbers you enter are not sent to our servers or saved.

How to use the Add Prefix & Suffix to Lines

  1. Paste your lines.
  2. Type what to add before and after each line.
  3. Copy the result.

What does this tool do?

Handy for turning a list into code or markup: wrap each line in quotes and add a comma to build an array, add <li> tags for HTML, or put a dash in front for a bullet list.

Use {n} anywhere in the prefix or suffix to insert the line number. Empty lines can be skipped so numbering stays tidy.

Why use it?

  • Prefix and suffix together.
  • {n} line numbering.
  • Skips empty lines.

Example

Prefix ' and suffix ', turns apple / banana into 'apple', / 'banana', — ready to paste into code.

Privacy

The calculation happens instantly in your browser. The numbers you enter are not sent to our servers or saved. There's no account to create and nothing to install.

Last reviewed by the M2Toolkit team.

Other tools people use alongside the add prefix & suffix to lines.