Add Prefix to Each Line
Prepend a string to every line. Optional skip-empty option keeps blank lines clean.
About Add Prefix to Each Line
This tool prepends the same string to the start of every line. Useful for commenting out a block of code, quoting text with '> ', or producing a custom bullet style. Empty lines can be skipped to avoid prefixing whitespace-only lines.
When to use it
- Commenting out a code block by prepending '# ' or '// '
- Quoting text in an email with '> '
- Producing bulleted lists from plain lines ('- ' prefix)
- Tagging lines with a category code or namespace
How it works
Lines are split on LF/CRLF. The prefix string is prepended to each line. When 'skip empty lines' is enabled, blank lines are left blank instead of getting prefix-only content.
Examples
foo bar baz (prefix='> ')
> foo > bar > baz
Frequently asked questions
- Can the prefix contain special characters?
- Yes. The prefix is treated as a literal string — tabs, spaces, Unicode, emoji all work.
- Does it affect the original line content?
- No. Only the start of the line changes; the rest is preserved exactly.