OnlineFreeTools.org
  • Home
  • Image editing tools
    • Add Text Watermark to Photo — Local Browser Tool
    • Extract Colors from Image — Palette & Click Pick
    • Flip Image — Mirror Horizontally or Vertically
    • Add Border to Image — Color & Width Online
    • Image Compressor — Resize, Quality & Target Size Local
    • Crop & Resize Image — Local Aspect Presets
    • Photo EXIF Viewer & Remover — GPS, Camera & Local Strip
    • Image Format Converter — PNG JPEG WebP AVIF BMP GIF ICO SVG
    • Convert Image to Grayscale — Black & White Online
    • Merge Images — Combine Photos into One Collage
    • Image Optimizer — WebP, AVIF & MozJPEG Local
    • Overlay Images — Put a Logo on a Photo
    • Image to Base64 Converter — Encode & Decode Locally
    • Images to GIF — Make an Animated GIF Locally
    • Images to PDF — Combine Photos into One File
    • Images to PowerPoint — Photos to PPTX Slides
    • Images to Word — Build a DOCX from Photos
    • PDF Page to Image Sizes — Multi-Size Export Pack
    • PDF to JPG — Convert Pages to Images in Your Browser
  • Design tools
    • Generate Brand Color Scale — 50–950 Palette & CSS Tokens
    • Brand Style Guide — Generate a Modular Draft You Can Edit
    • Smart Website Color Scheme — Semantic CSS Tokens
    • WCAG Contrast Checker — AA/AAA Ratio Online
  • PDF tools
    • Compress PDF — Shrink File Size in Your Browser
    • Crop PDF — Trim Page Margins in Your Browser
    • Merge PDF — Combine Files in Your Browser
    • Organize PDF — Reorder or Remove Pages in Your Browser
    • Add Page Numbers to PDF — In Your Browser
    • PDF to Markdown — Extract Text for Notes in Your Browser
    • PDF Watermark — Stamp Text on Every Page in Your Browser
    • Protect PDF — Password-Encrypt in Your Browser
    • Rotate PDF — Fix Page Orientation in Your Browser
    • Split PDF — Extract Pages Locally
    • Unlock PDF — Remove Password You Already Know
  • Developer tools
    • Add WWW to DNS — A/CNAME, Apex Rules & Provider Guides
    • Base64 Encode & Decode — Convert Text in Your Browser
    • Core Web Vitals Checker — Grade your page-experience scores
    • CSV ↔ JSON Converter — Types, Delimiters & Local
    • Domain Lookup — Check DNS Records & Registration Online
    • File Hash Checker — Verify Digests in Your Browser
    • Hreflang Generator — Create hreflang tags for multilingual sites
    • HTML Entity Encoder & Decoder — Escape, Unescape & Local
    • IndexNow — Bing URL Submit, Key Check & Status Codes
    • What Is My IP Address — See Your Public IP (IPv4 or IPv6)
    • JSON Schema Validator — Draft-07 Paths & Local
    • JWT Decoder — Read Header & Payload Locally (No Verify)
    • Markdown ↔ HTML Converter — Sanitize & Preview
    • Google SERP Preview — Check title & description snippets
    • Meta Tag Generator — Generate complete page head tags
    • On-Page SEO Checker — Find and fix page tag issues
    • Open Graph Preview — Check social share cards
    • Random Password Generator — Create Passwords Locally
    • Robots.txt Generator — Manage Allow & Disallow Rules for AI Crawlers
    • JSON-LD Generator — Schema Markup for FAQ, Article & Breadcrumb
    • XML Sitemap Generator — Create sitemap.xml From URLs
    • Compare Two Texts Online — Text Diff Checker
    • Time Zone Converter — Compare One Moment Worldwide
    • Unix Timestamp Converter — Epoch ↔ Readable Time
    • UTM Builder — Create campaign tracking URLs
    • UUID & ULID Generator — Create IDs in Your Browser
    • Check HTTP Response Headers Online
    • YAML ↔ JSON Converter — Types, Multi-doc & Local
  • Calculators
    • Acceleration Calculator — Change in Velocity
    • Age Calculator — Chronological Age from Birthdate
    • Aspect Ratio Calculator — How to Calculate and Scale Ratios
    • BMI Calculator — How to Calculate Body Mass Index
    • BMR & TDEE Calculator — How to Calculate Daily Calories
    • Body Fat Calculator — How to Estimate Body Fat Percentage
    • Break-Even Calculator — How to Calculate Break-Even Point
    • CAGR Calculator — How to Calculate Compound Annual Growth Rate
    • Circle Calculator — Area and Circumference
    • Compound Interest Calculator — How to Calculate Future Value
    • Concrete Calculator — How to Estimate Concrete Volume
    • Confidence Interval Calculator — How to Calculate a CI
    • Contribution Margin Calculator — Price Minus Variable Cost
    • Date Difference Calculator — Days and Weeks
    • Debt Payoff Calculator — Months to Clear a Balance
    • Density Calculator — Mass over Volume
    • Discount Calculator — How to Calculate Sale Price
    • EMI Calculator — How to Calculate Loan Payments
    • Exponent Calculator — How to Calculate Powers
    • GPA Calculator — How to Calculate Weighted GPA
    • Gradient Calculator — Multivariable ∇f (Partial Derivatives)
    • Gross Margin Calculator — How to Calculate Gross Margin
    • Heart Rate Zone Calculator
    • Ideal Weight Calculator — How to Estimate Ideal Body Weight
    • Inflation Calculator — Future Purchasing Power
    • IRR Calculator — Internal Rate of Return
    • Logarithm Calculator — How to Calculate Logs
    • Macro Calculator — Calories to Protein Carb Fat Grams
    • How to Calculate Marginal Revenue — MR Calculator (ΔTR / ΔQ)
    • Markup Calculator — How to Calculate Markup Percentage
    • Mean Calculator — Average of a Number List
    • Median and Mode Calculator
    • NPV Calculator — How to Calculate Net Present Value
    • Ohm’s Law Calculator — Resistance and Power
    • One-Rep Max Calculator (Epley)
    • P-Value Calculator — How to Calculate a P-Value
    • Pace Calculator — min/km and Speed
    • Paint Calculator — How to Estimate Paint Needed
    • Payback Period Calculator — Years to Recover Investment
    • Percentage Change Calculator — From Old Value to New
    • Permutation and Combination Calculator
    • Present Value Calculator — PV and FV Modes
    • Profit Margin Calculator — Net or Operating Margin
    • Pythagorean Theorem Calculator — How to Find a Missing Side
    • Quadratic Equation Solver — Roots and Discriminant
    • ROI Calculator — How to Calculate Return on Investment
    • Rule of 72 Calculator — Years to Double
    • Salary to Hourly Calculator — How to Convert Pay Rates
    • Sample Size Calculator — How to Estimate Required n
    • Scientific Notation Calculator — How to Convert Scientific Notation
    • Significant Figures Calculator — How to Count and Round Sig Figs
    • Slope Calculator — How to Calculate Slope Between Two Points
    • Standard Deviation Calculator — How to Calculate SD and Variance
    • Tile Calculator — How to Estimate Tile Quantity
    • Tip Calculator — Tip Amount and Split
    • Triangle Area Calculator
    • VAT / GST Calculator — Add or Extract Tax
    • Velocity Calculator — Distance over Time
    • Volume Calculator — Box and Sphere
    • Z-Score Calculator — How to Calculate a Standard Score
    • Square Feet to Square Meters — Area Converter for Homes & Renovation
    • Unit Converter — Length / Mass / Temperature / Area / Volume / Speed
  • where2use
  • Tool types
  • English
  • 中文
  • Español
  • العربية
  • Português
  • Bahasa Indonesia
  • Français
  • 日本語
  • Русский
  • Deutsch

