Free · Fast · Privacy-first

Validate HTML Meta Tags Online

Meta tags control how search engines index your page, how social platforms preview it when users share a link, and how browsers render the document at a fundamental level.

Free • Fast • Privacy-first

HTML Validator & Linter

Our free HTML validator helps you check HTML5 code for syntax errors online. This html validator no download tool catches missing tags, invalid attributes, duplicate IDs, unclosed elements, and W3C HTML5 spec violations. All validation runs locally in your browser with WCAG and ARIA awareness, so your code stays private.

Check HTML5 code for errors, accessibility, and SEO issues instantly

Checks
Syntax & SEO
Standards
W3C HTML5
Mode
In-browser
Price
Free

W3C Standards

Validates against W3C HTML5 standards for complete compliance.

Accessibility

Checks for WCAG compliance and accessibility issues.

🔒

100% Private

Everything runs locally. Your HTML never leaves your device.

Validate HTML online

Paste your HTML code, click Validate, and review the results for errors, warnings, and suggestions.

Demo fetch uses a CORS-friendly approach only if the target allows it.

Privacy-first

This page processes content locally in your browser (no upload).

What is HTML Validation?

HTML validation is the process of checking HTML code against official W3C HTML5 standards to ensure it's syntactically correct, structurally sound, and follows web development best practices. Our free HTML validator tool analyzes your code to detect errors, warnings, and potential issues that could affect functionality, accessibility, SEO, or performance. This html validator online tool helps you validate HTML5 code online instantly.

When you write HTML code, it's easy to introduce mistakes like missing closing tags, invalid attributes, or structural errors. While modern browsers are forgiving and often render invalid HTML, these errors can cause unexpected behavior, accessibility problems, SEO issues, and compatibility problems across different browsers and devices. Our html syntax checker online helps you catch these issues before they become problems. Validate HTML before deployment to ensure your code is production-ready. For more HTML tools, check out our HTML Tools collection.

FeatureUnvalidated HTMLValidated HTML
Browser CompatibilityInconsistent rendering across browsers, layout breaks, broken functionalityConsistent rendering across all browsers and devices
AccessibilityScreen readers break, missing alt text, improper headings, WCAG violationsWCAG compliant, accessible to all users, proper semantic structure
SEO ImpactPoor crawlability, missing meta tags, improper heading hierarchy, lower rankingsBetter crawlability, proper meta tags, semantic structure, improved rankings
PerformanceSlower parsing, extra browser processing, poor Core Web VitalsFaster parsing, optimized rendering, better Core Web Vitals scores
SecurityMissing rel="noopener", potential XSS vulnerabilities, insecure practicesSecurity best practices, proper link attributes, reduced vulnerabilities
MaintainabilityHard to debug, unclear structure, difficult to maintainClear structure, easier debugging, better maintainability

Invalid HTML

<!DOCTYPE html>
<html>
<head>
  <title>Example</title>
</head>
<body>
  <h1>Welcome</h1>
  <p>This paragraph is not closed
  <img src="image.jpg">
  <a href="link.html">Click here
</body>
</html>

Missing closing tags, missing alt text, unclosed elements

Valid HTML

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Example</title>
</head>
<body>
  <h1>Welcome</h1>
  <p>This paragraph is closed.</p>
  <img src="image.jpg" alt="Description">
  <a href="link.html">Click here</a>
</body>
</html>

All tags closed, proper structure, accessibility attributes

What Does HTML Validation Check?

  • Syntax Errors: Missing closing tags, mismatched tags, invalid characters, and malformed HTML structure
  • Required Elements: DOCTYPE declaration, html tag, head tag, title tag, body tag, and other essential HTML5 elements
  • Accessibility Issues: Missing alt text on images, missing lang attribute, improper heading hierarchy, missing ARIA labels, and other WCAG compliance issues
  • SEO Problems: Missing meta description, missing Open Graph tags, improper heading structure, missing title tag, and other SEO best practices
  • Performance Warnings: Missing lazy loading on images, oversized images, missing optimization attributes, and other performance issues
  • Security Issues: External links missing rel="noopener", insecure resources, and other security best practices

According to W3C WCAG guidelines, valid HTML is the foundation of accessible web content. Invalid HTML can break screen readers, cause layout issues, and create barriers for users with disabilities. Our HTML validator checks for both syntax errors and accessibility compliance.

