Pretty HTML: Formatter, Editor and Cleaner
Free online Pretty HTML converter with powerful code-cleaning๐งน features and an easy switch between visual editing and source code. It's designed for turning messy, real-world documents into clean, readable HTML with a click of a button.
Before:
<p class="aligncenter">
<a href="https://prettyhtml.com/">
<img style="width: 200px; vertical-align: middle;"
src="/pretty-html.png"
alt="HTML Tidy" /></a><strong><br />
“Pretty HTML” —
instant HTML Formatter, Editor and Cleaner
</strong></p>
<p> </p>
<p>Press the <img style="width: 74px;
vertical-align: middle;"
src="/pretty.png"
alt="Prettify" /> button to execute the checked
<span style="background: url('/check.png') no-repeat 4px -64px;
display: inline-block; width: 20px;
height: 23px;"> </span> cleaning options:</p>
After:
<p><a href="https://prettyhtml.com/">
<img src="/pretty-html.png" alt="HTML Tidy" />
</a><strong><br />
"Pretty HTML" - instant HTML Formatter,
Editor and Cleaner </strong></p>
<p>Press the <img src="/pretty.png" alt="Prettify" />
button to execute the checked cleaning options:</p>

โจPretty HTML lets you work in two synchronized views: a visual editor on the left and a syntax-highlighted HTML source editor on the right. Type or paste in either side and the other stays in sync in real time, so you can switch freely between WYSIWYG editing and clean, readable HTML without losing control.
๐ผ๏ธ Visual editor
The operation of the visual editor is very straightforward and intuitive because it works like any common word editor program. The control bar above the text editor lists all major features you might need. Click the icnos with the small arrow pointing down to reveal and modify the hidden options.
๐ Source editor
The source editor on the right side of the screen uses colors to highlight the HTML syntax and make the tags and their attributes even more distinguishable. Above the top-left corner of this section is the character counter, the undo and the new page icons and the button to enable/disable character encoding in the HTML editor.

Want a quick tidy? Try Remove inline styles or Remove classes & IDs to simplify markup in seconds.
Why Pretty HTML?
- Edit visually without losing clean source code
- Fix common HTML problems with one click
- Work with pasted content, DOCX files, and raw HTML
- Export clean results for the web, email, or documents
Who is it for?
- Developers: clean up legacy or CMS-generated markup
- Content editors: fix pasted text without touching code
- Designers: separate content from presentation
- Marketers: prepare HTML for email and publishing
Key features at a glance
- Dual editor: Visual editing plus a syntax-highlighted HTML editor with line numbers, tag matching, and wrapping.
- One-click Pretty actions: Clean common HTML issues instantly.
- Drag & drop: Open
.htmlor.docxfiles directly in the editor. - Export: Download clean HTML or generate a DOCX file.
Cleaning tools
The options below the source editor remove common clutter. Each button triggers a specific action, and there's a Pretty multi-action for running several cleanup steps at once.
- ๐จ Inline styles - removes
style=""attributes. - ๐ท๏ธ Classes & IDs - deletes
classandidattributes. - ๐๏ธ Empty tags - removes elements with no content.
- ๐ Tags with one space - deletes elements containing only
. - ↔๏ธ Successive spaces - collapses mixed space and NBSP sequences.
- ๐ฌ Remove comments - strips
<!-- ... -->blocks. - โ๏ธ Tag attributes - removes most attributes, keeping essentials.
- ๐ Make plain text - removes all tags and keeps readable text.
- ๐ค AI Watermarks - cleans hidden characters and odd punctuation.
- ๐ง Smart NBSPs - prevents ugly single-word line wraps.
Open files by drag & drop
Drop a file onto the Open Doc or HTML area or click it to browse. Pretty HTML accepts both .html and .docx files:
- HTML: loaded directly into the visual editor and source editor.
- DOCX: converted in the browser and injected as clean HTML.
After pasting content, normalize artifacts with Remove AI watermarks before styling.
Download your work
- HTML: downloads the cleaned source as a file.
- DOCX: packages the visual editor content into a Word document.
Need a text-only version? Use HTML to plain text.
Under the hood
| Component | Purpose | Benefit |
|---|---|---|
| TinyMCE | Visual editor | Comfortable rich-text editing. It works like MS Word |
| CodeMirror | Source editor | Syntax-highlighted, editable HTML with tooling |
| Mammoth.js | DOCX → HTML | Clean, semantic conversions |
| html-docx-js | HTML → DOCX | Fast exports to Word document |
Example: quick cleanup flow
A typical workflow when pasting content from external sources:
- Open: If you have HTML code, paste it in the source editor. If you have a word document, or other visual file, then paste it in the WYSIWYG editor. Or drag-and-drop any file in the drop zone.
- Prettify: Select the desired cleaning options and execute them all with the big pretty button.

- Export: Grab the cleaned document by copy-paste or download them as a or html doc file.
For better typography, prevent widowed last words with Last HTML space to NBSP.
Save the link to the free online Pretty HTML converter with code cleaning features and easy switch between the visual and source editors. It works perfectly for any document conversion.
The HTML Tidy Legacy
Pretty HTML was previously available as HTML Tidy (HTMLtidy.net) since 2016. Since then it has the same core features: a web browser application whose purpose is to fix invalid web code, beautify the layout and formatting of the incorrect markup. The user interface is composed of two editors where you can edit your content in a linked visual and a source editor. The two fields are displayed side by side, giving you full control and flexibility in the HTML editing process.

HTML Tidy at his old domain
Cleaning up structure? Clear out empty tags and strip HTML comments in one click.
Three highlighted main options
Three highlighted main options help you tidy up your source code with a few clicks:
- The Indent button sets the code indentation in two stages. When you press it for the first time the block elements will be organized in a hierarchical view, leaving the inline tags intact inside. The second time it sets the inline elements in new lines and adds the tabs to highlight the tree structure. Please note that this changes the outcome of the code because it adds white spaces even between the attached inline elements.
- The Compress button removes the new line characters from the source code and minimizes the code.
- The main Pretty button (it was named Tidy previously) performs the predefined HTML cleaning options on the source code. To fine-tune these options, click the dropdown icon and set the desired options with the checkboxes. Your settings will be saved and will be available when you visit this site the next time.
๐ Visit HTML6 Editor for more advanced HTML editing.
Pretty HTML is a project by HTML CSS JS.





