Text FIELD NOTES · 4 MIN READ
Reversing a List of Strings, Row by Row
How batch text reversal works by characters and words, why emojis survive intact, and the honest truth about line mode on one-line rows.
Reversing a string is the first trick every programmer learns, and it is almost trivial — right up until the job is fifty rows at once, the rows contain emojis, and every output line has to land back in exactly the position its input came from. Batch reversal turns a toy problem into a lesson in text mechanics.
Three modes, applied row by row
The Reverse Text Batch tool takes one string per line and reverses each line independently, using one of three modes. On real input, the modes diverge quickly:
input: hello world | café | banana split
chars: dlrow olleh | éfac | tilps ananab
words: world hello | café | split banana
Character mode reverses every character in the line, so hello world becomes dlrow olleh — even the space moves to the middle. Word mode keeps each word's spelling intact and reverses only the order of the words, so banana split becomes split banana. Notice what word mode does to a single-word line like café: one word reversed in order is still itself, so the line comes back unchanged. That is not a bug — it is the mode doing exactly what it says.
Why emojis and accents survive
Character reversal has a classic failure mode: splitting text in the wrong places. Reverse the bytes of café and you can end up with garbage, because é may be stored as two units in memory. This tool reverses over Unicode code points rather than raw bytes, so multi-byte characters travel as single units:
input: a😀b
output: b😀a (the emoji stays intact, not split in half)
The same guarantee protects accented letters, CJK characters, and any other character outside the basic Latin range. If you have ever wondered why some "simple" text tools corrupt emojis while others handle them, the answer lives in how strings are counted — How Text Encoding Works covers the mechanics.
The line-mode caveat
The third mode, lines, is designed for reversing the order of lines in a block of text — and in this batch tool it behaves differently from what you might expect. Because the input is parsed one row per line, each row is already a single line: split it on newlines and you get one chunk, reversing a list of one element changes nothing, and the row comes back exactly as it went in. Line mode only does visible work on rows that themselves contain internal line breaks (possible when feeding the tool through its API). For everyday per-row reversal, the useful choices are character mode and word mode; flipping the order of a whole list is a job for the single Text Reverser, which reverses a block's line order in one pass.
Position is part of the contract
Every input row maps to exactly one output row at the same index — row 3 in is row 3 out. Empty rows are preserved in their position and stay empty; only blank lines at the very start or end of the paste are dropped. That mapping is what makes the tool safe for spreadsheets and tables: reverse one column of values, paste it back over the original, and nothing shifts out of alignment. This batch-versus-block distinction is the same one explored in Reverse It: Words, Lines, Texts, and it matters anywhere position carries meaning — a reversed column that scrambled its own row order would be worse than useless.
Reversal also has honest analytical uses. A word is a palindrome exactly when it equals its own character reversal, so a batch pass is a quick palindrome screen: flip every candidate and compare row by row (more on that in Palindromes and Anagrams).
Try it yourself
Paste a handful of lines — include one emoji and one accented word — into the Reverse Text Batch tool and run both character and word modes; compare what happens to the single-word lines in each. Then run the same block through the single Text Reverser with line mode to see whole-list reversal in action, and read Reverse It: Words, Lines, Texts for the full taxonomy of "backwards".