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 2026

New to this tool? Click here for instructions

HTML Input
Validation Results
Paste HTML and click Validate.
Paste HTML and click Validate to check AMP compliance.

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

AMP checks and likely fixes
CheckWhy it mattersTypical fix
Missing amp attributeAMP documents must identify themselves at the root element.Use <html amp lang="en">.
Missing amp-boilerplateThe AMP runtime expects the required boilerplate in the document head.Add the official boilerplate from the AMP docs.
Custom scriptArbitrary JavaScript is restricted in AMP pages.Use AMP components and allowed extension scripts.
Plain iframe or imgAMP has controlled media components.Use amp-iframe or amp-img with required attributes.
Form action warningAMP 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.

Frequently Asked Questions

No. It is a quick browser-side rule checker. Use the official AMP validator before publishing production AMP pages.
No. The page runs local JavaScript checks against the text in the browser.
This tool checks common structural mistakes, but the official validator has the complete AMP ruleset, component-specific validation, CSS limits, and evolving spec details.
Yes. JSON-LD script blocks are one of the allowed script patterns when they use the correct type and contain structured data.
Retest locally, then validate with the official AMP tooling or browser extension before deployment.