Reverse Text

Read a string backwards, or turn its words, lines or sentences the other way round.

Runs on your deviceTextWorkingNo account needed

What this tool does

Reverse Text performs one of four reversals, picked from a single list. Characters turns the string itself round, so stressed comes back as desserts. Word order and Line order leave every unit intact and change only the sequence they appear in. Sentence order finds the sentence boundaries first, then puts the sentences back in the opposite order with each one's own full stop still attached to it.

Apply to each line separately is switched on by default, and it governs the two modes that reach inside a line rather than shuffling whole units. With it on, a pasted column of twenty lines comes back as twenty reversed lines sitting in their original rows. Switch it off and the whole block is treated as one string, so in Characters mode the line breaks are reversed along with everything else and the last line arrives first. The reversal itself walks the text in grapheme clusters rather than raw code units, which is why an emoji, a flag or a letter written as a base plus a combining accent comes back in one piece.

Three things it will not do are easier to know now than to find in the output. Reversing characters moves them without mirroring them, so (final) returns as )lanif( with the brackets pointing outwards, and quotes, arrows and slashes behave the same way. Word order splits on whitespace alone, so punctuation travels with whatever word it is stuck to: one, two, three. becomes three. two, one, with the commas and the full stop carried along. Sentence order collapses every run of whitespace to a single space before it looks for endings, so line breaks, blank lines and paragraph shape do not survive that mode — the result is one continuous run of sentences.

The work happens in this browser tab, so the text is not uploaded, nothing is logged, and the page carries on reversing with the network off. Worth saying plainly as well: reversing conceals nothing. Backwards text is undone by the same tool that wrote it, and anyone who recognises what they are looking at is a paste away from reading it. Text Encryption is the tool for text that should need a passphrase.

How to use it

  1. Put the text in. Type into the left-hand box, or press Load sample for three short lines — two of them palindromes — that make the difference between the modes visible. Empty or whitespace-only input is refused with a message.
  2. Choose what to reverse. Characters for the string itself, Word order or Line order to move whole words or whole lines about, Sentence order to rearrange the sentences in a paragraph.
  3. Decide whether lines are handled one at a time. Apply to each line separately appears for Characters and Word order only, because Line order and Sentence order have no inside-the-line work to do. Leave it on to keep a list in its own rows.
  4. Read the result and copy it. The reversed text fills the read-only right-hand pane, and the hint beside Copy output names the mode that produced it. Your input is left untouched, so you can switch mode and run it again to compare.

Processing & privacy

Runs on your device. Your file is processed directly in this browser.

Common use cases

Checking a palindrome

Reverse the characters and read the two panes side by side. A line that matches in both is a palindrome, once you have discounted capitals and the spaces between words.

Flipping a log or a changelog

A file written oldest entry first reads newest first after Line order, with no sorting involved and no date column needed to sort on.

Swapping a two-word name column

Word order applied to each line separately turns a column of Surname Forename into Forename Surname in one pass, leaving every row where it was.

Building a countdown from a ranked list

Line order reverses the rows but leaves any numbers typed in front of them alone, so a list written 1 to 10 comes back with 10 at the top and the numbering running downwards.

Questions

Does anything about my text leave this tab?
No. The reversal is done by the page's own JavaScript in this browser tab, so nothing is transmitted or stored and the tab does the whole job on its own, online or not.
Why are my brackets and quotes facing the wrong way?
Characters mode reverses the order of the characters without substituting any of them. A closing bracket stays a closing bracket; it just now sits where the opening one used to be. Turning it round as well would mean rewriting the text, which is a different job from reversing it.
Do emoji and accented letters survive?
Yes, wherever the browser can segment text: the reversal works on grapheme clusters, so a flag, a skin-toned emoji or an e carrying a combining acute stays whole. On a browser without that segmenter it falls back to reversing code points, which keeps emoji intact but can leave a combining mark attached to the wrong letter.
Why did my line breaks vanish in Sentence order?
That mode normalises whitespace before it looks for sentence endings, so every newline becomes a space and the sentences are rejoined with single spaces. Use Line order when the layout matters, or put the paragraphs back afterwards.
How does it decide where a sentence ends?
On a full stop, question mark, exclamation mark or ellipsis, with exceptions for a fixed list of common abbreviations such as Mr, Dr, vs and etc., for decimal points inside numbers, and for a single capital letter and a dot, which reads as an initial. An abbreviation outside that list still counts as an ending and will split a sentence in two.
Which abbreviations does it get wrong?
Two kinds. A lowercase abbreviation with a dot inside it — e.g., i.e., a.m., p.m. — is cut at each of its dots, so the single sentence 'Take fruit, e.g. pears.' is treated as the three pieces 'Take fruit, e.', 'g.' and 'pears.', and they end up scattered through the result rather than travelling together. Capitalised forms such as U.S. and U.K. escape that, because the single-capital-and-a-dot rule catches them first. The second kind is the opposite mistake: when a listed abbreviation genuinely does end a sentence, that sentence swallows the one after it and the pair moves as a single block.
Does word order keep my indentation?
Yes. Leading and trailing whitespace on a line is held in place and only the words between them move, so an indented line stays indented. The gaps between words are reversed along with the words, so uneven spacing is mirrored rather than kept beside the word it followed.
Is a reversed string a way to hide something?
No. It is a transformation anyone can undo, this tool included, so treat it as a puzzle, a test string or a formatting step rather than protection of any kind.

Related tools