Skip to content
UniKit

Text padding

Pad every line of text to a fixed width locally: left or right padding, custom pad character, CJK counted as two columns, optional blank-line skipping — handy for aligning monospace art.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Padding is applied per line; CRLF / LF / CR are recognised, and lines that are already wide enough are left untouched instead of truncated.

Padded text

In a monospace font the lines line up on the right (or left). The result depends only on the input and options — no network.

Enter text to see the padded result

What this tool does

  • Line up mixed Chinese/English tables so the right edge matches in a monospace font
  • Indent ASCII art or code blocks with spaces so they survive a Markdown code fence
  • Pad with characters such as 0, · or ─ to build dotted-leader directory or form-style text

Example

Input

中文
apple

Output

      中文
     apple

Defaults: target width 10, display-width mode (CJK = 2 columns), left padding with spaces. 中文 occupies 4 columns and gets 6 spaces, apple occupies 5 and gets 5.

Frequently asked questions

Why does a CJK character count as two columns?

In a monospace font one ideograph is exactly as wide as two half-width characters. Display-width mode uses the wide/fullwidth ranges of Unicode East Asian Width (CJK ideographs, kana, fullwidth punctuation and common emoji count as 2), which is what makes mixed Chinese/English text line up. Switch the width mode to character count for the other convention.

Does padding truncate lines that are too long?

No. Only lines shorter than the target width receive padding characters; lines that already reach or exceed the width are emitted unchanged. Nothing is truncated and nothing is wrapped — use a line-slicing tool for that.

What pad characters are allowed?

Exactly one character: a space, ·, 0, an ideographic space ( ) and so on. When the pad character itself is full width it is counted by its display width, so an extra character may be added to reach the target; line breaks cannot be used as padding.

How are blank lines and trailing newlines handled?

By default blank lines are padded to the target width as well. Enable "Skip blank lines" to keep them untouched. A trailing newline produces one extra blank line, which follows the same switch.

Is the text uploaded?

No. Padding runs entirely in your browser; neither the input nor the result leaves your machine.

Keywords:text paddingtxt_paddoffline

Related tools