Text Centering

Center, left-align, or right-align text within a fixed width. Perfect for formatting CLI output, README banners, and plain text documents.

Everything runs in your browser. Your data never leaves your device.
(space)
0 linesLongest: 0 chars
0 linesWidth: 80

Common Use Cases

Centre a title or section heading within an 80-column README or documentation file
Format CLI tool output or log messages with centred status banners framed by dashes or equals signs
Right-align line numbers or timestamps in a fixed-width report or table
Build decorative separators and boxes in a shell script's help text or deployment log output

About Text Centering

Plain text formatting — centering, padding, and alignment within a fixed width — is an art that reaches back to the typewriter era. A 80-character-wide monospace line has been standard since the days of punch cards and terminal limitations. Today, fixed-width formatting is essential for command-line tools that produce framed or boxed output, for README files that need visual section breaks or banners, for ASCII art and diagram generation, and for any document that will be displayed in a monospace font where pixel-perfect alignment matters.

Centering requires integer arithmetic: given a line of length N that must fit within a width of W, the padding on the left should be floor((W - N) / 2), with any remainder pushed to the right. Left-alignment needs no padding; right-alignment puts all padding on the left. A 60-character heading centred in 80 columns gets (80 - 60) / 2 = 10 spaces on each side, resulting in perfect visual balance.

The choice of padding character — space (invisible), dash, star, equals, or any other — affects readability and visual hierarchy. Tools like 'figlet' and banner generators use this principle, building decorative borders with repeated characters. A README intro might use a line of equals signs as a section separator, while a CLI progress display might use spaces for alignment and dashes for visual structure.

Some workflows require consistent formatting of multi-line blocks — think of centring a title block in an email signature, formatting a usage menu in a help screen, or building a framed notice in a deploy log. This tool processes each line independently, applying the selected alignment and character to every line simultaneously, so you can paste a whole paragraph and see it formatted in context immediately.

Frequently Asked Questions