# Can you get clean HTML from MS Word?

**URL:** <https://boards.straightdope.com/t/can-you-get-clean-html-from-ms-word/102477>\
**Category:** Factual Questions\
**Created:** [April 8, 2002, 1:47pm UTC](https://boards.straightdope.com/t/can-you-get-clean-html-from-ms-word/102477 "2002-04-08T13:47:06Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![jjimm](https://avatars.discourse-cdn.com/v4/letter/j/ba8739/32.png) [@jjimm](https://boards.straightdope.com/u/jjimm)\
**Post date:** [April 8, 2002, 1:47pm UTC](https://boards.straightdope.com/t/can-you-get-clean-html-from-ms-word/102477/1 "2002-04-08T13:47:06Z")

</div>

The HTML generated by MS Word is full of extraneous guff. Does anyone know how to export HTML from an MS Word doc in a cleaner format? Or a tool that can sweep all the dross out of the HTML to leave you with something slightly more raw? Thanks.

---

<div class="post-metadata">

**Author:** ![OneChance](https://avatars.discourse-cdn.com/v4/letter/o/74df32/32.png) [@OneChance](https://boards.straightdope.com/u/OneChance)\
**Post date:** [April 8, 2002, 1:56pm UTC](https://boards.straightdope.com/t/can-you-get-clean-html-from-ms-word/102477/2 "2002-04-08T13:56:40Z")

</div>

This might help: [http://office.microsoft.com/downloads/2000/Msohtmf2.aspx](http://office.microsoft.com/downloads/2000/Msohtmf2.aspx)

---

<div class="post-metadata">

**Author:** ![jjimm](https://avatars.discourse-cdn.com/v4/letter/j/ba8739/32.png) [@jjimm](https://boards.straightdope.com/u/jjimm)\
**Post date:** [April 8, 2002, 2:03pm UTC](https://boards.straightdope.com/t/can-you-get-clean-html-from-ms-word/102477/3 "2002-04-08T14:03:07Z")

</div>

Thanks. Looks perfect.

Did you know about that already or did you search for it on MS website? If the latter, sorry for making work for you.

---

<div class="post-metadata">

**Author:** ![OneChance](https://avatars.discourse-cdn.com/v4/letter/o/74df32/32.png) [@OneChance](https://boards.straightdope.com/u/OneChance)\
**Post date:** [April 8, 2002, 2:05pm UTC](https://boards.straightdope.com/t/can-you-get-clean-html-from-ms-word/102477/4 "2002-04-08T14:05:38Z")

</div>

Already knew about it. Had the link in my bookmarks.

---

<div class="post-metadata">

**Author:** ![Johanna](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/johanna/32/8318_2.png) [@Johanna](https://boards.straightdope.com/u/Johanna)\
**Post date:** [April 8, 2002, 2:14pm UTC](https://boards.straightdope.com/t/can-you-get-clean-html-from-ms-word/102477/5 "2002-04-08T14:14:26Z")

</div>

Hardcore geeks may insist on Notepad for editing HTML, but I always use WordPad. It offers several word processor functionalities, but still gives you clean HTML and lets you save as a text file with .html extension.

I simply never let Word get anywhere near my HTML. My advice is to stick with WordPad: it gives you honest code, nothing more than what you choose to input yourself.

---

<div class="post-metadata">

**Author:** ![jjimm](https://avatars.discourse-cdn.com/v4/letter/j/ba8739/32.png) [@jjimm](https://boards.straightdope.com/u/jjimm)\
**Post date:** [April 8, 2002, 2:14pm UTC](https://boards.straightdope.com/t/can-you-get-clean-html-from-ms-word/102477/6 "2002-04-08T14:14:45Z")

</div>

Hmmm… have just installed it and can see no discernible difference between “Save As…” HTML, and “Export compact” HTML. Any other ideas?

---

<div class="post-metadata">

**Author:** ![jjimm](https://avatars.discourse-cdn.com/v4/letter/j/ba8739/32.png) [@jjimm](https://boards.straightdope.com/u/jjimm)\
**Post date:** [April 8, 2002, 2:17pm UTC](https://boards.straightdope.com/t/can-you-get-clean-html-from-ms-word/102477/7 "2002-04-08T14:17:35Z")

</div>

> [@](#):
>
> \*Originally posted by Jomo Mojo \*  
> **Hardcore geeks may insist on Notepad for editing HTML, but I always use WordPad.**

I myself use Allaire/Macromedia Homesite. The problem here is I have to convert a **huge** Word doc that someone else produced into decent HTML. It’s driving me up the wall.

---

<div class="post-metadata">

**Author:** ![OneChance](https://avatars.discourse-cdn.com/v4/letter/o/74df32/32.png) [@OneChance](https://boards.straightdope.com/u/OneChance)\
**Post date:** [April 8, 2002, 2:18pm UTC](https://boards.straightdope.com/t/can-you-get-clean-html-from-ms-word/102477/8 "2002-04-08T14:18:56Z")

</div>

In your Start \> Programs menu, you should see Microsoft HTML Filter. Did you open that?

---

<div class="post-metadata">

**Author:** ![Musicat](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/musicat/32/20189_2.png) [@Musicat](https://boards.straightdope.com/u/Musicat)\
**Post date:** [April 8, 2002, 2:34pm UTC](https://boards.straightdope.com/t/can-you-get-clean-html-from-ms-word/102477/9 "2002-04-08T14:34:02Z")

</div>

**OneChance,** I was glad to see your link, as I have a need to convert DOC files to HTML as simply as possible, too. So I downloaded the “Compact HTML” program from MS, installed it, and followed instructions to Export a DOC file.

The result had 44 lines of header pre-pended to the body! Much less than the 109 lines the “Save As HTML” function makes, but hardly compact by my definition.

My solution has been to use an old copy of Word 97 to make DOC-\>HTML files. Its “save as HTML” function doesn’t add much HTML junk to the raw text, and I can strip that out pretty easily. **jjimm** , you might try that method if available.

---

<div class="post-metadata">

**Author:** ![jjimm](https://avatars.discourse-cdn.com/v4/letter/j/ba8739/32.png) [@jjimm](https://boards.straightdope.com/u/jjimm)\
**Post date:** [April 8, 2002, 2:39pm UTC](https://boards.straightdope.com/t/can-you-get-clean-html-from-ms-word/102477/10 "2002-04-08T14:39:18Z")

</div>

I used the button in MS Word. Have tried it from the Start menu, and altered the options to make them as severe as poss; it’s still pretty horrendous, but better than nothing! Thanks.

---

<div class="post-metadata">

**Author:** ![Why\_A\_Duck](https://avatars.discourse-cdn.com/v4/letter/w/13edae/32.png) [@Why\_A\_Duck](https://boards.straightdope.com/u/Why_A_Duck)\
**Post date:** [April 8, 2002, 2:42pm UTC](https://boards.straightdope.com/t/can-you-get-clean-html-from-ms-word/102477/11 "2002-04-08T14:42:24Z")

</div>

One nice thing about Homesite is the extended replace feature. I do this all this time to strip Word HTML files. You can replace \<FONT=ARIAL with nothing, and so on to get rid of all the stupid, non-CSS and depracated stuff Word throws in there.

---

<div class="post-metadata">

**Author:** ![jjimm](https://avatars.discourse-cdn.com/v4/letter/j/ba8739/32.png) [@jjimm](https://boards.straightdope.com/u/jjimm)\
**Post date:** [April 8, 2002, 2:50pm UTC](https://boards.straightdope.com/t/can-you-get-clean-html-from-ms-word/102477/12 "2002-04-08T14:50:04Z")

</div>

Yeah, I’m on my 23rd universal find-and-replace in Homesite… Only another 50 or so to go.

I may have been dreaming, but I remember seeing once that Homesite had a “Clean up shitty MS HTML” codesweeper function. But it’s disappeared. If it ever existed. ☹

---

<div class="post-metadata">

**Author:** ![Why\_A\_Duck](https://avatars.discourse-cdn.com/v4/letter/w/13edae/32.png) [@Why\_A\_Duck](https://boards.straightdope.com/u/Why_A_Duck)\
**Post date:** [April 8, 2002, 2:55pm UTC](https://boards.straightdope.com/t/can-you-get-clean-html-from-ms-word/102477/13 "2002-04-08T14:55:22Z")

</div>

Well, you could always spend $400 and buy Dreamweaver. Apparently there is a built-in “Clean UP Word HTML” feature built into it.

---

<div class="post-metadata">

**Author:** ![jjimm](https://avatars.discourse-cdn.com/v4/letter/j/ba8739/32.png) [@jjimm](https://boards.straightdope.com/u/jjimm)\
**Post date:** [April 8, 2002, 3:06pm UTC](https://boards.straightdope.com/t/can-you-get-clean-html-from-ms-word/102477/14 "2002-04-08T15:06:26Z")

</div>

There _is_ a clean up MS Word HTML codesweeper “tidy” command in Homesite. It’s buried deep in the Settings dialog, but it’s there.

Thanks for everyone’s assistance.

---

<div class="post-metadata">

**Author:** ![Urban\_Ranger](https://avatars.discourse-cdn.com/v4/letter/u/e9c0ed/32.png) [@Urban\_Ranger](https://boards.straightdope.com/u/Urban_Ranger)\
**Post date:** [April 8, 2002, 5:31pm UTC](https://boards.straightdope.com/t/can-you-get-clean-html-from-ms-word/102477/15 "2002-04-08T17:31:28Z")

</div>

I deal with Word generated HTML files all the time, they are a pain.

I just use universal replace functions to get rid of the extra crap. The trick is to specify the searches so as to maximise extraneous tags that will be removed in one go.

Of course, having regular expressions and wildcards in your editot helps a whole lot.

---

<div class="post-metadata">

**Author:** ![jjimm](https://avatars.discourse-cdn.com/v4/letter/j/ba8739/32.png) [@jjimm](https://boards.straightdope.com/u/jjimm)\
**Post date:** [April 8, 2002, 9:08pm UTC](https://boards.straightdope.com/t/can-you-get-clean-html-from-ms-word/102477/16 "2002-04-08T21:08:50Z")

</div>

Hey - all the smilies have gone multiracial. 🆒

To all those who contributed to this thread, I urge you to try the ‘Clean up MS HTML’ function in the ‘HTML code tidy’ section of the ‘Codesweeper’ function in Homesite. It does an amazing job, and also deletes redundant tab endings, etc.
