AMP HTML Validator
Paste HTML to check AMP compliance — banned tags, missing boilerplate, custom JS, and more. Pass/fail per rule with fix suggestions.
How to Use the AMP HTML Validator
- Paste your HTML — copy the full source of your AMP page and paste it into the input area. Click "Try Example" to see a sample AMP page with common errors.
- Click Validate — the tool checks your HTML against AMP compliance rules: banned tags, required elements, custom JavaScript, form usage, and more.
- Review results — each rule shows a pass or fail status with a description. Failed rules include the specific element that caused the error.
- Switch to Fix Suggestions — after validating, click "Fix Suggestions" to see tailored recommendations based on the errors found in your HTML.
- Use the Reference panel — view a quick reference of banned tags, required elements, AMP replacements, and allowed script types.
What is AMP and Why Does It Matter?
AMP (Accelerated Mobile Pages) is an open-source HTML framework created by Google to build fast-loading mobile web pages. AMP HTML is a restricted subset of standard HTML with specific rules designed to eliminate the most common causes of slow page loads: render-blocking scripts, custom JavaScript, unoptimized images, and complex CSS animations.
AMP Validation Rules Explained
The AMP specification has several categories of rules. First, banned tags: regular HTML tags like script (for custom JavaScript), iframe, object, embed, frame, and applet are not allowed because they can introduce performance and security issues. These must be replaced with AMP-specific components that implement the same functionality in a controlled, performance-optimized way.
Second, required elements: every valid AMP page must include the amp-boilerplate CSS in the head (which hides content until AMP is ready), a canonical link pointing to the original non-AMP page (or itself for AMP-only pages), proper charset and viewport meta tags, and the AMP runtime script from cdn.ampproject.org. The html tag must have the amp attribute or the lightning bolt emoji ⚡.
Custom JavaScript in AMP
One of AMP's strictest requirements is the complete prohibition of custom JavaScript. No inline onclick handlers, no external script files, and no inline script blocks (except for the AMP runtime, AMP components, and JSON-LD structured data). Instead, AMP provides a rich set of components that handle interactivity declaratively: amp-bind for state management, amp-form for forms, amp-accordion for expandable sections, and hundreds more. This constraint is what makes AMP pages predictably fast — the browser never has to execute unknown JavaScript before rendering the page.
When to Use AMP
AMP is most beneficial for news articles, blog posts, and editorial content where the primary goal is reading. For highly interactive applications, e-commerce with complex cart logic, or pages requiring custom JavaScript, AMP may be too restrictive. Google no longer requires AMP for Top Stories eligibility (as of 2021), but AMP pages can still benefit from serving via the Google AMP Cache, which delivers content from Google's CDN at very low latency. Pair AMP validation with our Schema Generator to add structured data to your AMP pages and maximize rich result eligibility.
AMP vs. Standard HTML Performance
The performance benefits of AMP come from several mechanisms: pre-rendering in Google Search (pages load before the user clicks), delivery via Google's CDN (reducing server round-trip time), and the structural constraints that prevent slow patterns. Standard HTML pages can match or exceed AMP performance when properly optimized using Core Web Vitals best practices — but AMP provides a validation framework that makes performance compliance easier to enforce across a content team. If you are building a new content site and want guaranteed fast performance with minimal effort, AMP remains a viable choice.