AMP validator tool

Validate up to 10 AMP pages with the official AMP validator, with every error at its line, and check the canonical link in both directions, CSS size and component scripts.

  • Official AMP Project validator
  • Canonical and amphtml checked both ways
  • Up to 10 URLs, exported as CSV
Ready

Valid AMP pages

Enter URLs to start

Waiting for URLs
Errors
—
Warnings
—
Two-way
—
  1. Fetch
    —
    By our server
  2. Validator
    —
    Official, in your browser
  3. Canonical
    —
    rel="amphtml" back
  4. Source
    —
    CSS, scripts, tags

AMP validation

Paste one or more URLs above and press Validate. Each page appears here with the official validator's errors, the canonical link check and the source checks.

Fair-use limit for each visitor IP address: 60 URLs per hour and 200 per day, and 500 per hour for the whole site. A canonical page check does not count. Results are cached for 10 minutes.

What AMP validation means

AMP is a restricted form of HTML. A page is valid AMP only when it follows every rule of the AMP specification; one broken rule makes the whole page invalid.

Valid or not, nothing between

AMP caches and viewers only serve valid pages. An invalid AMP page is treated like a normal page, or not shown as AMP at all.

A pair of pages

Most sites have a normal page and an AMP copy. rel="canonical" on the AMP page and rel="amphtml" on the normal page tie them together.

Limits by design

No custom JavaScript, one CSS block of at most 75,000 bytes, and AMP components such as amp-img instead of plain tags.

Optional for Google today

Google no longer needs AMP for Top Stories or shows an AMP badge. Valid AMP still matters if you serve AMP pages at all.

What every AMP page needs

The required markup the tool looks for, and what happens without it.

MarkupRuleWhy it matters
<html ⚡> or <html amp> Marks the document as AMP Missing: the page is treated as normal HTML
<meta charset="utf-8"> First child of the head Required; AMP is UTF-8 only
<meta name="viewport"> width=device-width Required for mobile layout
<script async src="…/v0.js"> The AMP runtime from cdn.ampproject.org Without it nothing renders
<style amp-boilerplate> Plus the noscript copy Hides content until the runtime is ready
<link rel="canonical"> To the normal page, or to itself Required; pairs with rel="amphtml" on the normal page
<style amp-custom> One block, 75,000 bytes at most Inline style attributes count toward the limit
Component scripts One per amp-* component used amp-img, amp-layout and amp-pixel are built in
No custom JavaScript Except amp-script and JSON Any other script makes the page invalid

How to use this tool

From a list of URLs to valid AMP pages.

  1. Paste up to 10 URLs

    AMP URLs or normal pages; a page with a rel="amphtml" link is followed to its AMP version.

  2. Run the validator

    Each page is fetched by our server and validated in your browser with the official AMP validator.

  3. Read the errors

    Each error has its line, column and a link to the AMP spec; source checks explain the usual causes.

  4. Fix and export

    Fix the template or plugin, check again, and export the results as CSV.

What this tool does, and what it doesn't

A plain list, so you know exactly what to expect.

This tool does

  • Run the official AMP validator
  • Show each error with line and spec link
  • Check canonical and amphtml both ways
  • Measure CSS against the 75,000-byte limit
  • Find missing and unused component scripts
  • Check up to 10 URLs and export CSV

This tool does not

  • Crawl from Google's IP addresses
  • Fix your AMP pages
  • Check pages behind a login
  • Update Search Console for you
  • Validate AMP emails or ads
  • Store your URLs

Where your data goes

Our server fetches each page and its canonical page and returns them to your browser; results are kept for 10 minutes. Your browser loads the AMP validator from cdn.ampproject.org and runs it locally, so the page HTML is not sent there. Fair-use counters use a hashed IP address, as described in our privacy policy.

AMP validation guide

Why your results might look unexpected

The six situations people run into most, and what each one means.

The AMP URL redirects

Often to the normal page, because AMP was switched off. Remove the rel="amphtml" links too.

Two-way link fails

The normal page has no rel="amphtml" link, or it points to another URL, such as without a trailing slash.

Custom JavaScript found

A plugin injects a script, such as analytics or ads, that is not an AMP component.

CSS over 75,000 bytes

The theme adds all its CSS. Use an AMP plugin that removes unused CSS, or trim it.

Validator could not load

An extension or firewall blocked cdn.ampproject.org. The source checks still work.

HTTP 403 or 503

A firewall blocks our server. Allow it, or test the page with the AMP browser extension.

Questions about AMP validation

Is this the official AMP validator?

The pass or fail result is. The tool runs the AMP Project's own validator, the same code used by the AMP browser extension and the amphtml-validator command-line tool, on the HTML of your page. On top of that it adds plain-language checks and tests the canonical link in both directions, which the validator does not do.

Do I still need AMP for Google Top Stories?

No. Since the page experience update in 2021, Google does not require AMP for Top Stories, and it no longer shows the AMP badge. AMP pages can still be shown, and some sites keep AMP for speed or for AMP-specific features. If you no longer want AMP, remove the rel="amphtml" links and redirect the AMP URLs to their canonical pages.

What is the canonical and amphtml two-way link?

An AMP page must link to its normal version with rel="canonical", and the normal page should link back with rel="amphtml". That pair tells search engines the two URLs are the same content. If the AMP page is the only version, its canonical link points to itself. The tool fetches the canonical page and checks the link back.

Why does my AMP page fail because of CSS?

AMP allows only one style amp-custom block in the head, no external stylesheets except approved font providers, and at most 75,000 bytes of CSS, counting inline style attributes too. Themes and plugins often add more. The tool shows the size of your CSS so you can see how much to remove.

What does "missing component script" mean?

Every AMP component other than the built-in ones, such as amp-img, needs its own script in the head, for example custom-element="amp-carousel" for amp-carousel. If the element is on the page but the script is not, the component does not work and the page is invalid. Unused component scripts are harmless but waste bytes.

Why are the results different from the AMP report in Search Console?

Search Console shows what Google found when it last crawled the page, which may be days old, and it groups issues. This tool checks the page as it is now, with the user agent you choose. If you fixed something, use Validate Fix in Search Console so Google crawls the pages again.

Are my URLs stored?

No. Our server fetches each page and its canonical page, returns the results to your browser and keeps them for 10 minutes. The AMP validator script is loaded by your browser from the AMP Project's CDN at cdn.ampproject.org. Fair-use counters use a hashed version of your IP address, as described in our privacy policy.