Modern web development workflows should include HTML validation as a standard step. Whether you're building a new website, maintaining existing code, or learning HTML, using an HTML validator helps ensure your code is correct, accessible, and optimized for search engines and performance. For more information on HTML standards, see the MDN HTML documentation and Google's HTML learning guide.

HTML Validation Impact

Real data showing the importance of validating HTML code

85%
Websites Have HTML Errors
According to W3C validation studies
30%
Accessibility Issues
Caused by invalid HTML
25%
SEO Impact
From HTML validation errors
40%
Browser Compatibility
Issues from invalid HTML
📊

Validation Statistics

According to W3C research, over 85% of websites contain HTML validation errors. These errors can cause accessibility problems, SEO issues, browser compatibility problems, and unexpected rendering. Regular HTML validation helps catch and fix these issues before they impact users or search engine rankings.

Why Validate HTML?

Validating HTML code is essential for building reliable, accessible, and search-engine-friendly websites. Our free online HTML validator helps you check HTML code online for errors and issues. Here's why you should make HTML validation part of your development workflow:

Ensure Browser Compatibility

Invalid HTML can render differently across browsers. Chrome, Firefox, Safari, and Edge may handle errors inconsistently, leading to layout breaks, missing content, or broken functionality. Valid HTML ensures consistent rendering across all browsers and devices, reducing cross-browser testing time and user complaints.

Improve Accessibility

Invalid HTML breaks screen readers and assistive technologies. Missing alt text, improper heading hierarchy, and missing ARIA labels prevent users with disabilities from accessing your content. Valid HTML with proper semantic structure is the foundation of WCAG 2.1 compliance. This is not just best practice—it's often a legal requirement.

🎯

Boost SEO Rankings

Search engines like Google prefer valid, well-structured HTML. Missing meta tags, improper heading hierarchy, and invalid structure can hurt your search rankings. Validate HTML for SEO to ensure proper semantic structure. Valid HTML helps search engines understand and index your content better, potentially improving your rankings and organic traffic. Use our html validator for developers to catch SEO issues early, then run the HTML SEO Analyzer for a deeper audit of meta tags and on-page SEO.

🐛

Catch Errors Early

HTML validation catches errors before they cause problems in production. Missing closing tags, invalid attributes, and structural errors can lead to broken layouts, JavaScript failures, and user experience issues. Validating during development saves debugging time and prevents costly fixes after deployment.

Improve Performance

Invalid HTML can cause browsers to spend extra time parsing and fixing errors, slowing down page rendering. Valid HTML renders faster, improving Core Web Vitals metrics like First Contentful Paint (FCP) and Largest Contentful Paint (LCP). Faster pages provide better user experience and can improve search rankings.

🔒

Enhance Security

Valid HTML helps prevent security vulnerabilities. Missing rel="noopener" on external links can expose your site to tabnabbing attacks. Invalid HTML can also make your site more vulnerable to XSS attacks. Validating HTML helps ensure you're following security best practices and protecting your users.

How It Works

Our html validator browser tool uses client-side parsing and rule checking to validate HTML syntax online. This html validation tool free solution works instantly in your browser. Here's how the validation process works:

1

Parse HTML Structure

The validator parses your HTML code to identify all tags, attributes, and structure. It builds a tree representation of your document and checks for proper nesting and hierarchy.

2

Check Syntax Errors

The validator checks for missing closing tags, mismatched tags, invalid attributes, missing required elements (DOCTYPE, html, head, body, title), and other syntax errors that break HTML validity.

3

Validate Accessibility

The validator checks for accessibility issues including missing alt text on images, missing lang attribute, improper heading hierarchy (h1 should be first, no skipped levels), missing ARIA labels, and other WCAG compliance issues.

4

Check SEO & Performance

The validator checks for SEO issues (missing meta description, missing Open Graph tags, improper heading structure) and performance warnings (missing lazy loading, security issues with external links). It generates a comprehensive report with errors, warnings, and suggestions.

Best Practices for HTML Validation

Follow these best practices to ensure your HTML code is valid, accessible, and optimized. Our html validator online instant tool helps you check html errors online quickly. Use this html code validator online regularly to maintain code quality:

1

Always Include DOCTYPE

Every HTML document should start with <!DOCTYPE html>. This tells browsers which HTML version to use and ensures proper rendering. Without it, browsers may enter quirks mode, causing inconsistent rendering.

