Center Text

Center Text Tool aligns each line of your text to the center based on a specified total width. It supports custom fill characters and optional trimming, making it easy to format text for fixed-width layouts, code displays, or aesthetic presentation. Results update instantly as you edit.

Paste your input above or import a file below.
No file chosen
Supported file type: text/plain (.txt)
Total items: 0
Options
Trim lines

How to Use:

  1. Paste your text into the input box or import a .txt file using the Choose File button.
  2. In the Options section:
    • Set the Line Width to define the total line length.
    • Enter the Fill Character to use for padding on each side.
    • Toggle Trim lines to remove leading and trailing spaces before centering.
  3. The output updates live as you type or change options.
  4. Use Copy Output to copy the result.
  5. Use Export to File to save the output as a .txt file.
  6. Click Clear All to reset everything.

Example:

Input:

A bit longer line
This one is the longest of all

Line Width: 30
Fill Character: .
Trim lines: Enabled

Output:

.............Short..............
......A bit longer line.........
.This one is the longest of all.

Common Use Cases:

Use Center Text Tool to create visually centered text blocks for terminal applications, documents, code interfaces, or any environment that requires neatly aligned fixed-width formatting.

Useful Tools & Suggestions:

Once your text is centered, Draw a Box Around Text can help frame it neatly perfect if you’re building headers or callouts. And if the spacing feels too tight or uneven, Increase Text Spacing adds breathing room without messing up the alignment.