HTML Viewer & Live Editor

Write HTML code and see the rendered output update instantly.

HTML Editor 0 chars
Live Preview
← All 140+ Free Tools 💻 Developer & Code Tools

About HTML, CSS & JS Live Previewer

This HTML viewer is a small code playground: write HTML, CSS and JavaScript and see the result instantly in a preview pane. Switch between split, editor-only and preview-only views, insert common tags with one click, import a file, and copy or save your code — ideal for testing a snippet, learning HTML or trying a layout.

How to use it

  1. 1Write or paste your HTML, CSS and JavaScript into the editor, or import an .html file.
  2. 2Watch the live preview update as you type; switch between Split, Editor and Preview views.
  3. 3Copy your code or click Save to download it as an .html file.

A good starter template

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Test</title>
  <style>
    body { font-family: system-ui, sans-serif; margin: 2rem; }
  </style>
</head>
<body>
  <h1>Hello</h1>
  <script>
    console.log('ready');
  </script>
</body>
</html>

The viewport meta tag is what makes pages display correctly on phones.

Uses

  • Learning: see immediately what each tag and CSS property does.
  • Email templates: check how a newsletter layout looks before sending.
  • Debugging: isolate a broken component from a large site to find the cause.
  • Prototyping: sketch a landing page section or a widget.
  • Sharing: save the file and send it to a colleague.

Tips

  • Put scripts at the end of the body (or use defer) so the HTML exists before the script runs.
  • Use the browser's developer tools (F12) to inspect the preview and see console errors.
  • External libraries can be loaded with <script src="/tools/tls/..."> from a CDN, if your network allows it.
  • Code runs in your browser only; save your work, as the editor is not stored online.

To preview an HTML file that is already on GitHub, use the GitHub HTML Previewer.

Learning HTML step by step

A live previewer is one of the fastest ways to learn, because you see every change instantly. A good order to learn in:

  1. Structure: headings (<h1>–<h6>), paragraphs, lists and links.
  2. Images and media: <img> with alt text, <video> and <audio>.
  3. Semantic layout: <header>, <nav>, <main>, <section>, <article> and <footer>.
  4. Forms: <form>, <input>, <label>, <select> and <button>.
  5. CSS basics: colours, fonts, the box model (margin, border, padding) and Flexbox.
  6. A little JavaScript: respond to a button click and change text on the page.

Change one thing at a time and watch what happens — that is how the rules stick.

Debugging what you see

If the preview does not look right:

  • Check that every tag is closed — a missing </div> can push everything after it into the wrong place.
  • Open the browser's developer tools (F12) and look at the Console for JavaScript errors.
  • Check CSS spelling — a misspelled property is silently ignored.
  • Add a temporary border (* { outline: 1px solid red; }) to see the size of every box.

Frequently Asked Questions

How do I view HTML code as a web page?

Paste the code into the editor. The preview pane renders it straight away; use Preview view to see the page full width.

Can I use CSS and JavaScript in the previewer?

Yes. Put CSS in a <style> tag and JavaScript in a <script> tag inside the same document.

Can I use external libraries like Bootstrap or a Google Font?

Yes. Add the library's <link> or <script> tag from its CDN, as you would in a normal page. You need to be online for it to load.

Can I open an existing HTML file?

Yes. Use Import to load a file from your device, edit it, and Save to download the result as an .html file.

Is my code saved?

It is not uploaded anywhere. Save it to your device before closing the tab so you don't lose your work.

Where can I see console.log output from my code?

Open your browser's developer tools (F12 or Ctrl + Shift + I) and look at the Console tab.

Why does my script not find an element?

The script probably runs before the element exists. Put the <script> at the end of the body or wrap your code in a DOMContentLoaded listener.

Is this a good place to learn HTML?

Yes. You can change one tag at a time and see the effect immediately, without creating files or installing an editor.