or drop a file here, or paste code below

Start typing, open a file or load the sample to see the preview.

Files never leave your browserHow?

HTML editor, HTML formatter and minifier

Write or paste HTML, CSS and JavaScript and watch the page update as you type. Format, minify and check your code, then download the .html file. Everything stays in your browser.

How it works

  1. Type, paste or open a file

    Type in the code panel, paste markup, drop an .html file or load the sample.

  2. Watch the live preview

    The preview updates as you type. Switch between Fit, Desktop, Tablet and Phone widths.

  3. Format, minify and download

    Use Format as an HTML formatter, Minify to shrink the file and Check to find unclosed tags, then download.

Features

  • Autocomplete and auto-closing tags

    Suggestions for tags and attributes, matching closing tags inserted for you, bracket matching, code folding and search and replace.

  • Live preview in a sandbox

    The page is rendered in an isolated frame. Scripts run only when you turn on Run JavaScript, and even then they cannot reach this site, your cookies or storage.

  • HTML formatter

    Re-indent messy markup with 2 spaces, 4 spaces or tabs and optional line wrapping. Formatting the same code twice gives the same result.

  • HTML minifier

    Collapse whitespace, remove comments and minify inline CSS and JavaScript; the size saving is shown.

  • Basic checker

    Lists unclosed and stray tags, duplicate ids and attributes. Click an item to jump to the line.

  • Device widths

    Preview at 1280, 768 and 375 pixels or open the page in a new tab.

Limits & privacy

Documents can be up to 5 MB. Above 2 MB syntax highlighting, autocomplete and the live preview are switched off to keep the page responsive; press Refresh preview to update it. Drafts are stored only for documents up to 1 MB.

The checker looks at tag structure, ids and attributes; it is not a full W3C validation. Formatting and minification run in a background worker on your device. External images and styles of your page can be blocked. See the privacy page.

FAQ

How do I edit an HTML file online?

Click Open file or drop the .html file on the code panel, make your changes and press Download .html. The file is read in your browser and never uploaded.

Is this online HTML editor free?

Yes. There is no sign-up and no watermark.

Can I edit HTML on a Mac, iPhone or Android phone?

Yes. The editor runs in Safari, Chrome, Edge and Firefox. On a phone, switch between the Code and Preview tabs.

How do I edit HTML in Chrome without an extension?

Open this page in Chrome. You get a code editor with a live preview, so you do not need to install an extension or use developer tools.

Can I edit the HTML of a live web page?

Save the page from your browser as an .html file, open it here and edit the code.

Will my code be lost if I close the tab?

No. Documents up to 1 MB are kept as a draft in this browser and restored on your next visit. Clear draft removes them.

Does the editor run JavaScript?

Only when you turn on Run JavaScript. Scripts then run in a sandbox without access to this site; turn the switch off if a loop freezes the preview.

Related tools