{{ result }}
ℹ️ About Add Prefix/Suffix Tool
Add Prefix/Suffix Tool is a text wrapping utility that prepends a chosen prefix and appends a chosen suffix to each selected unit of text. Use it to transform whole lines, whitespace-delimited words, or individual Unicode code points without manually editing every repeated item.
Practical use cases:
- Add bullet markers, quote markers, comment markers, or indentation to every line in a pasted list.
- Wrap words with quotes, brackets, delimiters, or placeholders before moving text into scripts, spreadsheets, or search queries.
- Create repeated markup such as
<li>Item</li>; for valid list markup, place list items inside a list container as defined by the HTML Standard. - Add paths, extensions, flags, SQL fragments, or command prefixes to copied filenames and identifiers.
- Prepare sample data where each token needs the same surrounding text before testing an API, parser, or configuration file.
How the modes work:
- Lines: splits on newline characters, applies the prefix and suffix to each line, and rejoins the output with the original line breaks.
- Words: splits on whitespace runs, preserves the original spacing, and wraps each non-whitespace token; punctuation stays attached to the token it touches.
- Characters: wraps each code point individually, which is useful for visual separators, debugging hidden transformations, or creating spaced character patterns.
- Skip empty elements: leaves blank lines or empty word tokens unchanged when enabled, so paragraph spacing and intentional gaps remain intact.
Examples: add > before each line to make a quoted block; add [ and ] around words to produce [alpha] [beta]; add <li> and </li> around lines to turn a plain list into list-item markup.
Technical details: The tool performs deterministic string concatenation only; it does not parse HTML, validate shell syntax, or escape unsafe characters for you. If the result will be pasted into code, HTML, SQL, or a command line, review the generated text in that destination context.
Privacy note: Text is processed in your browser by the shared tool logic, so routine prefix and suffix edits do not require a page refresh or external conversion service.
API Usage Example:
POST /api/tools/text/add-prefix-suffix
Content-Type: application/json
{
"text": "Line 1\nLine 2\nLine 3",
"prefix": "•",
"suffix": "",
"targetType": "lines",
"skipEmpty": true
}