Add text to the top

Add text to top inserts a single string at the very start of the input, once. Type the header, banner, or intro line into Prepend and it lands at character zero of the output. Useful for adding file banners, BOM-style markers, or section headers. To attach a prefix to every line instead, see add prefix to each line; for the bottom of the block use add text to bottom.

Input
Line 1:1 LF cloud_done Saved locally
Result Prepend Text
0 lines 0 chars

One insertion, at character zero

Prepend is inserted verbatim at the start of the input. There is no scope, no per-line behaviour, no skip-empty switch. The implementation is a one-liner: (prepend || '') + s. If Prepend is empty the input passes through unchanged.

The string can contain newline characters by typing them into the field (where the browser allows it) or by pasting a multi-line value. The whole content sits before the first character of your existing text. So Prepend = HEADER\n\n produces a header line and a blank line, then your original text.

For a header that repeats on every line, use add prefix to each line with Scope = Whole Text. For appending to the bottom instead, use add text to bottom.

How to use add text to the top

  1. 1Paste your text into the input panel on the left.
  2. 2Type the string you want to insert at the top into the Prepend field.
  3. 3If you want a blank line between the prepended string and your text, include a trailing newline in Prepend.
  4. 4Read the result on the right; the prepended string is at the very start.
  5. 5Click Copy or Download in the output header.

Keyboard shortcuts

Drive TextResult without touching the mouse.

Shortcut Action
Ctrl FOpen the find & replace panel inside the input Plus
Ctrl ZUndo the last input change
Ctrl Shift ZRedo
Ctrl Shift EnterToggle fullscreen focus on the editor Plus
EscClose find & replace, or exit fullscreen
Ctrl KOpen the command palette to jump to any tool Plus
Ctrl SSave current workflow draft Plus
Ctrl PRun a saved workflow Plus

What this tool actually does

Single insertion at position zero

The transform is prepend + input. There is exactly one insertion, at the very start of the text. No splitting, no per-line work.

Prepend is verbatim

The string you type lands in the output unchanged, including any whitespace, line breaks, or special characters. No escaping, no trimming.

Empty Prepend is a no-op

If you leave the field empty the input is returned unchanged. There is no implicit header.

Multi-line prepends are supported

Paste a multi-line value into Prepend to insert a multi-line header. The line breaks in the prepend are preserved exactly.

Pair with append for top-and-tail wrapping

Combine with add text to bottom to wrap the whole block top and tail. Useful for adding <pre> ... </pre>, [ ... ], or BEGIN / END markers.

Worked example

Prepend // auto-generated, do not edit\n. The header line lands at the top, then the original code follows verbatim.

Input
function greet(name) {
  return 'hi, ' + name;
}
Output
// auto-generated, do not edit
function greet(name) {
  return 'hi, ' + name;
}

Settings reference

Behaviour Effect on output
Prepend populated Inserted verbatim at the very start of the input.
Prepend empty Input passes through unchanged.
Prepend with line breaks Multi-line headers are supported. Newlines are inserted as typed.
Existing input Untouched. Only the very start gets the new string.
Line endings Original input bytes are preserved verbatim.

FAQ

How do I add a blank line between the header and the rest of the text?
Include a trailing newline (or two) in Prepend. For one blank line below the header, end the field with two newline characters.
Can I prepend a multi-line block?
Yes. Paste a multi-line string into Prepend. The line breaks are inserted verbatim.
What if I want a header on every line?
Use add prefix to each line with Scope set to Per Line.
How do I add text to the bottom too?
Run the result through add text to bottom. Each tool does one job; chain them for top-and-tail wrapping.
Does anything upload?
No. The transform is one string concatenation in your browser. Nothing leaves the page.