Swelıty
Tools for everyone

Free Online HTML Playground

Write HTML and see a live preview as you type. Edit a full page with its own styles, then copy it or download it as an HTML file.

Auto-run is on, so the preview updates as you type. Scripts do not run in this preview.

HTML

Preview

How to use

  1. Edit the HTML in the editor. You can write a whole page, or only the parts inside the body.

  2. Watch the preview on the right update as you type.

  3. Add a style element in the head to style the page, or use the CSS Playground to keep your styles in a separate tab.

  4. Copy the code, download a zip of your files or clear the editor with the icons above it.

  5. Open the full screen editor for more room, and use the A buttons to resize the text.

  6. Press Format to tidy the tab you are editing, or untick Wrap long lines to scroll sideways instead.

Why use this tool

  • Live preview

    The preview refreshes a moment after you stop typing, so you always see the current result.

  • Syntax highlighting

    A code editor with colours, line numbers, bracket matching, undo and redo.

  • Isolated preview

    The preview runs in an isolated frame, so it cannot reach this site or your other tabs.

  • Copy or download

    Copy your code with one click, or download the page as a ready-to-open HTML file.

  • One-click formatting

    Tidy the indentation and spacing of the tab you are editing with one click or Shift + Alt + F.

  • Comfortable editor

    Resize the text, switch line wrapping on or off, or go full screen with the editor and preview side by side.

About this tool

Write HTML and see the page update as you type. This online HTML editor gives you a live preview with no files to create and no project to start, so it is quick to try markup, build a layout, sketch an email or landing page idea, or learn HTML from scratch. Write a full document or just a few tags. When you are happy with the result, copy the code or download it as an HTML file.

Frequently asked questions

No. Scripts are turned off in this preview so the page can update as you type without any risk of a script that never ends. Use the JavaScript Playground to run scripts.

Yes. Images, fonts, media and stylesheets can be loaded over https. Scripts and network requests are blocked in this preview.

Your latest code is kept in this browser on this device so it is still there when you come back. Use the clear icon in the editor to start from scratch. After you clear everything, the example is shown again the next time you visit.

The copy icon in the editor puts the code you are editing on your clipboard. The download icon saves the whole page as an HTML file you can open in any browser.

Yes. Press Format, or Shift + Alt + F while you are typing, to tidy the tab you are editing. If the code has a syntax error it is left unchanged and the problem is shown under the editor.

Yes. Untick Wrap long lines under the editor and it scrolls sideways instead. Your choice is remembered on this device.