
AMP HTML Validator
Paste AMP markup to run local rule checks for boilerplate, runtime scripts, banned tags, custom JavaScript, and common replacements.
Last reviewed: June 2026New to this tool? Click here for instructions
How to use the AMP HTML Validator
Paste an AMP document into the input area and click Validate. The browser-side checker reports passes, warnings, and failures for the rules it can inspect quickly: <html amp>, amp-boilerplate, AMP runtime script, canonical link, charset, viewport, banned tags, custom scripts, inline event handlers, plain image tags, and form action patterns.
Switch to Fix Suggestions after a run to see the concrete repair text for failed or warning checks. The Reference tab stays available as a short reminder of common AMP replacements and allowed script patterns.
Scope and accuracy
This page is a fast local triage helper, not the official AMP validator. It uses regular-expression and string checks in the browser; it does not parse the full AMP validator ruleset, component-specific attribute grammar, CSS byte limits, or every extension-script requirement. Treat a passing result here as "no obvious mistakes found," then run the official AMP validator before production release.
No external beautifier or validation API is called. Pasted markup stays in the browser session unless you copy it elsewhere.
Common failures this tool catches
| Check | Why it matters | Typical fix |
|---|---|---|
| Missing amp attribute | AMP documents must identify themselves at the root element. | Use <html amp lang="en">. |
| Missing amp-boilerplate | The AMP runtime expects the required boilerplate in the document head. | Add the official boilerplate from the AMP docs. |
| Custom script | Arbitrary JavaScript is restricted in AMP pages. | Use AMP components and allowed extension scripts. |
| Plain iframe or img | AMP has controlled media components. | Use amp-iframe or amp-img with required attributes. |
| Form action warning | AMP forms use specific submission patterns. | Use AMP form rules and include the component script where needed. |
Worked example
Click Try Example, then Validate. The sample intentionally includes a custom script, a plain iframe, a plain img tag, an object tag, an inline event handler, and missing boilerplate. The result list should show a mix of passes, failures, and warnings. Open Fix Suggestions to see the replacement guidance for each failing check.
Useful references: AMP HTML specification and AMP validation workflow.