Tools

Add Text Watermark to Photo — Local Browser ToolAdd WWW to DNS — A/CNAME, Apex Rules & Provider GuidesBase64 Encode & Decode — Convert Text in Your BrowserGenerate Brand Color Scale — 50–950 Palette & CSS TokensBrand Style Guide — Generate a Modular Draft You Can EditExtract Colors from Image — Palette & Click PickCompress PDF — Shrink File Size in Your BrowserCore Web Vitals Checker — Grade your page-experience scoresCrop PDF — Trim Page Margins in Your BrowserCSV ↔ JSON Converter — Types, Delimiters & LocalDomain Lookup — Check DNS Records & Registration OnlineFile Hash Checker — Verify Digests in Your BrowserFlip Image — Mirror Horizontally or VerticallyAcceleration Calculator — Change in VelocityAge Calculator — Chronological Age from BirthdateAspect Ratio Calculator — How to Calculate and Scale RatiosBMI Calculator — How to Calculate Body Mass IndexBMR & TDEE Calculator — How to Calculate Daily CaloriesBody Fat Calculator — How to Estimate Body Fat PercentageBreak-Even Calculator — How to Calculate Break-Even PointCAGR Calculator — How to Calculate Compound Annual Growth RateCircle Calculator — Area and CircumferenceCompound Interest Calculator — How to Calculate Future ValueConcrete Calculator — How to Estimate Concrete VolumeConfidence Interval Calculator — How to Calculate a CIContribution Margin Calculator — Price Minus Variable CostDate Difference Calculator — Days and WeeksDebt Payoff Calculator — Months to Clear a BalanceDensity Calculator — Mass over VolumeDiscount Calculator — How to Calculate Sale PriceEMI Calculator — How to Calculate Loan PaymentsExponent Calculator — How to Calculate PowersGPA Calculator — How to Calculate Weighted GPAGradient Calculator — Multivariable ∇f (Partial Derivatives)Gross Margin Calculator — How to Calculate Gross MarginHeart Rate Zone CalculatorIdeal Weight Calculator — How to Estimate Ideal Body WeightInflation Calculator — Future Purchasing PowerIRR Calculator — Internal Rate of ReturnLogarithm Calculator — How to Calculate LogsMacro Calculator — Calories to Protein Carb Fat GramsHow to Calculate Marginal Revenue — MR Calculator (ΔTR / ΔQ)Markup Calculator — How to Calculate Markup PercentageMean Calculator — Average of a Number ListMedian and Mode CalculatorNPV Calculator — How to Calculate Net Present ValueOhm’s Law Calculator — Resistance and PowerOne-Rep Max Calculator (Epley)P-Value Calculator — How to Calculate a P-ValuePace Calculator — min/km and SpeedPaint Calculator — How to Estimate Paint NeededPayback Period Calculator — Years to Recover InvestmentPercentage Change Calculator — From Old Value to NewPermutation and Combination CalculatorPresent Value Calculator — PV and FV ModesProfit Margin Calculator — Net or Operating MarginPythagorean Theorem Calculator — How to Find a Missing SideQuadratic Equation Solver — Roots and DiscriminantROI Calculator — How to Calculate Return on InvestmentRule of 72 Calculator — Years to DoubleSalary to Hourly Calculator — How to Convert Pay RatesSample Size Calculator — How to Estimate Required nScientific Notation Calculator — How to Convert Scientific NotationSignificant Figures Calculator — How to Count and Round Sig FigsSlope Calculator — How to Calculate Slope Between Two PointsStandard Deviation Calculator — How to Calculate SD and VarianceTile Calculator — How to Estimate Tile QuantityTip Calculator — Tip Amount and SplitTriangle Area CalculatorVAT / GST Calculator — Add or Extract TaxVelocity Calculator — Distance over TimeVolume Calculator — Box and SphereZ-Score Calculator — How to Calculate a Standard ScoreHreflang Generator — Create hreflang tags for multilingual sitesHTML Entity Encoder & Decoder — Escape, Unescape & LocalAdd Border to Image — Color & Width OnlineImage Compressor — Resize, Quality & Target Size LocalCrop & Resize Image — Local Aspect PresetsPhoto EXIF Viewer & Remover — GPS, Camera & Local StripImage Format Converter — PNG JPEG WebP AVIF BMP GIF ICO SVGConvert Image to Grayscale — Black & White OnlineMerge Images — Combine Photos into One CollageImage Optimizer — WebP, AVIF & MozJPEG LocalOverlay Images — Put a Logo on a PhotoImage to Base64 Converter — Encode & Decode LocallyImages to GIF — Make an Animated GIF LocallyImages to PDF — Combine Photos into One FileImages to PowerPoint — Photos to PPTX SlidesImages to Word — Build a DOCX from PhotosIndexNow — Bing URL Submit, Key Check & Status CodesWhat Is My IP Address — See Your Public IP (IPv4 or IPv6)JSON Schema Validator — Draft-07 Paths & LocalJWT Decoder — Read Header & Payload Locally (No Verify)Markdown ↔ HTML Converter — Sanitize & PreviewMerge PDF — Combine Files in Your BrowserGoogle SERP Preview — Check title & description snippetsMeta Tag Generator — Generate complete page head tagsOn-Page SEO Checker — Find and fix page tag issuesOpen Graph Preview — Check social share cardsOrganize PDF — Reorder or Remove Pages in Your BrowserRandom Password Generator — Create Passwords LocallyAdd Page Numbers to PDF — In Your BrowserPDF Page to Image Sizes — Multi-Size Export PackPDF to JPG — Convert Pages to Images in Your BrowserPDF to Markdown — Extract Text for Notes in Your BrowserPDF Watermark — Stamp Text on Every Page in Your BrowserProtect PDF — Password-Encrypt in Your BrowserRobots.txt Generator — Manage Allow & Disallow Rules for AI CrawlersRotate PDF — Fix Page Orientation in Your BrowserJSON-LD Generator — Schema Markup for FAQ, Article & BreadcrumbXML Sitemap Generator — Create sitemap.xml From URLsSmart Website Color Scheme — Semantic CSS TokensSplit PDF — Extract Pages LocallySquare Feet to Square Meters — Area Converter for Homes & RenovationCompare Two Texts Online — Text Diff CheckerTime Zone Converter — Compare One Moment WorldwideUnit Converter — Length / Mass / Temperature / Area / Volume / SpeedUnix Timestamp Converter — Epoch ↔ Readable TimeUnlock PDF — Remove Password You Already KnowUTM Builder — Create campaign tracking URLsUUID & ULID Generator — Create IDs in Your BrowserWCAG Contrast Checker — AA/AAA Ratio OnlineCheck HTTP Response Headers OnlineYAML ↔ JSON Converter — Types, Multi-doc & Local

