{}DevStringToolsAll tools

Add Prefix to Lines

Add a prefix to every line of your text instantly. Useful for generating SQL INSERT batches, JSON array entries, CSV rows, and bullet lists. Empty lines are preserved.

19 chars

How Add Prefix to Lines works

Add a Prefix to Lines prepends a fixed string to every line of your input while keeping the original line breaks intact. The transform is line-oriented: it splits on (or on Windows), applies your prefix to each non-empty line (optionally to empty lines too), and rejoins the result. Nothing leaves your browser — the whole transformation happens locally.

How to use

Type or paste your list on the left. Set the prefix in the option box (defaults to "- " for Markdown bullets). Toggle "Skip empty lines" if your input has blank rows you want to preserve untouched. The output updates on every keystroke. Use "Copy" to grab the result, or "Sample" to load demo data.

Frequently asked questions

Does the Add Prefix tool preserve my original line breaks?

Yes. The tool splits on your existing line breaks (both \n and \r\n) and rejoins the lines with the same separators. It does not reformat, reflow, or touch anything other than the leading characters of each line.

How do I prefix every line including blank ones?

Uncheck the "Skip empty lines" option. The prefix will then be added to blank lines as well, which is useful for SQL or code generation where every line must start with a token.

Can I use multi-character prefixes like a SQL INSERT comment?

Absolutely. The prefix field accepts any string, including spaces, tabs, dashes, JSON brackets, or multi-character sequences like "-- " or " → ". It is applied verbatim to each line.

Is my text uploaded to a server?

No. The transformation runs entirely inside your browser using JavaScript. Your text never leaves your machine, which makes the tool safe to use with proprietary code, secrets, or large files.

What is the largest input this tool can handle?

In practice the tool comfortably processes several hundred thousand characters on a modern browser. If you hit performance limits, split the input into chunks of a few megabytes each.

How is this different from a sed command?

It is the visual, copy-paste-friendly equivalent of `sed "s/^/<prefix>/"` on Linux. You do not need a terminal, regex knowledge, or escaping — just paste, set the prefix, and copy the output.