HTML Editor
Write HTML with a sanitized live preview and local-only autosave; scripts, event handlers and external resources are removed.
- Runs locally in your browser
- No upload required
Capabilities
- Drag and drop
- Local file intake
- Download result
Try it
Supported formats
Privacy
Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.
Sanitized HTML preview for a 50 characters across 1 line(s).
How it works
- The HTML fragment is passed through the allowlist sanitizer before it is shown.
- Active content (scripts, event handlers, dangerous URLs, SVG/MathML and external resources) is removed; the result is rendered only inside an empty-token sandboxed preview.
- Counts: 50 characters, 2 words, 1 lines.
Methodology
- Scan the fragment into text and tag tokens, tracking quoted attribute values so a `>` inside an attribute never ends a tag.
- Remove active and embedded elements (script, style, iframe, object, SVG/MathML and their content) and drop resource elements.
- Keep only allowlisted tags and attributes; remove every `on*` handler and any URL whose scheme (after entity decoding) is dangerous.
- Render the sanitized fragment only inside an empty-token sandboxed preview frame.
Usage
- Type or paste an HTML fragment into the editor; the sanitized preview updates as you type.
- Use Format to indent the markup with the shared HTML formatter.
- Turn on “Keep in this browser” to autosave locally; use Clear/Reset to remove the stored document.
Examples
These are examples, not current values: they use fixed inputs, while the interactive tool computes live results in your browser.
A heading and a paragraph
{
"text": "<h1>Title</h1><p>Hello <strong>world</strong>.</p>"
}Renders accepted markup as-is.
A script tag is removed
{
"text": "<p onclick=\"steal()\">Hi</p><script>alert(1)</script>"
}The event handler and script element do not survive sanitization.
Limitations
What is removed
Scripts, styles, embedded documents, SVG/MathML, event-handler attributes and dangerous URLs are removed, and only allowlisted tags and attributes survive.
The sanitized result renders inside an empty-token sandbox, so even a sanitizer miss cannot execute a script.
Local-only autosave
Autosave is off by default. When enabled, the fragment is stored only in this browser and Clear/Reset removes it.
Frequently asked questions
- Is my HTML uploaded?
- No. The fragment is sanitized and previewed in your browser only.
- Why is my script tag gone?
- User code is never executed. Script elements and event handlers are removed before the preview is shown.
Sources
Send feedback
Tell us if this tool helped, report a problem, or suggest a tool. Only the message you type is sent — never the input you used in the tool.
Was this tool useful?
Prefer to write to us directly? See the contact page.