Run HTML Code Online

Run and test HTML code online: paste your HTML code or upload an .html file, press Run, and see the rendered HTML with its CSS and JavaScript. The built-in console shows console.log output and JavaScript errors. All code runs in your browser, and nothing is uploaded to the Internet. It's free.

About Online HTML Runner

The HTML runner renders HTML code (with its CSS and JavaScript) and displays the final result in your browser. Paste HTML code into the editor or upload an .html file, then press Run to see the result. Use it to test HTML email templates, try a page layout or learn HTML, CSS and JavaScript.

  • Run HTML, CSS and JavaScript code online
  • Render the page with its styles, images, tables, forms and links
  • Show console.log, console.warn and console.error output
  • Show uncaught JavaScript errors and rejected promises
  • Load CSS files, scripts and images from https:// addresses
  • HTML, CSS and JavaScript syntax highlighting
  • Upload an .html or .htm file from your disk
  • Copy the console output
  • Free to use

What is HTML?

HTML (HyperText Markup Language) is the markup language of web pages. Tags such as <h1>, <p>, <a> and <form> describe the headings, text, links and forms of a page. CSS sets how the page looks, and JavaScript makes it interactive; both can be written inside an HTML file, in <style> and <script> tags. HTML files use the .html or .htm extension.

What is an HTML runner?

An HTML runner renders HTML code and runs its JavaScript, so you can test the code without saving it to a file and opening it in a browser. To view a finished HTML page or an HTML email, open it in the HTML Viewer.

How to run HTML code online?

Paste your HTML code into the editor and press Run. To run an HTML file, press Upload and choose an .html or .htm file: the HTML runner opens it and runs it at once. Messages from console.log and JavaScript errors appear in the console.

How does the HTML runner work?

Your browser renders the HTML and runs its JavaScript, as with any web page. Nothing is uploaded to the Internet. Messages from console.log and JavaScript errors are shown in the console.

HTML Runner Example

Below is an example of HTML code and its console output.

HTML Code Example
<!DOCTYPE html>
<html>
<head>
  <style>
    h1 { color: #2a6db0; }
  </style>
</head>
<body>
  <h1>Hello, World!</h1>
  <button id="button">Click me</button>
  <script>
    let clicks = 0;
    document.getElementById('button').addEventListener('click', function () {
      clicks++;
      console.log('Button clicked:', clicks);
    });
    console.log('Page loaded');
  </script>
</body>
</html>

Console Output After Two Clicks
Page loaded
Button clicked: 1
Button clicked: 2

What runs in the HTML runner?

  • Styles in <style> tags and style attributes are applied.
  • Scripts in <script> tags run.
  • CSS files, scripts and images load when their address starts with https://, such as https://example.com/style.css.
  • Files linked by a relative path, such as css/style.css, are not found.
  • console.log lines go to the console as written; console.info, console.warn, console.error and console.debug lines are marked with their level, such as [warn].
  • Uncaught errors and rejected promises go to the console as [error] lines.
Updated: