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.
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.
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.
A reliable way to test a snippet
Random changes waste time. Work from the smallest example and one fix at a time.
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.
Test and read
Run the test and read the list from the top. The first problem often causes the ones after it.
Fix one thing
Change one line, test again and confirm that problem is gone before moving on to the next.
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.
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.
<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>Code tester, HTML Runner or browser DevTools?
All three can run your code. They suit different stages of the work.
Code tester
Paste and test a single page or fragment, with markup and script problems listed together.
HTML Runner
HTML, CSS and JavaScript in separate tabs, with a console, share links and ZIP export.
Browser DevTools
Inspect a page that is already online, set breakpoints and watch network requests.
HTML code tester questions
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