Text · 52 tools · nothing uploads

Reverse lines

Reverse lines. Runs entirely on your device, nothing is uploaded.

Input

live

Reverse lines flips the order of every line in a pasted text, last line first, without touching the characters inside each line. A trailing newline in the input stays a trailing newline in the output rather than becoming a leading blank line. The reversal works on whole lines only, so reversing characters within one line needs a different tool.

Questions

Does this reverse the text within a line, or only the order of lines?

Only the order of whole lines. The last line becomes the first and vice versa, but every character inside each line stays exactly as it was; there is no per-line character reversal here.

What happens to a trailing newline?

It is kept as a trailing newline. The tool detects one before splitting the text into lines and reattaches it after reversing, so it does not turn into a new blank first line.

Are blank lines treated any differently?

No. An empty line is a line like any other for this tool and is reversed along with the rest, so it can end up in a different position than it started in.

Is there an option to reverse only part of the file?

No. There is no range or selection option; every line in the input is included in the reversal.

Can I run this on more than one file at a time?

Yes. It is a per-file tool, so drop several text files at once and each one is reversed on its own, coming back as its own separate result.

Compare

ToolRuns on the CLILive as you type
Reverse linesYesYes
Number linesYesYes
Shuffle linesYesYes
Sort lines by lengthYesYes
Unique lines with countsYesYes
Prefix or suffix linesYesYes
Extract linesYesYes

Related Text tools