HTML Online Editor
HTML
Preview
How to Use This HTML Online Editor
Debugging a broken email template or a landing-page partial usually means saving the file, refreshing a local server, and squinting at layout shifts you cannot explain. I keep this editor open when I need a split view: HTML on one side, rendered output on the other, with no install step and no upload queue. Paste markup, watch the preview update as you type, then copy or download when the layout matches what you expect.
The workflow mirrors classic desktop HTML tools: edit source, inspect preview, tweak CSS, repeat. Your draft autosaves in browser storage so a accidental tab close does not wipe an hour of table cleanup. Nothing leaves your machine unless you explicitly save or copy—useful when the snippet contains staging URLs, internal copy, or client names.
- Paste or open HTML in the source pane. Full documents, fragments, and CMS exports all work. Use Open for
.html,.htm, or plain text files from disk. - Pick a script mode before you trust the preview. No scripts strips
<script>tags so you can safely inspect unknown markup. Secured scripts runs JavaScript inside a sandboxed iframe. Allow scripts behaves closer to a normal browser tab—only use that with code you wrote or fully trust. - Choose preview behavior. Default preview is read-only rendering. Editable preview lets you click text in the iframe and edit it visually; changes flow back into the HTML source so you can fix typos without hunting line numbers.
- Frame the viewport when you care about mobile layout. Presets match common phone and tablet sizes; User defined sets exact width and height in pixels for odd embed sizes or kiosk screens.
- Find and replace across the source when renaming classes, swapping tracking IDs, or updating brand colors in a large static block. Replace hits the current or next match; Replace All rewrites the whole file in one pass.
- Save, copy, or clear when finished. New resets to a starter template after confirmation. The status bar shows line, column, and character count so you can align with CMS limits before paste-in.
To get started quickly, leave the default sample in place and change one heading color in the embedded <style> block—you should see the preview shift within a second. If the preview stays blank, check for unclosed tags or a missing </body>; the source editor does not auto-fix syntax, but the iframe usually still renders partial HTML for troubleshooting.
HTML Editor Workflows and Practical Applications
Email and newsletter HTML is the everyday use case. Tables-for-layout messages from legacy tools are painful to edit in a WYSIWYG that rewrites tags. Paste the raw HTML here, switch to a narrow phone viewport, and fix overflow before it hits inboxes. Keep scripts disabled—most clients strip JavaScript anyway, so a script-free preview matches production more closely than a live DOM with handlers attached.
CMS and static-site partials benefit from editable preview when a stakeholder wants copy changes without touching the repo. Click the headline in the preview, rewrite it, then copy the updated source into your component file. Pair that with our Code Minify & Prettify tool when you need indented HTML for Git diffs or minified HTML for an embed.
Component and widget prototypes—charts, calculators, pricing tables—often start as a single HTML file with inline CSS. Use secured script mode to test a small interaction, then scale up in your framework later. When the markup is mostly tables, generate the skeleton in the HTML Table Generator and paste the output here for styling passes.
QA and support tickets sometimes arrive as “this block renders wrong” with no context. Paste the suspect fragment, toggle viewports, and compare against the customer’s described device. Find/replace helps when the bug is a repeated typo in class names across fifty rows.
Moving onto vector assets: inline SVG icons belong in the SVG Viewer & Editor first, then embed the cleaned markup into your HTML document on this page. For long-form draft copy before you wrap it in tags, draft text in the Online Notepad and paste structured sections here as you add headings and lists.
Preview Viewport Presets Reference
The viewport dropdown does not change your HTML—it only resizes the preview iframe so you can judge layout at realistic screen widths. Use it like a paper window on a larger monitor.
- Default: Full-width preview within the tool card—best for desktop-first landing sections and wide tables.
- Large preview: Taller frame (about 36rem) for long-scrolling pages without constant iframe scrolling.
- Large iPhone (414×896): Common Plus/Max logical size for iOS layout checks.
- iPhone (390×844): Modern standard iPhone portrait frame.
- iPad (820×1180): Tablet portrait for split-column layouts and navigation drawers.
- Android New (393×873) / Android (360×800): Typical Material phone widths; compare both when a flex row wraps unexpectedly.
- User defined: Enter exact pixel width and height—for example a ***375×667*** legacy frame or a ***1280×720*** embed box.
Custom dimensions apply only to the preview chrome. They do not inject a viewport meta tag into your document; add <meta name="viewport" …> in your source if you need responsive CSS to activate inside the iframe.
Frequently Asked Questions
Is my HTML uploaded to a server?
No. Preview rendering, find/replace, and autosave run entirely in your browser. Content stays on your device unless you download, copy, or paste it elsewhere yourself.
Why do scripts not run in “No scripts” mode?
That mode removes script tags before preview so you can inspect untrusted markup without executing unknown code. Switch to secured or allow scripts when you need to test JavaScript you control.
What is the difference between secured and allow scripts?
Secured scripts runs JavaScript inside a sandboxed iframe with limited capabilities—enough for many demos and form tests. Allow scripts removes the sandbox for behavior closer to a normal tab; use it only with trusted code.
Does editable preview change my formatting?
The browser may normalize HTML when you edit in the preview—for example inserting implied tags or changing quote style. Treat editable preview as a quick copy fix, then prettify the source with Code Minify & Prettify if you need consistent indentation before commit.
Can I test external CSS or image URLs?
Yes, as long as the remote host allows iframe embedding and CORS rules permit loading. Broken previews often mean a blocked hotlink or a missing HTTPS asset—fix the URL in source and the preview refreshes automatically.
How is this different from Code Minify & Prettify?
This page is for writing and visually checking HTML with a live preview, device frames, and optional script modes. Code Minify & Prettify formats or compresses code you already finished—it does not render a page or simulate phone sizes.