Tools Hub

Center Text

Center each line horizontally by padding both sides with spaces to a fixed width.

Browser onlyYour data never leaves this device.

Runs entirely in your browser. Your text never leaves this device and is never stored.

Details: Privacy policy

Input

Lines are centred live. Nothing is stored.

Whole number from 1 to 500.

Result

No text yet.

Paste lines and choose a width above.

Center Text puts each line of a plain-text block in the middle of a fixed width by adding spaces to both sides. It is the browser-side equivalent of centring a heading in a monospace document: choose a width, paste the lines, and every short line gains the same left and right margin. An odd number of missing characters goes to the right, so the result is deterministic rather than dependent on rounding. Lines that already reach the width are left exactly as they are, which means centring never truncates a long line or silently wraps it. The width is measured in code points, not display columns, so a CJK character or an emoji counts as one unit even if a terminal draws it wider; the page says so rather than promising pixel-perfect alignment. It is not a replacement for CSS centring on a web page, and it does not strip existing leading spaces before centring, so a line that arrives indented is centred with that indentation included. It is the tool for titles in a plain-text README, centred labels in a fixed-width field, and quick banners made of characters. Leading and trailing spaces already present on a line are counted as content, so an indented line is centred with its indentation rather than stripped first.

How to use Center Text

  1. Paste the lines to centre.
  2. Set the target width.
  3. Copy the centred text or clear to start over.

What you get

  • Each line padded on both sides to the chosen width.
  • The number of lines and the longest original line width.
  • Long lines left unchanged, with no trimming or wrapping.

When to use Center Text

  • Centre a title inside a fixed-width plain-text banner.
  • Align short labels to the middle of a monospace column.
  • Prepare centred headings for a README or a text-only email.

Frequently asked questions about Center Text

Why is the text not perfectly centred in my font?

Centring counts characters, not rendered widths. It lines up in a monospace face; a proportional font gives each character a different width.

What happens to a line longer than the width?

It is left unchanged. The tool never trims or wraps a long line, so no content is lost.

Does it remove existing indentation first?

No. Existing leading spaces are part of the line and are counted, then the whole line is centred. Trim them first if you want a clean centre.

Is my text uploaded?

No. Centring runs in your browser; nothing is sent to a server or stored.

Guides that compare Center Text

⚡Embed Center Text on Your Site & Get Badge↓

Embed this in-browser tool into any blog, documentation, or dashboard. Includes an optional dofollow backlink badge to credit Tools Hub.

Height:
<iframe src="https://salaq.com/embed/text/center-text" title="Center Text — Tools Hub" width="100%" height="640" style="border:0;border-radius:12px;overflow:hidden;max-width:100%;" loading="lazy"></iframe>
<p style="font-size:12px;color:#6b7280;margin-top:6px;font-family:system-ui,-apple-system,sans-serif;">Powered by <a href="https://salaq.com/tools/text/center-text" target="_blank" rel="noopener" style="color:#2563eb;text-decoration:underline;">Center Text on Tools Hub</a></p>

Feedback

Send feedback about this tool (placeholder — feedback collection is not wired up yet).