Guide

How to Reverse Text by Characters, Words, or Lines

Enter text, leave both optional controls off for character reversal, or select line reversal or word reversal for a different ordering. If both controls are selected, line reversal takes precedence.

Tool Reverse Text

Choose the reversal mode

Reverse Text lets you rearrange supplied text without manually moving each character, line, or word. Character order is the default behavior, while separate optional controls let you work with line order or word order instead. Choose the mode that matches the structure you want to change: character mode is suited to a continuous string, line mode changes the order of line segments, and word mode changes the order of words inside each segment. Text may be omitted, so an empty field is accepted and produces an empty result rather than applying one of the non-character transformations.

Reverse text step by step

  1. Enter or paste the text into the input field. Leaving the field empty is also valid, but the resulting output will be empty.
  2. For character-by-character reversal, leave the line-reversal and word-reversal controls turned off. The tool then changes the order of characters in the supplied text.
  3. For line reversal, select the line-reversal control and leave word reversal off when you want each line segment to retain its internal order. The tool separates non-empty text at literal LF line-feed characters, then places those segments in reverse order. A different newline representation is not treated as an LF delimiter.
  4. For word reversal, select the word-reversal control. Each segment separated by a literal LF keeps its position, while its whitespace-separated words are placed in reverse order and joined with single spaces.
  5. If both controls are enabled, do not expect two transformations in sequence. The line-reversal choice takes precedence, so word reversal is not subsequently applied.
  6. Examine the output with the selected mode in mind. For a non-empty input, compare the ordering of characters, segments, or words rather than expecting every formatting detail to remain unchanged. The documented empty and non-empty text-reversal paths return a successful computation.

Interpret the output

Interpret the result by identifying which unit moved. Character mode reverses the sequence from its ends inward, so the character that began first moves to the final position. Line mode changes the order of LF-delimited segments while leaving the content of each segment outside the described word transformation. Word mode keeps each segment where it was and rearranges its whitespace-separated words.

Spacing deserves special attention in word mode. Leading spaces, trailing spaces, repeated spaces, and some whitespace characters can change because the output words are joined with single spaces. Character mode has a separate Unicode limitation: combining sequences and some emoji sequences may be split instead of staying together as a user-perceived character. When both optional controls are selected, read the output as line reversal because that branch is chosen first.

Worked example

You want to place the second line of a short list above the first while keeping the words within both lines in their original order.

Enter a two-line input whose first segment is red and second segment is blue, then select line reversal while leaving word reversal off.

The output has two line segments in the opposite order, with blue before red and the separator between them.

Limitations

  • Word mode can change whitespace layout, while character mode can split combining sequences or some emoji sequences.

Common errors

  • If a multiline input stays in an unexpected order, inspect how its breaks are represented. Only literal LF line-feed characters separate segments, so convert the breaks to that form before choosing line or word mode.

FAQ

How does character reversal work?

With neither optional control selected, the tool reverses the order of characters in the supplied text. Some combining sequences and emoji sequences can be split rather than remaining together as user-perceived characters.

Does word reversal preserve spacing?

No. Word reversal treats whitespace as separation and joins the reversed words with single spaces inside each LF-separated segment. That process can alter leading, trailing, repeated, and some non-space whitespace formatting.

What happens if I select line reversal and word reversal together?

When both controls are enabled, line reversal is selected first. The words inside the resulting line segments are therefore not reversed afterward.

Tool

Reverse Text