String Utilities
Reverse, repeat, trim, pad and wrap text line by line, reveal hidden whitespace and strip the invisible characters that break comparisons.
What is actually in this text
Everything runs in your browser. Nothing you paste is uploaded, which makes this safe for values you cannot put into an online tool.
What It Does
A set of small text operations that are individually trivial and collectively tedious to do by hand across a hundred lines. Reverse, repeat, trim in four different ways, pad to a width, wrap each line in a prefix and suffix. Everything applies per line, because the common case is a pasted list rather than a single value, and the line count is always preserved so the output lines up with the input. Two of the operations earn the page on their own. Reversing works by grapheme rather than code unit, so emoji and accented characters survive instead of coming apart. And the invisible-character finder locates the zero-width spaces, non-breaking spaces and byte-order marks that make two identical-looking strings refuse to compare equal — a bug that is very hard to diagnose precisely because the evidence cannot be seen.
When to Use It
- Two strings look identical but a comparison keeps failing and you need to see what is actually in them.
- A pasted list has inconsistent leading and trailing spaces that are breaking a deduplication.
- You need each line of a list wrapped in quotes and commas to paste into code as an array.
- Text copied from a PDF or a Word document is carrying non-breaking spaces that break your parsing.
- A column of values needs padding to a fixed width for a fixed-format export.
Worked Examples
hello
world
Whitespace you cannot see. Reveal it and the leading spaces, the tab and the trailing whitespace all become visible — usually the whole diagnosis when a comparison or a YAML parse is failing inexplicably.
Hello 🔒 World
The grapheme case. Reversing this keeps the emoji intact, where an implementation reversing by code unit would split it in half and produce a broken character.
alpha
bravo
charlie
A plain list, the shape most of these operations are for. Wrap each line in quotes and a comma and it becomes a code array; pad each to a fixed width and it becomes a fixed-format column.
Features
How to Use
1. Paste your text — a list works best, since operations apply per line. 2. Choose an operation from the list. 3. The result appears immediately, with a note about anything found in your input. 4. Use the reveal option to see whitespace you would otherwise miss. 5. Swap the output back into the input to apply a second operation.
Common Mistakes
- Reversing by splitting on empty. It separates surrogate pairs, so any emoji or non-BMP character comes apart into two broken halves.
- Assuming whitespace problems are visible. A trailing space, a tab and a non-breaking space all look the same as nothing at all, which is exactly why they cost so much debugging time.
- Treating a non-breaking space as a space. It is a different character with a different code point, so it fails a comparison, changes a hash, and is not matched by a plain space in a pattern.
- Padding for terminal alignment by character count. Emoji and CJK characters render double-width, so correct character padding still looks uneven in a monospace font.
- Chaining transformations blindly. Applying several at once makes it very hard to see which step produced an unexpected result — run them one at a time.