Navigation

HomeImage ToolsCode ToolsMath ToolsDate ToolsGeneratorsUtilities
Color ToolsText ToolsPDF Tools

Center Unicode

Center-align each line of Unicode text by padding with spaces or a custom character.

Paste your lines, set a width like 40 characters, pick any pad character — space, dot, star, whatever — and each line gets even padding on both sides. Emoji and multi-byte glyphs count as one character, not two, so the centering actually lines up. And everything runs in your browser. Nothing gets uploaded.

FAQ

How does centering work?

Each line is padded on both sides with the chosen pad character so it reaches the specified width. If the text is longer than the width, it is left unchanged. The left padding is floor((width - length) / 2) and right padding fills the rest.

Does it count Unicode characters correctly?

Yes. The tool uses JavaScript's spread operator to correctly count Unicode code points, including emoji and multi-byte characters, rather than UTF-16 code units.

Can I use a custom padding character?

Yes. Enter any single character (including Unicode characters like dots, dashes, or symbols) in the Pad Character field. The default is a space.

What happens with very long lines?

Lines longer than the specified width are left as-is. They will not be truncated or wrapped.

Related Tools