EditSafely

Right-align Text

Align every line of text to the right margin.

Runs on your device, nothing uploaded

Width (0 = longest line)
Try:

0 chars · 0 lines

Output

Align every line of text to the right margin.

Type or paste above to see the result here.

Example: Align to the longest line

What you paste never leaves this tab

Right-align Text is JavaScript that your browser has already downloaded, and it does the whole job on your own machine. On a normal site, the text you paste is sent to a server that can log it, cache it or keep it. Here it is read and transformed inside this tab and nowhere else.

  • No upload
  • No length limit
  • Works offline once loaded
  • Nothing stored or logged

How to use Right-align Text

  1. 1. Paste the lines you want right-aligned. Enter a short list of lines, such as numbers or short words, that you want flush against a common right margin instead of the usual left margin.
  2. 2. Set the Width. Enter the total column width to align against, or leave it at 0 to automatically use the length of the longest line in your input as the width.
  3. 3. Review the right-aligned block. Every line now has spaces added to its left so all lines end at the same column, producing a ragged-left, flush-right block.
  4. 4. Copy the aligned result. Copy the right-aligned lines into a plain-text report, a code comment, or wherever a right-flush column layout is expected.

When to use Right-align Text

Right-align Text pushes every line so it ends at the same column, which is the layout numbers and short labels usually want in a plain-text table. Use Right-align Text when you're formatting a monospace list by hand and need every entry to share a right margin.

  • Aligning a short list of numeric totals. A quick summary of totals like one, three, and seven needs to line up on the ones place for readability in a plain-text email. Right-aligning to the longest value's width does this instantly.
  • Formatting a right-flush column in a code comment. A comment block in source code lists variable names and wants them right-aligned before a colon and value. Aligning to a fixed width keeps the colons in a straight column.
  • Building an ASCII table without a spreadsheet. You're typing a small table directly into a markdown code block or plain-text file and need one column flush right. Right-aligning that column by hand keeps the layout tidy.
  • Matching an existing right-aligned legend. A chart's legend already right-aligns its labels at a fixed width, and new labels need to match. Setting that same Width value keeps additions consistent with the existing layout.

Examples

Align to the longest line

Input

one
three
seven

Output

  one
three
seven

About the Right-align Text tool

Right-align Text does its work locally, right in the browser. Align every line of text to the right margin. There is no upload step, no queue and no account, and your data never travels over the network.

It belongs to the Text Tools collection on EditSafely, a set of 211 small, focused Text utilities that share the same instant, private workspace.

You can shape the output with the Width (0 = longest line) setting, and the result refreshes the moment you change it. A worked example further down the page shows exactly what the tool produces for a real input.

Running locally also makes the tool fast and dependable: results appear as soon as your input does, there is no server outage that can take it down mid-task, and confidential data can be processed without a second thought.

Frequently asked questions

Is Right-align Text free to use?

Yes, it is completely free. All 2,943 tools on EditSafely work without an account, a subscription or usage limits.

Is it safe to paste sensitive or confidential data?

Everything happens locally. Your browser downloads the tool's code once, then does all the processing itself; nothing you enter is transmitted, stored or logged. You can even go offline after the page loads and it will still work.

How much text can I process at once?

There is no fixed limit; your device's memory is the ceiling. Up to 10 MB the result updates as you type, after a short pause that grows with the size. Above 10 MB a Run button appears so typing stays smooth, and files open up to 50 MB. A very long result shows its first 2,000 lines on screen, while Copy and Download always include all of it.

Do I need to sign up or install anything?

No. The tool works in any modern browser on desktop, tablet or phone. There is no account to create, no extension to add and no software to install.

How do I use the result?

The output panel has a one-click copy button, and you can keep refining the input while you work; the result updates in place as you type.

Related tools

All Text Tools →