DO: <!DOCTYPE html>
DON'T: Skip DOCTYPE declaration

2

Close All Tags Properly

Every opening tag must have a corresponding closing tag (except self-closing tags like <img>, <br>). Mismatched or unclosed tags can break layout and functionality.

Test regularly: Validate HTML after major changes, before deployment, and as part of your build process

3

Use Semantic HTML

Use semantic HTML5 elements like <header>, <nav>, <main>, <section>, <article>, and <footer>. These improve accessibility, SEO, and code maintainability.

Semantic benefits: Better accessibility • Improved SEO • Easier maintenance • Clearer code structure

4

Add Accessibility Attributes

Always include alt attributes on images, lang attribute on html tag, proper heading hierarchy (h1 → h2 → h3), and ARIA labels where needed. These are required for WCAG 2.1 compliance.

Accessibility checklist: Alt text on images • Lang attribute • Proper headings • ARIA labels • Keyboard navigation

5

Include Essential Meta Tags

Add essential meta tags for SEO and functionality: charset, viewport, description, and Open Graph tags for social sharing. These improve SEO rankings and user experience.

Essential meta tags: charset="UTF-8" • viewport for mobile • description for SEO • og:tags for social

6

Validate Regularly

Validate your HTML code regularly—after major changes, before deployment, and as part of your build process. Use automated validation in CI/CD pipelines to catch errors early. Regular validation prevents issues from accumulating and becoming harder to fix.

Validation schedule: After code changes • Before deployment • In CI/CD pipeline • During code reviews

Frequently Asked Questions

How do I validate HTML code?

Paste your HTML code into the validator, click Validate, and review the results. The tool checks for syntax errors, missing tags, accessibility issues, SEO problems, and performance warnings. All validation happens locally in your browser for complete privacy.

What HTML errors does the validator detect?

Our HTML validator detects missing DOCTYPE, unclosed tags, mismatched closing tags, missing required elements (html, head, body, title), invalid attributes, and structural issues. It also checks for accessibility problems like missing alt text and SEO issues like missing meta tags.

Do you store my HTML code?

No. This HTML validator processes everything locally in your browser. Your code never leaves your device, ensuring complete privacy and security. No server uploads, no data storage, no privacy concerns.

What's the difference between errors and warnings?

Errors are critical issues that break HTML validity or functionality (missing closing tags, invalid structure). Warnings are important but non-critical issues (missing alt text, missing meta tags). Suggestions are best practices for better SEO, accessibility, and performance.

Does this validator check for accessibility issues?

Yes. Our HTML validator checks for accessibility issues including missing alt text on images, missing lang attribute, improper heading hierarchy, missing ARIA labels, and other WCAG compliance issues. This helps ensure your HTML is accessible to all users.

Can I validate HTML from a URL?

Yes. You can fetch HTML from a URL using the fetch feature, though it may be blocked by CORS policies. Alternatively, copy the HTML source code from your browser's developer tools and paste it into the validator for complete validation.

What SEO issues does the validator check?

The validator checks for missing meta description, missing Open Graph tags, improper heading hierarchy (h1 should be first, no skipped levels), missing title tag, and other SEO best practices. These checks help improve your search engine rankings.

Is this validator based on W3C standards?

Yes. Our HTML validator follows W3C HTML5 standards and checks for compliance with official HTML specifications. It validates syntax, structure, and best practices according to W3C guidelines and modern web standards.

How do I fix HTML validation errors?

Review the validation report to identify errors. Common fixes include: adding missing closing tags, fixing mismatched tags, adding required elements (DOCTYPE, html, head, body, title), correcting invalid attributes, and fixing structural issues. Our validator provides specific suggestions for each error to help you fix them quickly.

What's the difference between HTML validator and linter?

An HTML validator checks code against W3C standards for syntax errors and structural issues. An HTML linter focuses on code quality, style, and best practices. Our tool combines both—it validates HTML syntax and also checks for accessibility, SEO, and performance best practices, making it a comprehensive validation and linting solution.

Can I validate HTML5 code automatically?

Yes. You can integrate HTML validation into your development workflow using CI/CD pipelines, pre-commit hooks, or build tools. For quick validation, our free online HTML validator provides instant results without any setup. Validate HTML before deployment to catch errors early and maintain code quality.

Why is HTML validation important for SEO?

