Vanilla JavaScript Projects

Project 100, SEO and site tools

Page SEO Audit

A quick health check for any page. Paste the HTML and get a score with a clear list of what is good, what could be better and what is missing.

76
Main API
DOMParser
Checks
16 on-page rules
Dependencies
None
Your browser
Checking

Audit a page

The sample page has a few problems on purpose. Press Audit, fix things in the box, and audit again. Or paste your own page source.

Press Audit

    How it works

    1. Parse without loadingDOMParser turns the pasted HTML into a document you can query, without running its scripts or loading its images.
    2. Sixteen quick rulesTitle and description length, one h1 and heading order, alt text and image sizes, language, viewport, canonical, Open Graph, schema, word count, links and noindex.
    3. Score and sortPasses count fully, warnings half. Failed checks come first, each with a short reason and, where useful, the code to add.
    const doc = new DOMParser().parseFromString(html, "text/html");
    const checks = [];
    const title = doc.querySelector("title")?.textContent.trim() || "";
    checks.push(title.length >= 30 && title.length <= 60 ? "pass" : "warn");
    checks.push(doc.querySelectorAll("h1").length === 1 ? "pass" : "fail");
    checks.push(doc.querySelectorAll("img:not([alt])").length ? "fail" : "pass");
    checks.push(doc.querySelector('link[rel="canonical"]') ? "pass" : "warn");
    const score = checks.reduce((a, c) => a + (c === "pass" ? 1 : c === "warn" ? 0.5 : 0), 0) / checks.length * 100;