Plain Text Converter: What Removing Formatting Changes Before You Compare Text
Learn what a plain text converter strips out, from styling and Unicode lookalike letters to hidden characters, and how to check that the output is safe to compare, paste and share.
A plain text converter takes text that carries extra presentation, such as bold, fonts, colors, links, stylized characters or hidden control codes, and returns only the characters themselves. This matters most when you compare two versions of a document. Formatting differences can bury the real wording changes, or make two identical passages look different to a comparison tool. This guide explains what removing formatting actually changes, where it falls short, and how to check that the result works for your purpose.
What a plain text conversion actually changes
"Formatting" covers several technically different things. A converter may handle some of them and ignore others, so it helps to know which layer each one lives in.
Rich-text and markup styling
Text copied from a web page, word processor or email usually carries styling as separate instructions: HTML tags, CSS rules, RTF codes or a document's internal style data. The letters underneath are ordinary characters. Removing this layer drops bold, italics, font size, color, tables and hyperlinks, and leaves the readable words. This is the most common meaning of making text plain, and it is the least risky, because the characters are not altered.
Unicode "font" characters
Text produced by so-called font generators often contains no styling at all. Each letter is replaced with a different Unicode character that looks styled, such as characters from the Mathematical Alphanumeric Symbols block that resemble bold, italic or script letters. To software, a bold-looking A of this kind is a different character from a regular A, so a comparison tool treats it as different text and search will not match it. Stripping markup does nothing here. The text has to be mapped back to standard letters, usually through Unicode compatibility normalization (NFKC or NFKD), which defines a plain equivalent for many of these characters.
Compatibility normalization is broad. It also folds superscripts, ligatures, full-width forms and similar characters into their base forms, so a superscript two becomes an ordinary 2 and "x²" turns into "x2". If those distinctions carry meaning in your text, as in formulas, units or footnote markers, review the output rather than assuming it is equivalent.
Reversed, mirrored and upside-down text
Terms like "mirror text" describe how text looks, not how it was made. The method decides whether a plain text converter can undo it:
- Character-order reversal rewrites the sequence of characters, so "plain" becomes "nialp". This is a content change. Removing formatting will not restore the original order; you need to reverse it again.
- Visual mirroring through CSS, such as a horizontal flip transform, changes only the display. The underlying characters stay in their original order, so copying or converting yields normal text.
- Lookalike substitution builds flipped or upside-down text from other Unicode characters that resemble rotated letters. Many of these have no normalization mapping back to standard letters, so they usually survive conversion unchanged and need a dedicated reverse mapping.
Bidirectional controls and invisible characters
Some characters change how text is displayed or broken without being visible. Examples include bidirectional controls such as the right-to-left override and directional isolates, zero-width spaces, the byte order mark, soft hyphens and non-breaking spaces. Two lines can look identical while differing in these characters, which produces confusing comparison results. Some reversed-looking text is created this way: the stored order is normal, but a directional override makes it display backward. Removing the control restores normal display.
Not every invisible character is noise. The zero-width joiner and zero-width non-joiner are needed for correct spelling in some scripts, including Persian and several Indic languages, and for many emoji sequences. Directional marks can be necessary for mixed right-to-left and left-to-right text to display correctly. Blanket removal can damage that text.
Whitespace, line endings and punctuation variants
Comparisons are also thrown off by differences that are not formatting in the visual sense: Windows versus Unix line endings, tabs versus spaces, trailing spaces, and curly versus straight quotation marks. Some converters normalize these and some leave them alone, and Unicode normalization does not convert curly quotes to straight ones. Many comparison tools also offer their own options to ignore whitespace, case or line-ending differences. Check what your converter and your comparison tool each do before deciding which step should handle these.
Choosing the right approach for comparing text
Match the method to the kind of difference you want to ignore. Applying more cleanup than you need can hide real changes.
| Situation | What to remove or normalize | Main caution |
| Comparing text copied from web pages or documents | Markup and styling (paste or save as plain text) | Links and table structure are lost; line breaks may shift |
| Text contains stylized "font" letters | Apply compatibility normalization (NFKC) | Superscripts, ligatures and similar characters are also folded |
| Lines look identical but compare as different | Zero-width characters, byte order marks, soft hyphens, stray directional controls | Keep joiners and directional marks that the language needs |
| Versions come from different operating systems | Line endings, trailing whitespace, tabs | Whitespace may be meaningful in code or fixed-width layouts |
| Text appears reversed or flipped | Identify the method first (reordering, CSS, lookalikes or bidi override) | Formatting removal alone often does not restore it |
| Only wording changes matter | Combine the steps above, then compare | Check a sample by eye so meaningful changes are not normalized away |
If you run the conversion yourself, a short script lets you see exactly what changes. The Python example below normalizes compatibility characters, removes a selected set of invisible and directional control characters while keeping the zero-width joiner and non-joiner, and unifies line endings. Adjust the character list to your content.
import re
import unicodedata
# Zero-width space, LRM/RLM, embeddings/overrides, isolates, BOM, soft hyphen.
# ZWNJ (U+200C) and ZWJ (U+200D) are deliberately kept.
INVISIBLE = re.compile(r"[\u200b\u200e\u200f\u202a-\u202e\u2066-\u2069\ufeff\u00ad]")
def to_plain(text):
text = unicodedata.normalize("NFKC", text)
text = INVISIBLE.sub("", text)
text = text.replace("\r\n", "\n").replace("\r", "\n")
return text
Run both versions through the same function before comparing. Applying cleanup to only one side creates differences instead of removing them.
Will the plain text stay readable and usable?
Copy and paste behavior
When you copy from a formatted source, the clipboard commonly holds more than one representation at once, such as an HTML or rich-text version alongside a plain-text version. The destination decides which one to use. That is why the same copy can paste with formatting in one application and without it in another. Many applications provide a paste-as-plain-text command, but its name, shortcut and exact behavior vary, so confirm it in the application you are using.
The layers behave differently on transfer. Markup styling is often dropped when text moves into a plain-text field. Unicode "font" characters and invisible characters are part of the text itself, so they usually travel with it and reappear in the comparison. CSS mirroring never travels, because it was never in the text. If formatting keeps coming back, it is probably stored in the characters rather than applied on top of them.
Accessibility
Converting stylized Unicode letters back to standard characters generally improves accessibility. Assistive technologies are built around standard letters. Mathematical-style characters may be announced by their symbol names, read letter by letter or skipped, depending on the screen reader, its version and its settings. If accessibility is the reason you are converting text, check the result with the assistive technology your readers actually use, since behavior is not uniform.
Removing formatting can also remove meaning that was carried visually. Emphasis, headings, list structure and link destinations disappear. If any of these mattered, restate them in words or keep a formatted copy alongside the plain version.
Compatibility at the destination
Plain standard characters are the most broadly supported form of text, but "plain" does not guarantee identical results everywhere. Systems still differ in character encoding, line-ending handling and support for non-Latin scripts. Before relying on converted text in a database import, form field, code file or comparison report, paste a sample that includes any accented letters, non-Latin script, emoji or special punctuation, and confirm it appears correctly.
Sensitive text and online converters
An online tool for removing formatting may process text in your browser or send it to a server. Unless the tool documents that processing stays local, assume your text may be transmitted, logged or retained. Do not paste contracts, personal data, credentials, unreleased material or other confidential text into a service you have not vetted. For sensitive comparisons, use an offline method instead: your editor's plain-text paste, a plain-text editor, or a local script like the one above.
What this guide cannot confirm
No test results for specific converters, comparison tools, screen readers or platforms were available for this guide. It therefore describes how the underlying text layers behave, not how any particular product performs. Before you rely on a tool for an important comparison, run a small test: include styled letters, an invisible character, mixed line endings and any script you depend on. Then check that the output is what you expect.