# Add a Prefix to Text Lines

Quickly prepend a prefix to one or more text lines

> Canonical page: https://elysiatools.com/en/tools/text-add-prefix-lines

- **Category:** Text Processing

- **Keywords:** text, prefix, add, lines, prepend, beginning, start

## Overview

This utility allows you to instantly prepend custom text or symbols to the beginning of every line in your document, streamlining formatting and data organization tasks.

## Inputs

- **Text Input** (textarea): Enter text to process...
- **Prefix** (text): Enter prefix to add...
- **Target Lines** (select): Select which lines to modify
- **Ignore Empty Lines** (checkbox): Skip completely empty lines
- **Preserve Indentation** (checkbox): Keep existing indentation and add prefix after it

## When to use

- Formatting lists for Markdown or documentation by adding bullet points or blockquote markers.
- Preparing code snippets or logs by adding comment characters or timestamps to every line.
- Standardizing data exports by adding specific identifiers or labels to the start of each entry.

## How it works

- Paste your text into the input area.
- Define the prefix string you wish to add.
- Select which lines to target, such as all lines, only non-empty lines, or specific patterns like odd or even rows.
- Apply optional settings like preserving existing indentation before generating your processed text.

## Use cases

- Converting plain text lists into Markdown-formatted bulleted or numbered lists.
- Adding comment syntax (like // or #) to a block of code or configuration settings.
- Prepending timestamps or category tags to log file entries for better readability.

## Frequently asked questions

### Can I add a prefix only to non-empty lines?

Yes, select the 'Non-empty Lines Only' option in the Target Lines dropdown to skip blank lines.

### Does this tool support preserving indentation?

Yes, enable the 'Preserve Indentation' checkbox to insert your prefix after the existing leading whitespace.

### Can I target specific lines like odd or even rows?

Yes, the Target Lines setting allows you to choose between all lines, empty lines, non-empty lines, or alternating odd/even rows.

### Is there a limit to the length of the prefix?

There is no strict character limit for the prefix; you can use any text string that fits your formatting needs.

### Will this tool modify my original text?

The tool processes your input and generates a new version; your original text remains unchanged in the input field until you clear it.

## Related tools

- [Leet Speak Converter](https://elysiatools.com/en/tools/leet-speak-converter): Convert text to and from leet speak (1337). Encode with Basic, Full, or Caps styles, or decode leet back to plain text.
- [Line Number Adder](https://elysiatools.com/en/tools/line-number-adder): Add line numbers to text or code with customizable formatting options
- [Superscript & Subscript Converter](https://elysiatools.com/en/tools/superscript-subscript-converter): Convert text to real Unicode superscript (ˣ²) or subscript (H₂O), or mixed — no HTML tags. Digit coverage is full; letter coverage follows Unicode.
- [Add a Prefix to Words](https://elysiatools.com/en/tools/text-add-prefix-words): Quickly prepend a prefix to all words in text
- [Add a Suffix to Text Lines](https://elysiatools.com/en/tools/text-add-suffix-lines): Quickly append a suffix to one or more text lines
- [Add a Suffix to Words](https://elysiatools.com/en/tools/text-add-suffix-words): Quickly append a suffix to all words in text
- [Text Indenter](https://elysiatools.com/en/tools/text-indenter): Quickly add indentation to each text line
- [Text Justifier](https://elysiatools.com/en/tools/text-justifier): Quickly stretch spaces between words to make all text lines equal length

## Samples

- [Text with Emoji Samples](https://elysiatools.com/en/samples/text-with-emoji-samples): Mixed language text containing various Unicode emojis for testing emoji extraction
- [Chinese-English Mixed Text Samples](https://elysiatools.com/en/samples/text-chinese-english-mixed-samples): Sample text files with mixed Chinese and English content for testing automatic spacing tools
- [Text Case Format Samples](https://elysiatools.com/en/samples/text-case-formats): Examples of different text case formats: camelCase, snake_case, kebab-case, PascalCase, and more
- [Text with Chinese Samples](https://elysiatools.com/en/samples/text-with-chinese-samples): Mixed language text containing Chinese characters for testing Chinese extraction

## Related content

- [Text Prefix, Suffix, and Symbol Wrapping for Line and Word Batches](https://elysiatools.com/en/hubs/text-prefix-suffix-and-symbol-wrapping): Add prefixes and suffixes to text lines or words, wrap every value in quotes or backticks for SQL, config, and Markdown, and strip inherited numbering, bullets, and decoration from pasted lists.
