How to validate AMP markup?

Still have a question, spotted an error, or have a better explanation or a source we should cite?

Your AMP code won't work half-right in email. It either validates fully or it doesn't. That all-or-nothing approach means invalid markup gets stripped out entirely, leaving your recipient with just the plain HTML fallback. The good news: validation is straightforward.

Use Google's official validators. If you're building AMP for Email, hit up the Gmail AMP for Email Playground (that's the one built specifically for email, not the general web version). Paste your markup and it'll flag every error with line numbers and explanations. You'll catch things like disallowed HTML tags (the browser won't let script or style tags in your body), invalid AMP components (missing required attributes), CSS violations (no external stylesheets, no @import), and non-HTTPS resources.

But here's the thing: validation only checks your markup syntax. It doesn't test whether your email actually works. After validation passes, test your endpoints. Do your server endpoints respond correctly? Do forms actually submit? Does real-time content load fast enough? A syntactically perfect AMP email with a slow or broken backend is worse than no AMP at all.

So the full workflow: validate markup first, then test functionality with a real preview in Gmail. You can check your email's accessibility too with accessibility standards in mind. Start with validation, end with real testing. If you need help parsing your email structure, check your headers to confirm AMP sections are properly formed.

Contributors

Who worked on this answer

Every name links to their profile. Every company links to their site. Real people, real accountability.

Ask an AI · tailored to your setup

Get validation setup tailored to your ESP and AMP use case.

I need help setting up AMP validation for my email program. My details: - ESP: e.g., Mailchimp, SendGrid, Postmark, custom SMTP - AMP use case: [what interaction or dynamic content you're trying to enable] - Current blocker: what validation issue you're hitting - Team familiarity with AMP: new to this, have some experience, advanced Based on my setup, tell me: 1. How to run validation in my ESP (if supported) or externally 2. The most common errors I'll hit and how to fix them 3. How to test endpoints after validation passes 4. Next step after validation succeeds

Edit the yellow boxes, then send to the AI of your choice.