Title tags
The <title> tag is the single most important on-page SEO element. It appears as the blue clickable headline in Google search results and as the browser tab label.
- Length: 50โ60 characters. Google truncates longer titles at ~580px width
- Format: Primary keyword first, then brand name last โ Free HTML Formatter | htmlformatters.com
- Unique: Every page must have a unique title. Duplicate titles split ranking signals
- Avoid: Keyword stuffing, ALL CAPS, clickbait that mismatches the page content
<title>Free HTML Formatter & Beautifier Online | htmlformatters.com</title>
Meta descriptions
Meta descriptions don't directly affect rankings but significantly impact click-through rate (CTR). A well-written description can increase clicks by 5โ10% even without a position change.
- Length: 150โ160 characters
- Include: Primary keyword, clear value proposition, subtle call to action
- Unique: One per page โ Google may rewrite them, but yours is the starting point
<meta name="description" content="Format, beautify, and validate HTML online for free.
Instant indentation, error detection, and live preview. No login required.">
Heading structure
Headings (h1โh6) give search engines a structured outline of your page. Google uses headings to understand the hierarchy and relationships between topics.
- One
<h1>per page โ the primary topic, contains the main keyword <h2>for main sections,<h3>for subsections- Never skip levels (h1 โ h3 is wrong)
- Include secondary keywords naturally in h2/h3 headings
- Headings should describe the content that follows โ not be decorative
Schema markup
Schema.org structured data helps Google display rich results โ star ratings, FAQ dropdowns, how-to steps, breadcrumbs. It's added as JSON-LD inside a <script type="application/ld+json"> block in <head>.
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebApplication",
"name": "HTML Formatter",
"url": "https://htmlformatters.com/",
"description": "Free online HTML formatter and validator",
"applicationCategory": "DeveloperApplication",
"operatingSystem": "Web"
}
</script>
Canonical URLs
The canonical tag tells Google which version of a URL is the definitive one. This prevents duplicate content penalties when the same page is accessible at multiple URLs.
<link rel="canonical" href="https://htmlformatters.com/html-formatter">
- Always use absolute URLs (with https:// and domain)
- The canonical should match the URL in your sitemap
- Self-referencing canonicals (a page pointing to itself) are recommended even when there's no duplication risk
Open Graph and social tags
Open Graph tags control how your page appears when shared on LinkedIn, Twitter, Facebook, and Slack. Without them, platforms guess โ often incorrectly.
<meta property="og:title" content="Free HTML Formatter Online">
<meta property="og:description" content="Format and validate HTML instantly.">
<meta property="og:image" content="https://htmlformatters.com/og-image.jpg">
<meta property="og:url" content="https://htmlformatters.com/">
<meta name="twitter:card" content="summary_large_image">
Core Web Vitals and HTML
Core Web Vitals (LCP, FID/INP, CLS) are Google ranking signals. HTML choices directly impact all three:
- LCP (Largest Contentful Paint): Add
loading="eager"andfetchpriority="high"to hero images. Preload critical fonts - CLS (Cumulative Layout Shift): Always set
widthandheighton images and iframes to prevent layout shifts - INP (Interaction to Next Paint): Keep event handlers lean and avoid blocking the main thread
<!-- Hero image best practice -->
<img src="hero.webp" width="1200" height="600"
alt="HTML Formatter tool screenshot"
loading="eager" fetchpriority="high">
<!-- Lazy load below-fold images -->
<img src="feature.webp" width="600" height="400"
alt="Feature screenshot" loading="lazy">