MagmaNex LogoMagmaNex

Add Prefix / Suffix

Add prefix and suffix to each line

What does this tool do?

Add Prefix / Suffix attaches text to the start and end of every line you paste. It's a quick helper for anyone building lists, formatting code snippets, or batch-editing text without touching each line by hand.

How to use it

  1. Paste your text into the input area.
  2. Adjust the options to fit your needs.
  3. Copy the processed text.

How it works

Paste your text into the left pane and type the prefix and suffix you want in the boxes above. The tool processes the input line by line, prepending the prefix and appending the suffix to each one. The result appears instantly in the right pane and updates live as you type. With 'Skip empty lines' enabled, blank lines are left untouched so you don't end up with stray markers on empty rows.

Practical use cases

Set the prefix to '- ' for bullet points or '* ' for a Markdown list. When building a SQL value list, add a single quote as the prefix and ',' as the suffix to format each row in seconds. For HTML, wrap plain lines with '<li>' and '</li>' to turn them into list items. The same approach works for CSV rows, log entries, comment lines, or any repetitive line-based formatting.

Frequently asked questions

How are empty lines handled?

When 'Skip empty lines' is on, lines containing only whitespace keep their original form and receive no prefix or suffix. Turn the option off to apply the prefix and suffix to blank lines too.

Can I add only a prefix or only a suffix?

Yes. Just leave the field you don't need empty. With only a prefix, nothing is appended at the line end; with only a suffix, line beginnings stay as they are.

Is the original line order preserved?

Yes. Lines are processed in the exact order you enter them and appear the same way in the output. The tool only adds to the start and end of each line; it never reorders or merges them.

Is Add Prefix / Suffix free?

Yes. Add Prefix / Suffix and all 300+ tools on MagmaNex are completely free with no signup or account required.

Is my data safe?

Yes. Everything runs locally in your browser. The data you enter is never sent to a server, stored, or shared.

Does it work on mobile?

Yes. Add Prefix / Suffix works on phones, tablets and desktops — no app download needed.

🔒 Privacy: everything runs in your browser, your data is never sent to a server.

Related Tools

📝 Related Articles

Popular Tools