Text desk

Prefix Lines

Add the same bounded prefix to every line in a text block.

Prefix Lines: Attach the same text to the beginning of every logical line. Prefix Lines can turn a simple list into quoted lines, add a marker to log excerpts or prepare labels with a shared opening. The prefix is copied literally and does not replace anything already present. Runs 100% locally in your browser with zero server file uploads.

Category
Text tools
Runs
In your browser
Cost
Free · no sign-up
Availability
Ready to use
Prefix Lines / local editorLocal processing

Runs entirely in your browser

100,000 character input · 10,000 logical lines · 200,000 character output

Result

Ready

Text is processed locally. The tool uses literal, allowlisted operations and does not execute regular expressions or code.

Concatenation and a three-row example

For prefix P and original logical line L, output = P followed by L. If there are n entries, ordinary single-line prefixing adds n × length(P) code points before line-ending normalisation. Choose P = > and input 12\n\n34\n. Here n = 3 and length(P) = 2, so six code points are added. The exact result is > 12\n> \n> 34\n. Existing spaces at the beginning of 12 would appear after the prefix rather than being trimmed. Prepare a gap-free quote with remove empty lines if spacer entries are unwanted.

Markers, separators and limits

This operation preserves accents and the order of characters within each original line; it does not sort by the prefix or by language. Unicode collation (https://www.unicode.org/reports/tr10/) is separate from concatenating a marker. Prefix length is capped at 80 code points. Input allows 100,000 code points across 10,000 logical lines, but output cannot exceed 200,000. LF, CRLF and CR separators become LF. A long marker repeated on thousands of tiny entries may hit the output ceiling even when the source is small. Browser input fields count UTF-16 units, so supplementary Unicode characters use two places in their allowance. For a matching ending, use suffix lines; trim lines removes padding before you decorate each entry.

How to use it

  1. Paste or type your lines in the local editor.
  2. Set the options shown for this transformation and run it.
  3. Review the result, then copy or download the text.

Privacy & limitations

Your text and result stay on this device. There is no upload or execution of entered code.

Related tools

Frequently asked questions

Does the prefix appear on blank rows?

Yes. Every internal blank line becomes the prefix by itself. A final newline is preserved without creating another prefixed entry. Empty input produces nothing, even if a prefix is supplied, because there are no logical entries to decorate.

Can I use a backslash escape or a regular expression as the prefix?

The field is literal text. Typing backslash followed by n adds those two characters, rather than decoding a newline. There are no capture groups or substitution patterns. For a quote marker, enter the greater-than sign followed by a space exactly as you want it displayed.

Is a common prefix a safe way to build commands?

It can prepare text, but it does not quote filenames or escape shell metacharacters. Spaces, quotes and punctuation from each original line remain active syntax if pasted into a command interpreter. Review the target format and add its required escaping before running anything derived from a list.

Free tool · runs in your browser · no account required