Your files never leave your device. All processing happens locally in your browser.
How do I check my AMP HTML for the required markup — the doctype, the <html ⚡> tag, the boilerplate, the v0.js runtime and the canonical link — without uploading my page?
Open AnyTool’s AMP Validator, paste your AMP page’s HTML source (View Source / Ctrl+U), and it runs a curated SUBSET of the AMP HTML required-markup rules entirely in your browser, returning a pass/fail summary plus a grouped checklist with a fix hint for each rule. It checks the document basics (a leading <code><!doctype html></code>, the <code><html ⚡></code> or <code><html amp></code> identifier), the required <head> markup (<code><meta charset="utf-8"></code> present AND as the first child of <head>, the <code><meta name="viewport"></code>, the AMP boilerplate <code><style amp-boilerplate></code> plus its <code><noscript></code> variant, and the <code><link rel="canonical"></code>), scripts (the async <code>cdn.ampproject.org/v0.js</code> runtime, and that no forbidden author JavaScript is present — only <code>application/ld+json</code>, AMP runtime/extension scripts and amp-mustache templates are allowed), the tags/attributes (plain <code><img></code>/<code><video></code>/<code><iframe></code> that must become <code>amp-img</code>/<code>amp-video</code>/<code>amp-iframe</code>, disallowed tags like base/frame/object/embed, and inline <code>on*</code> event handlers), and the CSS rules (a single <code><style amp-custom></code> within the 75 KB limit, no <code>!important</code>, no external stylesheets). It also inventories every <code>amp-*</code> component used and warns when its custom-element script is missing. Everything is computed locally — your HTML is never uploaded, so it is safe for staging pages. Honest caveat: AMP’s role has DECLINED sharply (Google removed the AMP requirement for Top Stories in 2021 and Core Web Vitals replaced it, so most sites no longer need AMP), and this is a helpful SUBSET, not the official AMP Validator (amp.dev / the amphtml-validator), which enforces hundreds of rules — confirm there before publishing.
Checks the required AMP markup: doctype, <html ⚡/amp>, charset (first in <head>), viewport, boilerplate + <noscript>, v0.js runtime, canonical
Checks the single <style amp-custom> against the 75 KB limit, plus !important and external stylesheets
Honest: AMP’s importance declined — most sites no longer need it; this is a client-side SUBSET, not the official AMP Validator
What is
AMP HTML validation
AMP (Accelerated Mobile Pages) HTML is a restricted subset of HTML with required markup and an allowlist of permitted tags, attributes and scripts, designed so the AMP runtime can guarantee fast, predictable rendering. A valid AMP page must start with <code><!doctype html></code>, use a top-level <code><html ⚡></code> (or <code><html amp></code>) tag, place <code><meta charset="utf-8"></code> as the first child of <head>, include a <code><meta name="viewport" content="width=device-width"></code>, contain the exact AMP boilerplate (<code><style amp-boilerplate></code> plus a <code><noscript></code> variant), load the AMP runtime via <code><script async src="https://cdn.ampproject.org/v0.js"></code>, and provide a <code><link rel="canonical"></code>. Author JavaScript is forbidden (only <code>application/ld+json</code>, the AMP runtime and component/extension scripts from cdn.ampproject.org, and amp-mustache templates are allowed); media must use AMP components (<code>amp-img</code>, <code>amp-video</code>, <code>amp-iframe</code>) and each extended <code>amp-*</code> component needs its own custom-element script; all custom CSS goes in a single <code><style amp-custom></code> of at most 75 KB with no <code>!important</code>. AMP validation reports whether a page meets these rules. Importantly, AMP’s SEO role has declined: Google removed the AMP requirement for Top Stories in 2021 and now ranks by page experience / Core Web Vitals, so AMP is a tool rather than a requirement for most sites.
A leading <!doctype html>, an <html ⚡> (or amp) tag, <meta charset="utf-8"> as the first child of <head>, a viewport meta, the AMP boilerplate plus its noscript variant, the async v0.js runtime script, and a rel=canonical link.
A valid AMP page must start with the <!doctype html> doctype and use a top-level <html ⚡> tag (the lightning bolt, or the ASCII fallback <html amp>). Inside <head>, the first child must be <meta charset="utf-8">, followed by a <meta name="viewport" content="width=device-width"> tag, the mandatory AMP boilerplate (a <style amp-boilerplate> block and a matching <noscript> variant that hide the page until the runtime loads), the AMP runtime loaded with <script async src="https://cdn.ampproject.org/v0.js">, and a <link rel="canonical"> pointing to the non-AMP page (or to itself). Author JavaScript is not allowed, media must use AMP components such as amp-img, and each extended amp-* component needs its own custom-element script. AnyTool’s AMP Validator checks all of these locally and shows a pass, warning or error with a fix hint for each.
AMP forbids author JavaScript so the runtime can guarantee fast, predictable rendering. Use built-in AMP components, the AMP runtime / extension scripts, application/ld+json for structured data, amp-mustache templates, or amp-script for sandboxed custom code.
AMP HTML disallows author-written <script> tags because uncontrolled JavaScript is the main cause of slow, janky pages; the AMP runtime instead provides vetted components that it can prioritise and lazy-load. The only <script> tags allowed are: the AMP runtime and component/extension scripts served from cdn.ampproject.org, <script type="application/ld+json"> for structured data, and amp-mustache (custom-template) blocks. For interactivity you reach for AMP components — amp-carousel, amp-accordion, amp-lightbox, amp-form, amp-bind and so on — or, for genuinely custom logic, the sandboxed amp-script component. AnyTool’s validator flags any other <script> as a forbidden author-JavaScript error and lists which amp-* components are missing their required custom-element script.
For most sites, no. Google removed the AMP requirement for Top Stories in 2021 and dropped the AMP badge; ranking now uses page experience / Core Web Vitals, so a fast, standards-based responsive page is usually the better, more flexible choice.
AMP’s importance has declined sharply. In 2021 Google removed AMP as a requirement for the Top Stories carousel and dropped the AMP badge from search results, and the Page Experience update made Core Web Vitals (loading, interactivity and visual stability) the relevant signals — Google now cares that your page is fast, not how you achieve it. As a result, AMP is a tool rather than a ranking requirement, and for most businesses a modern, standards-based responsive page with good Core Web Vitals delivers better long-term results with far more design and code flexibility than AMP’s restricted subset. Some publishers still maintain AMP for legacy reasons, but new projects rarely need it. AnyTool states this honestly and is intended as a helpful client-side pre-check for the common AMP HTML rules — not an endorsement that you should adopt AMP.
No on both counts. Your HTML is parsed and rule-checked entirely in your browser and never uploaded, so it is safe for staging pages. This checks common AMP rules as a subset — it is not the official AMP Validator, which enforces hundreds of rules.
The AMP Validator is 100% client-side: the HTML you paste is parsed with the browser’s own DOMParser and rule-checked with ordinary JavaScript on your device — nothing is fetched, uploaded, logged or stored on a server, and no page is ever crawled — which makes it safe for staging, unreleased or internal pages, unlike online validators that send your page to a server. It works offline once cached, supports dark mode and mobile with a sticky Validate / Copy bar, and you can copy the full report. Be clear about scope: this covers the COMMON, high-signal AMP HTML required-markup rules as a helpful SUBSET. It is NOT the official AMP Validator (amp.dev, the amphtml-validator npm package, or the runtime’s built-in validator), which is authoritative and enforces hundreds of allowlist rules — a clean report here is not a guarantee of validity, so confirm there before publishing AMP.
Detailed Explanation
📖How It Works
What the AMP Validator Checks
The AMP Validator is a 100% client-side tool that checks pasted AMP HTML against a curated SUBSET of the AMP HTML required-markup rules. The user pastes a page’s AMP HTML source (View Source / Ctrl+U) and presses Validate; the tool parses the markup with the browser’s DOMParser (with a regex fallback) and runs the rule set, returning a pass/fail summary, the detected AMP variant (⚡ / amp / amp4email / amp4ads), error / warning / pass counts, and a CHECKLIST grouped into Document & doctype, Required <head> markup, Scripts & JavaScript, Tags & attributes, and CSS & styling. It verifies the document basics (a leading <code><!doctype html></code> and the <code><html ⚡></code> / <code><html amp></code> identifier), the required <head> markup (<code><meta charset="utf-8"></code> present AND as the first child of <head>, the viewport meta, the AMP boilerplate <code><style amp-boilerplate></code> plus its <code><noscript></code> variant, and the <code><link rel="canonical"></code>), the scripts (the async <code>cdn.ampproject.org/v0.js</code> runtime, and that no forbidden author JavaScript exists — only <code>application/ld+json</code>, AMP runtime/extension scripts and amp-mustache templates are allowed), the tags and attributes (plain <code><img></code>/<code><video></code>/<code><audio></code>/<code><iframe></code> that must become AMP components, disallowed tags such as base/frame/object/embed, and inline <code>on*</code> event handlers), and the CSS (a single <code><style amp-custom></code> within the 75 KB limit, no <code>!important</code>, no non-font external stylesheets). It also inventories every <code>amp-*</code> component used and flags any whose custom-element script is missing. Each finding carries a fix hint.
Parses AMP HTML with DOMParser (regex fallback) and reports a pass/fail summary, the AMP variant, and error/warning/pass counts
Flags forbidden author JavaScript (only ld+json + AMP CDN + amp-mustache allowed) and amp-* components missing their custom-element script
Flags plain <img>/<video>/<iframe>, disallowed tags (base/frame/object/embed) and inline on* handlers; checks single <style amp-custom> ≤75 KB, no !important
Groups findings into Document, Head, Scripts, Tags and CSS, each with a fix hint; inventories the amp-* components used
⚙️Methodology
How the Rule Checks Run In-Browser
All logic lives in a small inline engine (ampEngine.ts) with no new dependency. The pasted HTML is parsed once with DOMParser when available and re-scanned with targeted regular expressions, so the engine never throws on malformed input. The AMP variant is read from the <code><html></code> tag (the ⚡ bolt, the literal <code>amp</code> token, or <code>amp4email</code>/<code>amp4ads</code>). The doctype rule allows leading comments before <code><!doctype html></code>. The charset rule checks both presence and POSITION — that <code><meta charset="utf-8"></code> is the first element child of <head> (via the parsed DOM, or the first tag inside <head> in the regex fallback). The boilerplate rule requires both the <code><style amp-boilerplate></code> block and a <code><noscript></code> variant. The runtime rule requires the exact <code>https://cdn.ampproject.org/v0.js</code> src and warns if the <code>async</code> attribute is missing. The author-JavaScript rule iterates every <code><script></code> and flags any that is not <code>application/ld+json</code>, not served from cdn.ampproject.org, and not an amp-mustache/custom-template script. The component check collects every <code>amp-*</code> tag, treats amp-img/amp-pixel/amp-layout as built-in (no script needed), and reports an error when an extended component’s <code>custom-element</code> (or <code>custom-template</code>) script is absent. Media rules count plain <code><img></code> (error) and <code><video></code>/<code><audio></code>/<code><iframe></code> (warning); the disallowed-tag rule scans for base/frame/object/embed/applet; the inline-handler rule flags <code>on*</code> attributes while allowing AMP’s <code>on="event:action"</code> binding. CSS rules read the single <code><style amp-custom></code>, measure it with TextEncoder against 75,000 bytes, and flag <code>!important</code>, multiple amp-custom blocks, and non-font external stylesheets. Findings are tallied into errors/warnings/passes and the page is “valid” (for the checked subset) when there are zero errors.
One inline engine (ampEngine.ts), no new dependency; DOMParser with a regex fallback so it never throws on bad input
Charset rule checks POSITION (first child of <head>), not just presence; doctype rule allows leading comments
Author-JS rule iterates every <script> and allows only ld+json, cdn.ampproject.org and amp-mustache/custom-template scripts
Component check treats amp-img/amp-pixel/amp-layout as built-in and errors when an extended component’s custom-element script is missing
CSS measured with TextEncoder against 75,000 bytes; flags !important, multiple amp-custom blocks and non-font external stylesheets
⚠️Limitations
AMP Has Declined — and This Is a Subset, Not the Official Validator
The tool is deliberately honest on two fronts. First, AMP’s SEO importance has DECLINED sharply: Google removed the AMP requirement for the Top Stories carousel in 2021 and dropped the AMP badge from search results, and the Page Experience update made Core Web Vitals the relevant ranking signals — Google now cares that a page is fast, not how. As a result AMP is a tool rather than a requirement, and for MOST sites a fast, standards-based responsive page with good Core Web Vitals is the better, more flexible choice; new projects rarely need AMP. The tool states this prominently so users do not adopt AMP unnecessarily. Second, this is a SUBSET checker, not the authoritative validator. The official AMP Validator — amp.dev’s online validator, the <code>amphtml-validator</code> npm package, and the validator built into the AMP runtime — enforces HUNDREDS of allowlist rules covering every permitted tag, attribute, value and layout. This client-side tool covers the common, high-signal required-markup rules (doctype, the html identifier, the head markup, the boilerplate, the runtime, the canonical, forbidden author JS, component scripts, media tags, disallowed tags, inline handlers and the CSS limit). It does NOT validate the full attribute/value allowlist, layout-system rules, per-component attribute constraints, or AMP for Email/Ads specifics. A clean report here is therefore a useful pre-check, not a guarantee of validity — always confirm in the official AMP Validator before publishing AMP.
Google removed the AMP requirement for Top Stories in 2021 and dropped the AMP badge; Core Web Vitals / page experience replaced it
Most sites no longer need AMP — a fast, standards-based responsive page is usually the better, more flexible choice
This is a SUBSET of the AMP HTML rules — the official AMP Validator (amp.dev / amphtml-validator) enforces hundreds of allowlist rules
It does not validate the full attribute/value allowlist, layout-system rules or per-component constraints
A clean report here is a pre-check, not a guarantee — confirm in the official AMP Validator before publishing
🔒Privacy & Security
Why Validating AMP In-Browser Is a Privacy Win
Many online AMP validators send your page URL or HTML to a server to check it. The AMP Validator instead treats your pasted markup as a plain string that is parsed with the browser’s own DOMParser and rule-checked with ordinary JavaScript entirely on your device; nothing is fetched, uploaded, logged or stored, no CDN is called for processing, and no page is ever crawled. That makes it safe to validate staging, unreleased or internal AMP pages without exposing them. An optional “try to fetch a URL” box exists for convenience, but it uses NO server proxy — it only works for CORS-enabled or same-origin pages, so most live URLs are blocked and the user pastes the source instead, which keeps the page private by design. The tool works offline once cached as a PWA, supports dark mode and a mobile layout with a sticky Validate / Copy action bar, has exactly three ad slots, includes a valid sample and a deliberately-broken sample, lets the user copy a full text report, and adds NO new dependency — the parser, the rule checks and the component inventory are a small inline engine in the page.
AMP HTML is parsed and rule-checked locally — never uploaded, no server, no CDN for processing, no crawling
Safe for validating staging, unreleased or internal AMP pages
Optional URL fetch uses NO proxy (CORS-limited) so live pages stay private; paste the source instead
Works offline once cached; dark mode and mobile with a sticky Validate / Copy bar; exactly three ad slots
No new dependency — the parser, rule checks and component inventory are a small inline engine; valid + broken samples included
States AMP declined + this is not the official validator
Often implies full validity
Authoritative
No — confirm in the official AMP Validator
Only if it wraps amphtml-validator
AnyTool is a 100% client-side AMP HTML rule checker: paste your AMP page source and it checks a curated SUBSET of the required-markup rules — the doctype, the <html ⚡/amp> identifier, the charset (first in <head>) and viewport metas, the boilerplate plus its <noscript> variant, the async v0.js runtime, the canonical link, forbidden author JavaScript, amp-* components missing their custom-element script, plain <img>/<video>/<iframe>, disallowed tags, inline on* handlers and the single <style amp-custom> against the 75 KB limit — and returns a pass/fail summary plus a grouped checklist with fix hints and a component inventory. Honest caveat: AMP’s role has declined sharply (Google removed the AMP requirement for Top Stories in 2021 and Core Web Vitals replaced it, so most sites no longer need AMP), and this is a helpful subset, NOT the official AMP Validator (amp.dev / the amphtml-validator package), which enforces hundreds of rules — confirm there before publishing. Comparison as of June 2026.