Hreflang Generator — Create hreflang tags for multilingual sites

Without hreflang, Google may treat your translated pages as duplicates and show the wrong language version in search. Turn a set of language URLs into hreflang markup in three forms: <link> tags, HTTP Link header and sitemap <xhtml:link>. Steps: paste each language URL with its code, choose a form, copy the generated snippet. Every URL gets its own self-referencing hreflang, and an optional x-default fallback can be added. Runs entirely on your device—nothing is uploaded. Example: en, es and ja versions of one page.

Each line is "language-code URL" or "URL language-code". Codes use the BCP 47 form such as en, en-US or zh-Hans.
Optional. x-default tells Google which version to show when no language matches, useful for a root or English homepage.

How it works

The generator parses each line into a language code and a URL, then renders the same set of relationships in three forms. The <link> form goes into the <head> of each page. The HTTP Link header form is set on the server response. The sitemap form embeds <xhtml:link> inside each <url> block. Every URL gets a self-referencing hreflang so each language version points back to itself, and the optional x-default entry covers visitors whose language is not listed.

Rules used by the generator

These rules come from Google Search Central and the BCP 47 language tag standard.

  • Each language version must include a self-referencing hreflang that points back to its own URL. Skipping it weakens the signal.
  • Every URL must be listed from every language version: the full set of alternates appears on each page, not just one direction.
  • Language codes use BCP 47: a two-letter language, optionally a region (en-US) and optionally a script (zh-Hans). x-default is the special fallback code.
  • x-default points to the page shown when no listed language matches, for example an English root page. Google may use it as a fallback for all undetected languages.
  • Choose one delivery form per set: the <link> tags in HTML, the HTTP Link header, or sitemap xhtml:link. Do not mix forms for the same page set, or signals can contradict.

