Render / check / debug

HTML Code Tester

Paste HTML with its CSS and JavaScript and test it in one step. The page renders on the right, while markup problems and JavaScript errors are listed underneath with their line numbers. It is the quickest way to find out why a snippet does not work.

Live resultMarkup problems with line numbersJavaScript errors and console output
Try it here

Test your HTML

Paste a page or a snippet and select Test HTML. Select any markup problem to highlight it in your code; JavaScript messages appear as the page runs, including after you click its buttons.

Your code runs in a sandboxed frame in your browser and is never uploaded. The markup check covers the most common mistakes rather than the full HTML standard, and JavaScript errors only appear for code that actually runs, so click through the page as well.

HCODX / test result

    How it works

    Three checks in one run

    Many bugs only show up in one place. Looking at all three together saves guessing.

    Browsers repair broken HTML silently, so a page can look right while a label is attached to nothing or an element ends up in the wrong place. JavaScript fails just as quietly: a mistyped id stops a button working, but the page itself shows no message. Looking at only the rendered result misses both kinds of problem, which is why the tester puts the result, the markup check and the console next to each other.

    The example that loads first contains three planted bugs. The image has no alt attribute, the label's for value does not match the input's id, and the script looks for an element called mesage instead of message. The first two are listed as soon as you run the test. The third only appears when you select Join, because the faulty line runs inside the click handler, which is a good reminder to try every control before deciding a page works.

    Your code runs in a sandboxed frame with an anonymous origin. Scripts, styles, images and fonts from https addresses load normally, but the code cannot read anything this site stores in your browser, and nothing you paste is sent to a server.

    See it

    The rendered page updates on every test, with scripts and styles running.

    Check it

    Unclosed tags, broken label links, missing alt text and more, by line.

    Debug it

    JavaScript errors and console.log output from the page, as they happen.

    Method

    A reliable way to test a snippet

    Random changes waste time. Work from the smallest example and one fix at a time.

    01

    Make it small

    Copy only the part that misbehaves and the CSS and JavaScript it needs. Smaller tests have fewer places for a bug to hide.

    02

    Test and read

    Run the test and read the list from the top. The first problem often causes the ones after it.

    03

    Fix one thing

    Change one line, test again and confirm that problem is gone before moving on to the next.

    04

    Use the page

    Click buttons, open menus and submit forms. Event code only runs, and only fails, when something triggers it.

    When the small test works, copy the fix back into the full page and test that too.

    Example

    Reduce a problem to a minimal test case

    A menu that will not open on a large page usually comes down to a few lines.

    Instead of pasting a whole page, keep just the button, the menu and the script that connects them. In this reduced case the problem is easy to see: the script looks for menu-btn but the button's id is menu-button, so getElementById returns null and the next line throws a TypeError when the page loads.

    Minimal test cases are also what people ask for when you request help on a forum or report a bug. Open the reduced code in the HTML Runner from the button above the result and share the link it gives you.

    A reduced test case with one bug
    <button id="menu-button">Menu</button>
    <ul id="menu" hidden>
      <li><a href="#">Home</a></li>
    </ul>
    <script>
      const button = document.getElementById("menu-btn");
      button.addEventListener("click", () => {
        document.getElementById("menu").hidden = false;
      });
    </script>
    Which tool

    Code tester, HTML Runner or browser DevTools?

    All three can run your code. They suit different stages of the work.

    One snippet

    Code tester

    Paste and test a single page or fragment, with markup and script problems listed together.

    Separate files

    HTML Runner

    HTML, CSS and JavaScript in separate tabs, with a console, share links and ZIP export.

    A live site

    Browser DevTools

    Inspect a page that is already online, set breakpoints and watch network requests.

    Questions

    HTML code tester questions

    The faulty code is inside an event handler, so it only runs when the event happens. Use every button, link and form on the page before deciding it works.

    Yes. Include them in style and script elements in the code you paste. To keep them as separate files, use the HTML Runner, which has a tab for each.

    Resources with full https addresses load. Files referenced by relative paths, such as images/photo.jpg, are on your computer and cannot be found here.

    A label's for attribute, or an ARIA reference, names an id that no element has. Clicking the label then does nothing and screen readers cannot connect it to its field. Make the two values match.

    Partly. The markup check finds the most common mistakes. For a full check against the HTML standard, also run the finished page through the W3C Nu Html Checker.

    Select Open in HTML Runner, then use Share in the Runner. The link contains the code itself, so anyone you send it to sees exactly what you see.

    Found the bug? Build the rest

    Move your tested code into the HCODX editor to work across several pages, stylesheets and scripts with a live preview.

    Instant HTML Runner & Viewer with Live Preview

    Need to run a short HTML, CSS and JavaScript snippet? The HTML Runner Online has a focused editing surface with live output.

    Open HTML Runner Online