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.