Microsoft Word strips indentation, ignores monospace fonts and shows zero colours when you paste code. Here's every method that exists to fix this — and which one actually works in 2025.
When you copy code from an IDE and paste it into Word, several things go wrong simultaneously:
Press Ctrl+Shift+S (or use Snipping Tool), capture the code, paste the image into Word.
OK for quick, single-use docsImages are not searchable, not copyable, don't scale cleanly and look blurry when printed. Any update requires a fresh screenshot.
Word has a "Code" character style that switches to a monospace font. No syntax highlighting.
Not recommendedVS Code copies rich HTML to the clipboard. In Word: Edit → Paste Special → HTML Format.
Looks promising but doesn't workVS Code's HTML uses CSS classes with a stylesheet. Word ignores the stylesheet and only reads inline style="" attributes — so colours disappear. Indentation also collapses because VS Code uses regular spaces.
FormatCode converts code to HTML with inline styles, solid colours, and non-breaking spaces that Word reads correctly.
Best overall — recommendedFor anything beyond a three-line snippet, Method 4 is the only reliable approach. Screenshots are non-editable. Word's code style has no colours. IDE copy-paste loses colours and indentation. A purpose-built formatter is the only tool that solves all problems at once.
Key insight: Word's HTML renderer only respects style="color:#hex" inline attributes, not CSS classes or variables. Any tool that generates code with CSS classes (including VS Code's native copy) will lose colours in Word.
Paste your first snippet and copy it to Word in under 30 seconds.
Open FormatCode →