Valid HTML helps search engines understand and index your content better. Invalid HTML can cause parsing errors, missing meta tags, improper heading hierarchy, and accessibility issues—all of which can hurt SEO rankings. Valid HTML with proper semantic structure improves crawlability, indexing, and search engine visibility.

HTML Validation Guides

Step-by-step guides for validating HTML in different scenarios:

All HTML Validator guides (20 total)

Related HTML & Developer Tools

Explore our complete suite of developer tools for HTML and web development:

Validates charset, viewport, and canonical meta tags

🔒

Catches duplicate meta declarations

Checks attribute values on meta elements

Free with no sign-up required

Cost
Free tier
Sign-up
Not required
Processing
Tool-specific
Privacy
Clearly disclosed
IframeResponsiveAttribution included

Add this HTML Validator to your website

Drop the HTML Validator into a blog post, product docs, intranet, or school portal with one iframe. Processing, privacy, and usage limits are the same as on the full tool page.

  • One copy-ready line of HTML
  • Responsive — adapts to any container width
  • No API credentials are placed in the snippet

Embed code

<iframe
  src="https://www.fixtools.io/html/html-validator?embed=1"
  width="100%"
  height="780"
  frameborder="0"
  style="border:0;border-radius:16px;max-width:900px;"
  title="HTML Validator by FixTools"
  loading="lazy"
  allow="clipboard-write"
></iframe>

Attribution-friendly: a small "Powered by FixTools" link appears in the embed footer.

Meta Tags, Open Graph, and Canonical Links: What Validators Check and What They Miss

The HTML specification defines a set of standard meta element names and the required attributes that go with each one. The charset meta element must use the charset attribute and its value must be a valid character encoding label drawn from the WHATWG Encoding Standard, with utf-8 being the universally recommended value for modern web pages. The viewport meta tag is not standardised in the HTML Living Standard but is universally supported across browsers and is essential for correct mobile rendering. The meta name and content pattern covers standardised name values for author, description, keywords, robots, generator, and several others, with each name having its own conventions around the content value format. The HTML validator checks that meta elements have the correct attribute syntax, that required attributes are present where the spec requires them, and that the charset declaration appears as the first element in the head to satisfy the HTML5 requirement that character encoding be declared within the first 1024 bytes of the document for parser correctness.

Open Graph tags (og:title, og:description, og:image, og:url, og:type, and the many other og:* properties defined by Facebook) use the property attribute rather than the name attribute, following the RDFa pattern that Open Graph borrowed from semantic web technologies. Twitter Card tags use the name attribute with values like twitter:card, twitter:title, twitter:description, and twitter:image, following the standard meta name pattern but with platform-specific name prefixes. Neither Open Graph nor Twitter Card is defined in the HTML specification itself, but both are validated against their own schemas by the respective platforms when they crawl your page. The HTML validator will check that meta elements with these attributes have correct basic HTML structure, including proper attribute syntax and required attribute presence, but it will not validate whether the og:image URL is actually reachable or whether the og:type value is in Facebook's permitted list of types.

Canonical link elements use rel="canonical" on a link element specifically, not a meta element, which is a frequent source of confusion for developers writing canonical declarations for the first time. A common error pattern is writing a meta tag with a name="canonical" attribute instead of the correct link element with rel="canonical". The HTML spec does not define a canonical meta name, so meta name="canonical" content="..." is simply ignored by search engines and provides no canonical signal at all despite looking superficially correct. The correct markup is link rel="canonical" href="..." placed in the head section, and ideally the href value should be an absolute URL including scheme and hostname to remove any ambiguity for the crawler. HTML validation catches misuse of the link element and incorrect rel attribute values, and duplicate canonical declarations are flagged as duplicate element errors that confuse search engine crawlers about your intended canonical URL.

There is one additional category of meta tag issues that is worth understanding even though it falls outside what the validator can directly check. Meta tags affect rendering and indexing only if they are actually present in the HTML that reaches the user agent or crawler. Single-page applications that inject meta tags dynamically via JavaScript may have correct meta tags in the rendered DOM but missing or incorrect meta tags in the initial HTML response, which is what crawlers and social platforms see when they fetch the page. Validation of the static HTML response will not flag this because the meta tags really are missing from that response. Server-side rendering or pre-rendering is the typical fix, and validating the rendered output of those techniques confirms that the meta tags are present where they need to be.

How to use this tool

💡

Paste your full HTML including the complete head section. Validation will check meta element structure, charset declaration placement, and link element attributes. Fix structural errors before testing social sharing previews.

