How to use Text Formatter
Paste text into Input text or choose a file with Upload. Add one or more actions, set their fields, and check the result in Formatted output. Text Formatter runs the actions in the order shown, and you can save that setup as a preset.
- Paste text into Input text or choose a text file with Upload.
- Choose an option in Formatting action type and click Add Action.
- Set the action fields, then use Move up, Move down, or Remove as needed.
- Copy or download the result with Copy or Download.
How actions change each line
Text Formatter processes action cards from top to bottom. Formatting action type includes Line Numbers, Prefix, Suffix, Indentation, and Prefix & Suffix (Bulk). Click Add Action, then edit the fields on the card. Changes to Input text or an action field update Formatted output automatically.
Line Numbers uses Start at, Zero-pad width (0 = off), and Separator. With the default settings, this input becomes:
alpha
beta
1. alpha
2. beta
Line Numbers numbers every split line, including blank lines. Prefix and Suffix add the value in Prefix text or Suffix text. When Skip empty lines is checked, empty and whitespace-only lines stay unchanged. Indentation uses Mode, Unit, and Size. Add indent inserts the selected number of Spaces or Tabs. Remove indent removes up to that many leading characters of the selected unit.
How Prefix & Suffix (Bulk) filters lines
Prefix & Suffix (Bulk) combines a prefix, a suffix, line numbers, trimming, duplicate removal, and line filtering in one action. Enter Prefix and Suffix, then enable Only apply to lines to use Filter type and Filter pattern. Filter type can be containing, starting with, ending with, or matching regex. An invalid regex lets the line through.
- Skip empty lines and Skip whitespace-only lines leave those lines unchanged.
- Skip duplicate lines keeps the first occurrence and omits later duplicates. Trim lines before applying changes the line used for duplicate checks and for the output.
- Add line number as prefix supports
1. line,1) line, and[1] linethrough Line number format.
How line endings and presets work
Text Formatter splits text at common line breaks and joins processed lines with LF (\n) line endings. With no actions, Formatted output matches Input text. Formatted output is read-only, and Copy and Download stay disabled while it is empty.
- Click Save preset after configuring the actions.
- Enter a name at the Preset name: prompt.
- Select the name in Load preset... and click Load.
- Select it again and use Delete selected preset to remove it.
Presets are stored in the browser's localStorage. Saving a preset records the actions. Loading one replaces the current action list and applies it to the current input.
Examples with Text Formatter
- A developer can add numbered lines to a short configuration or log excerpt, then use Copy to place the formatted block in a ticket.
- An editor can use Prefix & Suffix (Bulk) with Only apply to lines to mark lines that contain a chosen word, while leaving other lines unchanged.
- A documentation writer can use Indentation with Add indent and Spaces before pasting nested text into a plain-text note.
When to use another formatting tool
Browse Text Formatting & Layout Tools for other text changes. Add Prefix & Suffix handles one prefix-and-suffix pass with empty-line handling. Indent Text handles tab-to-space conversion, hanging indents, and Smart Auto-Format. List Maker creates bullet, numbered, Roman numeral, or checklist output with indented sub-items.
Frequently asked questions
How do I add line numbers to text with Text Formatter?
Choose Line Numbers in Formatting action type, click Add Action, and set Start at, Zero-pad width (0 = off), and Separator. Every split line receives a number, including blank lines.
Can I combine line numbers with a prefix and indentation?
Yes. Add several actions, then use Move up and Move down to set their order. Each action receives the output produced by the action above it.
How does Prefix & Suffix (Bulk) filter lines?
Enable Only apply to lines, choose a Filter type, and enter a Filter pattern. Lines that do not match remain unchanged, while an invalid matching regex also lets the line through.
Can I save and reuse a text formatting preset?
Yes. Click Save preset, enter a name at the Preset name: prompt, then select it in Load preset... and click Load. The saved action setup is kept in the browser's localStorage.