Use %N% for the line number and %L% for the line itself.

Help Us Improve

(—)

Add text to each line online

Prepend or append text to every line. Use line numbers with %N% or repeat the line with %L%, then copy or download the result.

What is add text to each line online?

Add text to each line online is a text utility that prepends or appends content to every row in a multi-line block. Paste lines, add a prefix like a line number, add a suffix like a comma, and copy the result. People also search for add text to text, prepend lines, append text, or type on multiple lines; this page serves that intent with %N% and %L% placeholders. It does not edit Word documents or insert HTML line breaks.

Line prefix and suffix features

Tools for append and prepend workflows.
  • Instant updates

    New text refreshes as you paste, edit templates, or change line counting.

  • Prefix each line

    Add constant text or numbered labels at the start of every row.

  • Suffix each line

    Append commas, spaces, quotes, or custom text at the end of each line.

  • %N% line numbers

    Insert auto-incrementing numbers with four counting styles.

  • %L% line content

    Repeat the original line inside your prefix or suffix template.

  • Copy and download

    Export the updated block as plain text in one click.

How to add text to every line

Three steps for prepend or append output.
  1. Paste your lines

    Enter one item per line in Original text.

  2. Set prefix or suffix

    Enable beginning or end text, then use %N% or %L% if needed.

  3. Copy or export

    Use Copy all, Download text, or Open in new tab.

Tips for prefix and suffix templates

Avoid common mistakes when you add text to lines.
  • 01

    One item per line

    Line breaks define rows before prefix or suffix is applied.

  • 02

    Start with %N%.

    A numbered prefix is the fastest way to build ordered lists.

  • 03

    Use suffix for delimiters

    Append commas or spaces when preparing concat-style output.

  • 04

    Pick padding early

    Choose 00 or 01 modes when filenames or IDs need fixed width.

  • 05

    Download long outputs

    Text export is safer than clipboard for very large lists.

When to prepend or append lines

Common add-text-to-text tasks.
  • Numbered lists

    Prefix rows with 1. 2. 3. or zero-padded indexes.

  • Quote wrapping

    Add opening and closing characters on each line for code or CSV prep.

  • Delimiter suffixes

    Append commas or spaces when building concatenated output.

  • Bulk labeling

    Insert the same tag before many lines in logs or inventories.

  • Template expansion

    Combine %L% with fixed text to repeat line content in a pattern.

Why use this line text tool

Fast bulk edits without a spreadsheet.
  • Immediate

    No run button required for standard use.

  • Flexible templates

    Mix static text, line numbers, and original line content.

  • Private

    All processing stays in the browser.

  • Portable output

    Copy, download, or open output in a separate tab.

Technical details

How the add-text-to-each-line processor works.
Input format
Plain text split by newline characters.
Normalization
Windows and Unix line endings are normalized before processing.
Placeholders
%N% inserts the formatted line number; %L% inserts the original line.
Order of operations
Prefix template is applied first, then suffix template, on each original line.
Runtime
Client-side in modern browsers.

Sources & References

Authoritative references on plain text processing, newline normalization, and string templating patterns this line editing tool uses.
  • Newline characters (LF, CRLF) serve as line terminators in plain text. Cross-platform normalization converts CRLF to LF before text processing to ensure consistent line splitting.
    Wikipedia — Newline

    Newline character and line endings normalization: Input text is normalized by converting Windows CRLF to Unix LF before splitting on newlines, ensuring consistent line-by-line prefix and suffix application regardless of source platform. en.wikipedia.org/wiki/Newline

  • String templating replaces placeholders in a template string with computed or dynamic values. Common patterns include %N% for line numbers and %L% for original line content.
    Various — String templating resources

    String templating with placeholders: The prefix and suffix templates support %N% (formatted line number) and %L% (original line content) placeholders, applied in order to each line after normalization. developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals

  • The String.prototype.split() and Array.prototype.join() methods are fundamental for converting between multi-line text and arrays of lines in browser-based text utilities.
    MDN Web Docs — String split / Array join

    JavaScript string split and join for text processing: The tool splits input text by newline characters, applies prefix and suffix templates to each element, and joins the results back into a newline-separated block for output. developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split

Frequently Asked Questions

Quick answers about this tool—open a question to read more.