How It Works

Step-by-step guide to validate html meta tags online:

  1. 1

    Paste the full HTML document

    Paste the complete HTML including the entire head section with all meta and link elements. The validator needs the full document to apply head-section rules correctly because some checks depend on element order and overall document structure rather than just isolated meta tag syntax.

  2. 2

    Validate

    Click the validate button to check the head section structure against the spec. The validator will examine every meta and link element, check attribute presence and values, and report any structural problems including duplicate declarations and misplaced charset tags.

  3. 3

    Fix meta tag structural errors

    Address errors related to missing attributes on meta elements, incorrect placement of the charset declaration, duplicate meta name declarations such as multiple meta description tags, and any unclosed meta elements that are causing downstream parse errors in the head section.

  4. 4

    Check canonical link syntax

    Confirm that you are using a link element with rel="canonical" and not a meta element with name="canonical". The latter is a common mistake that produces no canonical signal at all because the HTML spec does not define canonical as a meta name value.

  5. 5

    Test social sharing after validation

    Use the Facebook Sharing Debugger or Twitter Card Validator to confirm that Open Graph and Twitter Card tags actually produce the expected previews when the page is shared, now that the underlying HTML errors have been fixed. These platform tools test what the validator cannot test.

Real-world examples

Common situations where this approach makes a real difference:

Debugging a page that shows wrong social preview

A page consistently shares with no image preview on Facebook even though the og:image tag appears correct on visual inspection. Validating the HTML reveals an unclosed meta tag earlier in the head section that causes the og:image meta element to be malformed in the parser's view of the document, so Facebook's crawler never sees a valid og:image declaration. Fixing the unclosed tag immediately restores the Open Graph image preview without any other changes needed.

Auditing a site migration for head section completeness

After migrating a site to a new content management system, validation of several representative pages reveals missing charset declarations on pages that lost them during the migration, duplicate canonical link elements on pages where both the old and new CMS were generating canonicals, and pages where the viewport meta tag was dropped entirely. Fixing these issues ensures consistent browser rendering across the migrated content and prevents duplicate content indexing issues that would have hurt search rankings.

Validating a new landing page before launch

A new product landing page is validated as part of the pre-launch checklist. Validation catches a meta description that exceeds reasonable length limits and may be truncated in search results, a malformed canonical link with a relative URL where an absolute URL was intended for crawler clarity, and a viewport tag using a deprecated syntax that produces inconsistent mobile rendering in older browsers. All three issues are fixed before the page goes live.

Checking template meta tags after a framework upgrade

After upgrading a frontend framework to a new major version, automated template generation introduces a duplicate title element when the new version's default head template combines with the existing application-level head template, and the new version changes the order of meta tags so the charset declaration no longer appears first in the head section. Validation catches both issues before the upgrade is deployed to production, where they would have caused subtle rendering and indexing problems.

Pro tips

Get better results with these expert suggestions:

1

Charset declaration must be the first element in head

The HTML5 spec requires the charset meta tag to appear within the first 1024 bytes of the document, which in practice means it should be the first element inside the head section before any other meta tags or link elements. Placing other elements before the charset declaration is a spec violation that strict validators flag explicitly. The reason for the rule is that the parser must know the document encoding before it encounters any text that might be affected by the encoding, including text inside title elements or other meta tag content values.

2

Canonical should use an absolute URL

The canonical link element is processed by search engine crawlers, which need an absolute URL to unambiguously determine the canonical page address regardless of which URL the crawler initially used to reach the page. Using a relative URL in the canonical href is technically valid HTML and the spec allows it, but it is ambiguous for crawlers and may produce inconsistent canonicalisation behavior across different search engines. Use the full absolute URL including the scheme and hostname in every canonical declaration to remove this ambiguity entirely.

3

One title element only

The HTML spec permits exactly one title element in the head section of any HTML document. Duplicate title elements are a spec violation that validators flag. CMS themes and plugins sometimes inject a second title element accidentally, particularly when SEO plugins conflict with the theme's default title output and both end up adding their own title to the head. Validation catches this duplication quickly and identifies which two locations in the document each title element is being generated from.

4

Validate after every CMS or plugin update

CMS plugins frequently modify the head section to add tracking tags, SEO meta tags, analytics scripts, or other integrations. Updates to any of these plugins can introduce structural errors in the head section that were not present before the update, often because the plugin authors did not consider all possible interactions with other plugins. A quick validation pass after any plugin update catches regressions before they affect live site indexing or social sharing, which is much harder to debug after the fact.