Example

The sample lists three versions of one page: https://example.com/ (en), https://example.com/es/ (es) and https://example.com/ja/ (ja). The generated <link> tags include self-references for each language plus an optional x-default pointing to the English root.

Good use cases

  • Launching a multilingual site: generate the <link> tags for each template once and verify every language version lists the full set.
  • After a site restructure, regenerate the markup so the URL mapping stays consistent across languages instead of drifting.
  • When search results show the wrong language, check that self-references and x-default exist and that the URLs point to canonical pages.

Frequently asked questions

Which of the three forms should I use?

Use the <link> tags when you can edit the page HTML. Use the HTTP Link header when pages are served by a server you control and HTML is hard to change. Use the sitemap form when you prefer keeping it in the XML sitemap.

When should I add x-default?

x-default tells Google which version to show when the visitor language does not match any listed code. Add it when you have a root or fallback page, usually English.

Does every URL need a self-referencing hreflang?

Yes. Each language version must include its own URL in the set, with a self-referencing hreflang pointing back to itself. Google uses the complete set to pick the right page per language.

What language code format is valid?

BCP 47 codes: a two- or three-letter language, optionally a region (en-US) and optionally a script (zh-Hans). Lowercase the language, and do not invent codes such as "en-us-en".

Should hreflang go in <head> or in the sitemap?

Either works, but use one consistent form per page set. The <link> tags live in <head>, the HTTP Link header is sent with the response, and the sitemap uses xhtml:link blocks.

Are my URLs uploaded anywhere?

No. The generator runs entirely in your browser and nothing is uploaded.

Related tools

  • XML Sitemap Generator — Create sitemap.xml From URLs
  • JSON-LD Generator — Schema Markup for FAQ, Article & Breadcrumb
  • Meta Tag Generator — Generate complete page head tags
  • UTM Builder — Create campaign tracking URLs

Share this tool

Share on social networks, copy the page link, or use your device share sheet.

XFacebookLinkedInRedditWhatsAppTelegram

https://onlinefreetools.org/tools/hreflang-generator

Questions or feedback

Something unclear, broken, or missing? Draft a message below — we read every note about these tools.

Email: dailyonetools@outlook.com

References

  • Search Central — Localized versions (hreflang)
  • BCP 47 — Tags for identifying languages
OnlineFreeTools.org · Learning project · Iterating
About·Privacy·Terms·Contact