Skip to main content
1

Add Prefix & Suffix to Lines

Add a prefix and/or suffix to every line of your text. Optionally skip empty lines, skip lines matching a regex pattern, or add line numbers.

More options
Was this tool helpful?
Send output to:
Advertisement

How to use Add Prefix & Suffix

  1. Paste your lines into the input box.
  2. Enter the prefix and/or suffix text to apply.
  3. Optionally enable line numbers, skip empty lines, or set a regex pattern to skip matching lines.
  4. Copy the result or save it as a file.

What is Add Prefix & Suffix?

The Add Prefix & Suffix tool lets you wrap each line of text with custom characters or words. It's ideal for building HTML lists (wrapping lines in <li> tags), quoting strings for code, creating CSV-style lists, or formatting any line-based content.

Use the regex skip feature to protect certain lines from being modified. Enable line numbers to get a numbered list with your prefix and suffix applied. All processing happens in your browser with no uploads or server round-trips.

Advertisement

FAQ

Can I wrap each line in HTML tags?
Yes. Set the prefix to an opening tag like <li> and the suffix to a closing tag like </li> to quickly wrap every line.
What does the regex skip pattern do?
Any line that matches the regex pattern is left unchanged. This is useful when you want to add prefixes/suffixes to most lines but skip certain ones (e.g., lines starting with a number or containing a specific word).
How do line numbers work with prefix and suffix?
Line numbers are added before the prefix, like '01. <li>apple</li>'. The numbering starts at 1 and pads with leading zeros to keep alignment.
Is my text uploaded?
No. All processing happens in your browser. Your text never leaves your device.

Related tools

Author

1S
1Stop Tools"The Toolsmith"

Editorial Team at 1Stop Tools

The 1Stop Tools editorial team tests, reviews, and curates every utility on this platform. We believe tools should be free, fast, and private.

Advertisement