FAQ

Frequently asked questions

HTML validation checks that meta elements have correct basic HTML structure, including the required name or property attribute, the content attribute, and absence of malformed attribute syntax. It validates the HTML of Open Graph tags as ordinary meta elements but does not validate against the Open Graph protocol specification itself, which means it cannot tell you whether your og:type value is in Facebook's permitted list, whether your og:image URL is reachable, or whether your og:image meets Facebook's recommended dimensions. For Open Graph-specific validation, use the Facebook Sharing Debugger at developers.facebook.com/tools/debug which checks the Open Graph rules directly.
The HTML specification requires a charset declaration (a meta element with a charset attribute) and a title element in every HTML document for it to be considered conformant. A viewport meta tag is not technically required by the spec but is essential for correct mobile rendering and is universally recommended for any modern web page. Meta description is not required by the spec either, but it is strongly recommended for SEO because search engines often use it as the snippet text in search results. Open Graph and Twitter Card tags are optional and only needed if you want to control how the page previews on social platforms.
The canonical element is a link element, not a meta element, and the correct syntax is link rel="canonical" href="https://example.com/page/" placed somewhere inside the head section of the document. A common mistake is using meta name="canonical" content="..." which is not a recognised meta name in the HTML spec and is silently ignored by search engines, providing no canonical signal at all. The href value should be an absolute URL including scheme and hostname to remove any ambiguity for crawlers about which URL is the canonical version of the content.
No, you should have exactly one meta description tag per page. Multiple meta description tags are a spec violation and produce undefined behavior across search engines: some engines use only the first instance, others may pick the longest, and others may ignore all of them when there is ambiguity. HTML validation flags duplicate meta elements with the same name value as warnings or errors depending on the rule set. Audit your CMS and plugins to ensure only one meta description is being emitted per page, and choose carefully which source should be authoritative when multiple plugins try to emit one.
The charset declaration must appear before any content that could be affected by character encoding, which in practice means first in the head section, before the title element or any other meta tag. The title element should be in the head and should appear early enough that it is parsed before downstream tools need it. Other meta tags can generally appear in any order within the head section without affecting their interpretation. Some validators may warn if charset is not the first head element, but no other specific ordering is required by the spec for meta tags as a whole.
A meta tag with a structural error such as an unclosed attribute value, a missing content attribute, or invalid characters in an attribute value may not be parsed correctly by search engine crawlers. The crawler may skip the malformed element entirely, misread adjacent elements because the parser state was corrupted by the malformation, or extract incorrect values. The most common consequence is that the intended meta description or Open Graph data does not appear in search results or social sharing previews, leading to lower click-through rates from those surfaces because the default fallback content is usually less compelling than the intended meta content.
Always paste the full HTML when validating meta tags rather than just an extracted head section. Some errors that surface in the head section are actually caused by errors elsewhere in the body, and the head section is affected by the overall document structure including the doctype declaration and html element attributes. Validating only a fragment of the head section may miss document-level errors and may produce misleading results because the validator does not have the full context it needs to apply rules correctly. Pasting the complete page gives the validator everything it needs.
After HTML validation passes, use the Facebook Sharing Debugger at developers.facebook.com/tools/debug to fetch your page and see how Facebook interprets the Open Graph tags. The debugger shows the og:title, og:description, and og:image that Facebook extracted, lets you re-scrape the page if you have updated the tags, and surfaces any Open Graph-specific warnings. For Twitter Cards, use the Twitter Card Validator. For LinkedIn, the Post Inspector tool performs a similar function. Each platform has its own debugger because each interprets the tags slightly differently.
The modern HTML5 syntax for declaring character encoding is meta charset="utf-8" as a single attribute. The older HTML4 syntax was meta http-equiv="content-type" content="text/html; charset=utf-8" which combined the content type and charset declarations in one element. Both work in modern browsers but the HTML5 short form is preferred for new pages because it is shorter, easier to read, and matches current spec guidance. If you encounter the old syntax in legacy code, replacing it with the short form is a safe modernisation that does not change behavior.

Related guides

More use-case guides for the same tool:

Ready to get started?

Open HTML Validator to review its free limits and processing method.

Open HTML Validator →

Free tier · No account needed · Transparent limits