HTML Cleaner does not perform true bulk file processing: it normalizes one pasted HTML fragment or document at a time and can optionally remove comment nodes.
For many items, repeat this single-item workflow and keep the source and result associated outside the tool. The HTML Cleaner is a browser normalization and formatting aid, not a security sanitizer. It parses pasted markup in text/html mode, serializes the parsed body's innerHTML, and shows the complete result only in a read-only textarea. It creates no live preview and does not execute parsed scripts.

What Bulk Processing Means Here
A search for an HTML cleaner in bulk usually means cleaning many CMS exports, email fragments, web components, or copied snippets. That request can involve either repeated normalization or processing an entire folder. This product supports the first task through its one-item workflow, but it does not accept multiple files, folders, archives, or a batch queue.
The distinction matters because the browser parser receives one continuous HTML document on every run. It does not keep separate file boundaries, produce a ZIP, or generate independent reports for a group. Combining unrelated items into one paste may also make their boundaries ambiguous, since the parser can repair and rearrange malformed markup.
| Task | HTML Cleaner behavior | Implication for bulk work |
|---|---|---|
| Normalize one HTML item | Supported through the browser's text/html parser | Run the workflow separately for each item |
| Process many files or folders | Not supported | Use a separate batch-capable tool or pipeline |
| Remove HTML comments | Optional deletion rule | Enable it only when comments should be removed |
| Strip active or dangerous markup | Not supported | Apply a destination-aware sanitizer separately |
| Preserve a full document shell | Not supported | Use a document-aware editing workflow |
| Preview the rendered result | Not supported | Review the read-only serialized text instead |
Prepare One Item for a Batch
Keep the original input before processing it. The result is canonical browser serialization rather than a guaranteed byte-for-byte copy, and it contains only the parsed body's child markup. A complete input document can contain a doctype, html and head sections, title, meta elements, links, styles, and a body, but those page-level parts are not copied into the returned text. Head-only metadata is excluded unless the parser moves a particular token into the body under its normal recovery rules.
The tool never uploads the pasted input to Lizely. However, a browser may still request remote resources referenced by parsed iframe or img elements. Avoid pasting sensitive HTML containing remote resource URLs when those requests could disclose information to another host.
| Boundary or condition | Verified rule | Practical response |
|---|---|---|
| Empty input | Rejected before parsing | Provide a fragment or document |
| Raw input | At most 500,000 UTF-16 code units | Process oversized items separately |
| Normalized output | At most 1,000,000 UTF-16 code units | Review the complete serialization before use |
| Parser failure | Parser exceptions, missing body output, or invalid parser results are reported | Correct the input or reduce the item |
| Empty parsed body | A valid zero-length output | Confirm that the item belongs in the body |
The exact 500,000-unit input boundary and 1,000,000-unit output boundary are accepted. Exceeding either boundary by one unit fails with an explicit message.
Run the Cleanup Batch
- Define one logical HTML item. Choose a fragment or complete document and keep its original source available. If the item belongs in a page body, remember that only the parsed body's markup will be returned.
- Paste the item into HTML Cleaner. The paste field accepts one fragment or document. Although the input stays local, review it for remote iframe or img URLs that could cause network requests.
- Choose the comment option. Enabling it removes Comment nodes from the parsed body and nested template fragments. Disabling it leaves comments in the serialized structure. No other deletion rule is applied.
- Normalize and read the result. Review the complete body-only text and the reported comment-removal count. The output remains in a read-only textarea, so there is no rendered preview or execution context inside the tool.
- Inspect the markup before copying it. Look for scripts, inline event attributes, javascript URLs, iframes, forms, styles, SVG, MathML, and other active content. A forgiving parser may repair malformed tags, but it does not make their contents safe.
- Decide whether the destination requires sanitization. For untrusted content, use a maintained sanitizer configured for the target context before publishing, storing, or injecting the result. The cleaner's own output is not a security guarantee.
- Copy the complete result and continue. If clipboard access is denied, select the complete read-only output manually. Then move to the next item; editing the input or changing the comment option clears the previous result, error, statistics, copy status, and copy timer.
Understand the Normalized Output
Browser normalization is different from beautification. The HTML parser and body.innerHTML serialization can produce several predictable changes:
- Element names may be lowercased and attribute values may receive canonical quoting.
- Implied elements such as tbody may be inserted into table structures.
- Some missing closing tags may be repaired.
- Markup may be rearranged according to the browser's HTML tree-construction rules.
- Source indentation, wrapping, attribute order, and whitespace are not guaranteed to remain unchanged.
This forgiving behavior explains why malformed HTML often produces output instead of an XML-style parsing error. HTML Cleaner is not a strict validator and cannot prove that the recovered structure matches the author's intention. It also is not a conventional pretty printer: it does not promise stable indentation, source-whitespace preservation, attribute sorting, or byte-identical results across every browser version.
The serialization boundary follows the browser's body.innerHTML model, as described in MDN's Element.innerHTML reference. This is why a full document can lose its doctype and head-only content. It is also why the output should be treated as normalized body markup, not as a complete page document.
Keep Normalization Separate From Sanitization
Comment removal is the tool's only optional deletion rule. It does not remove scripts, style elements, inline CSS, iframes, forms, SVG, MathML, event-handler attributes, javascript URLs, remote URLs, data attributes, IDs, classes, unknown elements, or unknown attributes. It does not rewrite URL schemes, enforce a content policy, or apply an allowlist.
The parser runs in a separate document without a browsing context, so parsed scripts do not run during parsing. This behavior is also covered by MDN's DOMParser.parseFromString documentation. Nevertheless, copying the output into an active page, CMS field, email template, or another execution context can make preserved behavior active there.
A read-only textarea and disabled scripting protect the cleaner's own interface, not the eventual destination. Use a maintained, destination-aware HTML sanitizer whenever the source is untrusted or the output will be injected into a live DOM.
Handle Errors and Large Inputs
The raw input limit is checked before parsing, and the complete body serialization is measured before a result is exposed. Nothing is sliced, sampled, partially serialized, or silently processed under a different cleanup policy. If the parser reports an API exception, the body is missing, or the parser returns an invalid result, the interface surfaces the error instead of returning truncated output.
An empty body after parsing or comment removal is valid and produces a zero-length result. This can be meaningful for a body-only fragment whose content was entirely comments, but it can also reveal that the input did not contain the body markup you expected.
Clipboard state is invalidated whenever the input or comment option changes. A delayed permission response from an older copy attempt cannot restore stale status after an edit, retry, or unmount. If permission is denied, the complete output remains available for manual selection.
Choose a Different Workflow When Needed
Use another approach when the required result falls outside this product's contract:
- Use a document-aware editor when the doctype, head, and complete page shell must be preserved.
- Use a batch-capable script or tool when multiple files must be processed automatically.
- Use a strict validator when standards conformance must be checked.
- Use a dedicated formatter when indentation or minification is the primary goal.
- Use a maintained sanitizer when active markup must be removed for a live destination.
For an HTML cleaner bulk workflow, HTML Cleaner is appropriate only for repeated, manual normalization and optional comment removal of body markup. It is not a multi-file cleaner, a full-document formatter, a strict validator, or a security sanitizer.
If you're weighing options, How to Edit Website Templates Online with HTML covers this in detail.
If you're weighing options, Convert HTML to JavaScript Variable: Raw Markup covers this in detail.