Free tool · works now

Rich-Text Paste Cleaner

Purge Microsoft Word, Google Docs, and HTML clipboard noise while preserving tables, bold, and code indentation.

Runs 100% in your browser. Sanitize clipboard rich-text copied from Microsoft Word, Google Docs, Slack, or web pages into clean, durable Markdown without losing code indentation, tables, or bold formatting.

Clipboard Sanitizer Workbench

🔒 100% Browser-Local✂️ Strips 90%+ Tag Noise📊 Preserves GFM Tables💻 Code Indentation Protected

The Engineering of Clean Clipboard Translation

When copying text between desktop word processors, cloud document suites, and local Markdown repositories, operating system clipboards carry hidden layers of styling noise, proprietary markup, and marketing telemetry. Understanding how clipboard layers work enables seamless, distraction-free knowledge capture.

1. Clipboard Multi-MIME Architecture

Operating systems (macOS, Windows, Linux) do not store a single representation of copied text. Instead, modern clipboards store a pasteboard dictionary with multiple MIME types simultaneously:

  • text/plain: Unformatted raw text, often stripping bolding, italics, links, and table columns completely.
  • text/html: Rich HTML markup containing formatting attributes, inline CSS declarations, and embedded layout objects.
  • application/x-vnd.google-docs-document-slice: Proprietary JSON representations used internally by Google Docs for collaborative styling.
  • text/rtf: Microsoft Rich Text Format encoding control words and font tables.

When pasting into rich-text capable web apps or editors, applications default to the text/html stream, inadvertently injecting thousands of unnecessary styling attributes into your notes.

2. Deconstructing Google Docs and Word Clipboard Soup

An innocent three-line paragraph copied from Google Docs can produce over 4,000 characters of hidden HTML markup. Key proprietary artifacts include:

  • Span Soup: Google Docs wraps virtually every phrase in <span style="font-family: Arial; font-size: 11pt; color: #000000;"> to simulate web typography across devices.
  • Microsoft Office Namespaces: Microsoft Word injects XML namespace tags (<o:p>, <w:WordDocument>) and conditional comments (<!--[if gte mso 9]>).
  • Class Clutter: Generic classes like class="MsoNormal" and class="kix-line" designed to enforce pagination rules inside word processing canvases.
  • Google Redirect Links: External links are proxied through https://www.google.com/url?q=... to track outbound user interactions.

3. Indentation Preservation in Code Blocks

Naive HTML strip utilities frequently strip or normalize all whitespace using regex replacements like \s+. While effective for flowing prose, this destroys code block indentation:

  1. Two-Space and Four-Space Integrity: Languages like Python, YAML, and JSON depend on semantic whitespace. Stripping leading indents results in invalid syntax errors.
  2. Preformatted Token Shielding: Our engine parses <pre> and <code> blocks first, replaces them with cryptographic placeholders, and normalizes prose whitespace independently.
  3. Exact Tab Restoration: Protected code examples are restored into standard triple-backtick Markdown fences (```) without touching internal tab stops or indentation levels.

4. Table Conversion and Column Realignment

Copying tables from Word or spreadsheets into text files usually collapses cells into tab-separated runs or unreadable blobs. Our paste cleaner reconstructs tables into GitHub Flavored Markdown (GFM):

  • Tag Normalization: Extracts <table>, <tr>, <th>, and <td> cells.
  • Uniform Column Dimensions: Detects jagged or irregular rows and balances column counts across header and body rows.
  • Pipe Delimiter Generation: Formats cell content into standard pipe tables (| Col 1 | Col 2 |) with standard GFM divider rows (| --- | --- |).

5. Typographical Standardization and Quote Uncurling

Commercial word processors automatically curl quotation marks into typographical smart quotes (“ ” ‘ ’) and replace double hyphens with em-dashes (—). In technical notes:

  • Smart quotes break shell scripts, terminal commands, and JSON code snippets.
  • Different operating systems render em-dashes and en-dashes with inconsistent font metrics.
  • Our cleaner uncurls smart typographical punctuation into standard ASCII quotation marks (" and ') and standard hyphens (-).

6. Air-Gapped Privacy and Zero Server Telemetry

Clipboard contents often contain sensitive unreleased documentation, API keys, customer emails, and confidential architecture plans. Sending clipboard data to remote cloud formatting servers introduces data leakage risks:

  • Zero Network Requests: The entire sanitization pipeline runs in JavaScript within your local browser tab.
  • No Local Storage Persistence: Pasteboard fragments are held strictly in volatile RAM memory during processing.
  • Instant Clipboard Access: Cleaned text can be copied back to your system clipboard with one click or exported to an audit CSV.

Clipboard Cleaners vs Direct Markdown Pasting

Cleaning CapabilityRaw Browser PasteGeneric Plain Text ModeOur Rich-Text Paste Cleaner
Span Soup & Inline StylesPasted verbatim (bloated)Stripped (no styles)Purged (styles converted to bold/italic)
Code IndentationOften mangled by rich editorPreserved (flat text)Bit-for-bit preserved inside code fences
HTML Table FormattingMessy rich table or divsCollapsed into tab runsClean GFM pipe tables with headers
Link SanitizationKeeps Google redirect & UTMsURLs often lostUnrolled to canonical target URLs
Smart Quote UncurlingKeeps curved quotesKeeps curved quotesStandardized to straight ASCII quotes
Audit Metrics & CSVNoneNoneDetailed payload reduction stats

Questions

Why does copying text from Google Docs or Microsoft Word pollute Markdown notes?

Both Google Docs and Microsoft Word copy an extensive hidden HTML payload to your system clipboard alongside plain text. This payload wraps every sentence and word in deeply nested <span> tags, proprietary class names (like MsoNormal or kix-line), inline CSS fonts (Calibri, Arial), explicit font sizes, and RGB color values. Pasting this into standard Markdown editors introduces structural noise and breaks portability.

How does the cleaner preserve code indentation without flattening spaces or tabs?

Preformatted code blocks (<pre> and <code>) are extracted and protected using unique cryptographic placeholder tokens before any HTML tag stripping occurs. This guarantees that two-space or four-space indentation, internal line breaks, and bracket hierarchies inside code examples survive bit-for-bit without truncation.

How does the tool handle Google redirect wrappers and tracking UTM parameters on links?

When copying text from Google Docs, external URLs are frequently wrapped inside redirect proxies (such as https://www.google.com/url?q=...). Our engine automatically unrolls the redirect wrapper to reveal the authentic destination URL and strips marketing analytics query parameters (utm_source, utm_medium, gclid, fbclid).

Can the cleaner convert messy HTML clipboard tables into Markdown pipe tables?

Yes. The engine parses HTML <table>, <tr>, <th>, and <td> structures, normalizes column widths across irregular rows, and converts the tabular content into standard GitHub Flavored Markdown (GFM) pipe tables with header dividers.

Write clean, distraction-free notes from any source

Pair local Markdown note-taking with deterministic browser utilities in Oyma. Keep your technical writing accessible and error-free.

tools rich text paste cleaner downloadDownload for Mac

No account needed. Intel Mac build