Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

Add 5 more free tools

Blue Mousee17dbe2322e9
diff --git a/docs/app/components/Footer.tsx b/docs/app/components/Footer.tsx
index 26a9099bf..9add659e1 100644
--- a/docs/app/components/Footer.tsx
+++ b/docs/app/components/Footer.tsx
@@ -21,6 +21,11 @@ import {
ChartBarIcon,
WarningIcon,
ArrowsHorizontalIcon,
+ ScalesIcon,
+ ChartLineUpIcon,
+ CodeIcon,
+ MoneyIcon,
+ QrCodeIcon,
type IconProps,
} from "@phosphor-icons/react";
import type { FC, ReactNode } from "react";
@@ -103,6 +108,36 @@ const freeTools: NavItem[] = [
icon: TreeStructureIcon,
iconColor: "text-lime-400",
},
+ {
+ name: "A/B Test Calculator",
+ href: `${SITE}/tools/ab-test-calculator`,
+ icon: ScalesIcon,
+ iconColor: "text-orange-400",
+ },
+ {
+ name: "LTV Calculator",
+ href: `${SITE}/tools/ltv-calculator`,
+ icon: ChartLineUpIcon,
+ iconColor: "text-emerald-400",
+ },
+ {
+ name: "Meta Tags Generator",
+ href: `${SITE}/tools/meta-tags-generator`,
+ icon: CodeIcon,
+ iconColor: "text-sky-400",
+ },
+ {
+ name: "Ad Cost Calculator",
+ href: `${SITE}/tools/ad-cost-calculator`,
+ icon: MoneyIcon,
+ iconColor: "text-yellow-400",
+ },
+ {
+ name: "QR Code Generator",
+ href: `${SITE}/tools/qr-code-generator`,
+ icon: QrCodeIcon,
+ iconColor: "text-fuchsia-400",
+ },
];
const resources: NavItem[] = [
diff --git a/web/app/components/Footer/index.tsx b/web/app/components/Footer/index.tsx
index 5604f87ad..2d35c7384 100644
--- a/web/app/components/Footer/index.tsx
+++ b/web/app/components/Footer/index.tsx
@@ -24,6 +24,11 @@ import {
ChartBarIcon,
WarningIcon,
ArrowsHorizontalIcon,
+ ScalesIcon,
+ ChartLineUpIcon,
+ CodeIcon,
+ MoneyIcon,
+ QrCodeIcon,
} from '@phosphor-icons/react'
import _map from 'lodash/map'
import React, { memo, type FC } from 'react'
@@ -145,6 +150,56 @@ const freeTools: NavItem[] = [
icon: TreeStructureIcon,
iconColor: 'text-lime-400',
},
+ {
+ key: 'ab-test-calculator',
+ name: 'A/B Test Calculator',
+ href: isSelfhosted
+ ? `https://swetrix.com${routesPath.ab_test_calculator}`
+ : routesPath.ab_test_calculator,
+ internal: !isSelfhosted,
+ icon: ScalesIcon,
+ iconColor: 'text-orange-400',
+ },
+ {
+ key: 'ltv-calculator',
+ name: 'LTV Calculator',
+ href: isSelfhosted
+ ? `https://swetrix.com${routesPath.ltv_calculator}`
+ : routesPath.ltv_calculator,
+ internal: !isSelfhosted,
+ icon: ChartLineUpIcon,
+ iconColor: 'text-emerald-400',
+ },
+ {
+ key: 'meta-tags-generator',
+ name: 'Meta Tags Generator',
+ href: isSelfhosted
+ ? `https://swetrix.com${routesPath.meta_tags_generator}`
+ : routesPath.meta_tags_generator,
+ internal: !isSelfhosted,
+ icon: CodeIcon,
+ iconColor: 'text-sky-400',
+ },
+ {
+ key: 'ad-cost-calculator',
+ name: 'Ad Cost Calculator',
+ href: isSelfhosted
+ ? `https://swetrix.com${routesPath.ad_cost_calculator}`
+ : routesPath.ad_cost_calculator,
+ internal: !isSelfhosted,
+ icon: MoneyIcon,
+ iconColor: 'text-yellow-400',
+ },
+ {
+ key: 'qr-code-generator',
+ name: 'QR Code Generator',
+ href: isSelfhosted
+ ? `https://swetrix.com${routesPath.qr_code_generator}`
+ : routesPath.qr_code_generator,
+ internal: !isSelfhosted,
+ icon: QrCodeIcon,
+ iconColor: 'text-fuchsia-400',
+ },
]
const comparisons: NavItem[] = [
diff --git a/web/app/components/ToolsNav.tsx b/web/app/components/ToolsNav.tsx
index 4994ffda4..1b9642975 100644
--- a/web/app/components/ToolsNav.tsx
+++ b/web/app/components/ToolsNav.tsx
@@ -5,6 +5,11 @@ import {
LinkIcon,
FileMagnifyingGlassIcon,
CaretDownIcon,
+ ScalesIcon,
+ ChartLineUpIcon,
+ CodeIcon,
+ MoneyIcon,
+ QrCodeIcon,
} from '@phosphor-icons/react'
import { useState } from 'react'
import { Link, useLocation } from 'react-router'
@@ -47,6 +52,41 @@ export const TOOLS = [
href: '/tools/sitemap-validator',
icon: FileMagnifyingGlassIcon,
},
+ {
+ id: 'ab-test-calculator',
+ title: 'A/B Test Calculator',
+ description: 'Calculate statistical significance of your A/B tests',
+ href: '/tools/ab-test-calculator',
+ icon: ScalesIcon,
+ },
+ {
+ id: 'ltv-calculator',
+ title: 'LTV Calculator',
+ description: 'Calculate Customer Lifetime Value',
+ href: '/tools/ltv-calculator',
+ icon: ChartLineUpIcon,
+ },
+ {
+ id: 'meta-tags-generator',
+ title: 'Meta Tags Generator',
+ description: 'Generate SEO and Open Graph meta tags',
+ href: '/tools/meta-tags-generator',
+ icon: CodeIcon,
+ },
+ {
+ id: 'ad-cost-calculator',
+ title: 'Ad Cost Calculator',
+ description: 'Calculate CPM, CPC, and total ad costs',
+ href: '/tools/ad-cost-calculator',
+ icon: MoneyIcon,
+ },
+ {
+ id: 'qr-code-generator',
+ title: 'QR Code Generator',
+ description: 'Create customizable QR codes instantly',
+ href: '/tools/qr-code-generator',
+ icon: QrCodeIcon,
+ },
] as const
interface ToolsNavProps {
diff --git a/web/app/routes/tools.ab-test-calculator.tsx b/web/app/routes/tools.ab-test-calculator.tsx
new file mode 100644
index 000000000..e1a72803e
--- /dev/null
+++ b/web/app/routes/tools.ab-test-calculator.tsx
@@ -0,0 +1,531 @@
+import {
+ CaretDownIcon,
+ CheckCircleIcon,
+ WarningCircleIcon,
+ ChartLineUpIcon,
+} from '@phosphor-icons/react'
+import { useState, useEffect } from 'react'
+import type { MetaFunction } from 'react-router'
+import { redirect } from 'react-router'
+import type { SitemapFunction } from 'remix-sitemap'
+
+import { DitchGoogle } from '~/components/marketing/DitchGoogle'
+import { ToolsNav, ToolsNavMobile } from '~/components/ToolsNav'
+import { isSelfhosted } from '~/lib/constants'
+import Input from '~/ui/Input'
+import { Text } from '~/ui/Text'
+import Tooltip from '~/ui/Tooltip'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
+
+export const meta: MetaFunction = () => {
+ return [
+ ...getTitle('Free A/B Test Significance Calculator - Swetrix'),
+ ...getDescription(
+ 'Calculate statistical significance for your A/B tests to determine if your variation performs better than the control. Fast, free, and accurate.',
+ ),
+ ...getPreviewImage(),
+ ]
+}
+
+export const sitemap: SitemapFunction = () => ({
+ priority: 0.8,
+ exclude: isSelfhosted,
+})
+
+export async function loader() {
+ if (isSelfhosted) {
+ return redirect('/login', 302)
+ }
+
+ return null
+}
+
+interface Variant {
+ visitors: number
+ conversions: number
+}
+
+interface TestResults {
+ controlCR: number
+ variantCR: number
+ relativeImprovement: number
+ pValue: number
+ isSignificant: boolean
+ zScore: number
+}
+
+const FAQ_ITEMS = [
+ {
+ question: 'What is an A/B test?',
+ answer:
+ 'A/B testing (also known as split testing) is a method of comparing two versions of a webpage, app, or email against each other to determine which one performs better.',
+ },
+ {
+ question: 'What is statistical significance?',
+ answer:
+ 'Statistical significance helps you understand if the results of your A/B test are likely due to the changes you made, or if they just happened by random chance. A 95% confidence level means you can be 95% sure the results are not due to chance.',
+ },
+ {
+ question: 'What is the control and what is the variant?',
+ answer:
+ 'The "Control" is the original version of your webpage or app (Variant A). The "Variant" is the modified version (Variant B) you are testing to see if the changes improve performance.',
+ },
+ {
+ question: 'How many visitors do I need for an A/B test?',
+ answer:
+ 'The required sample size depends on your baseline conversion rate and the minimum detectable effect you want to measure. Generally, you need at least a few hundred conversions per variant for reliable results.',
+ },
+ {
+ question: 'What is a p-value?',
+ answer:
+ 'The p-value tells you the probability of seeing the observed difference in conversion rates if there actually was no underlying difference. A p-value less than 0.05 generally indicates statistical significance.',
+ },
+ {
+ question: 'Can I stop my test early if it reaches significance?',
+ answer:
+ 'It is generally not recommended to stop tests early just because they reach significance, as this can lead to false positives (the "peeking problem"). Always decide your sample size in advance and run the test until you reach it.',
+ },
+]
+
+export default function ABTestCalculator() {
+ const [control, setControl] = useState<Variant>({
+ visitors: 1000,
+ conversions: 50,
+ })
+ const [variant, setVariant] = useState<Variant>({
+ visitors: 1000,
+ conversions: 75,
+ })
+ const [confidenceLevel, setConfidenceLevel] = useState<number>(0.95)
+
+ const [results, setResults] = useState<TestResults | null>(null)
+
+ useEffect(() => {
+ calculateSignificance()
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [control, variant, confidenceLevel])
+
+ const calculateSignificance = () => {
+ if (
+ control.visitors <= 0 ||
+ variant.visitors <= 0 ||
+ control.conversions < 0 ||
+ variant.conversions < 0
+ ) {
+ setResults(null)
+ return
+ }
+
+ const p1 = control.conversions / control.visitors
+ const p2 = variant.conversions / variant.visitors
+
+ const pooledP =
+ (control.conversions + variant.conversions) /
+ (control.visitors + variant.visitors)
+ const se = Math.sqrt(
+ pooledP * (1 - pooledP) * (1 / control.visitors + 1 / variant.visitors),
+ )
+
+ let zScore = 0
+ let pValue = 1
+
+ if (se > 0) {
+ zScore = (p2 - p1) / se
+ // Approximate p-value for two-tailed test
+ pValue = 2 * (1 - normalCDF(Math.abs(zScore)))
+ }
+
+ let requiredZ = 1.96 // 95% default
+ if (confidenceLevel === 0.9) requiredZ = 1.645
+ if (confidenceLevel === 0.99) requiredZ = 2.576
+
+ const isSignificant = Math.abs(zScore) >= requiredZ
+ const relativeImprovement = p1 > 0 ? ((p2 - p1) / p1) * 100 : 0
+
+ setResults({
+ controlCR: p1 * 100,
+ variantCR: p2 * 100,
+ relativeImprovement,
+ pValue,
+ isSignificant,
+ zScore,
+ })
+ }
+
+ // Helper function to calculate CDF of standard normal distribution
+ const normalCDF = (x: number): number => {
+ const t = 1 / (1 + 0.2316419 * Math.abs(x))
+ const d = 0.3989423 * Math.exp((-x * x) / 2)
+ const p =
+ d *
+ t *
+ (0.3193815 +
+ t * (-0.3565638 + t * (1.781478 + t * (-1.821256 + t * 1.330274))))
+ return x > 0 ? 1 - p : p
+ }
+
+ const handleControlChange = (key: keyof Variant, value: string) => {
+ setControl({ ...control, [key]: parseInt(value) || 0 })
+ }
+
+ const handleVariantChange = (key: keyof Variant, value: string) => {
+ setVariant({ ...variant, [key]: parseInt(value) || 0 })
+ }
+
+ const formatPercentage = (val: number) => {
+ return (val > 0 && val < 0.01 ? '<0.01' : val.toFixed(2)) + '%'
+ }
+
+ return (
+ <div className='min-h-screen bg-gray-50 dark:bg-slate-950'>
+ <main className='mx-auto max-w-7xl px-4 py-12 sm:px-6 lg:px-8'>
+ <ToolsNavMobile className='mb-6 xl:hidden' />
+
+ <div className='xl:flex xl:items-start xl:gap-8'>
+ <div className='min-w-0 xl:flex-1'>
+ <Text as='h1' size='4xl' weight='bold' tracking='tight'>
+ A/B Test Significance Calculator
+ </Text>
+ <Text as='p' size='lg' colour='muted' className='mt-4'>
+ Determine if the differences in your A/B test conversion rates are
+ statistically significant.
+ </Text>
+
+ <div className='mt-12 grid gap-8 lg:grid-cols-3'>
+ {/* Input Section */}
+ <div className='space-y-8 lg:col-span-2'>
+ <div className='grid gap-6 md:grid-cols-2'>
+ {/* Control Group */}
+ <div className='rounded-xl bg-white p-6 ring-1 ring-gray-200 dark:bg-slate-800 dark:ring-slate-700'>
+ <h2 className='mb-4 text-xl font-semibold text-gray-900 dark:text-white'>
+ Control (Variant A)
+ </h2>
+ <div className='space-y-4'>
+ <Input
+ type='number'
+ label={
+ <>
+ Visitors
+ <Tooltip
+ className='ml-1'
+ text='Total number of users who saw the control version'
+ />
+ </>
+ }
+ value={control.visitors || ''}
+ onChange={(e) =>
+ handleControlChange('visitors', e.target.value)
+ }
+ className='w-full'
+ />
+ <Input
+ type='number'
+ label={
+ <>
+ Conversions
+ <Tooltip
+ className='ml-1'
+ text='Number of users who completed the desired action'
+ />
+ </>
+ }
+ value={control.conversions || ''}
+ onChange={(e) =>
+ handleControlChange('conversions', e.target.value)
+ }
+ className='w-full'
+ />
+ </div>
+ </div>
+
+ {/* Variant Group */}
+ <div className='rounded-xl bg-white p-6 ring-1 ring-gray-200 dark:bg-slate-800 dark:ring-slate-700'>
+ <h2 className='mb-4 text-xl font-semibold text-gray-900 dark:text-white'>
+ Variant (Variant B)
+ </h2>
+ <div className='space-y-4'>
+ <Input
+ type='number'
+ label={
+ <>
+ Visitors
+ <Tooltip
+ className='ml-1'
+ text='Total number of users who saw the new version'
+ />
+ </>
+ }
+ value={variant.visitors || ''}
+ onChange={(e) =>
+ handleVariantChange('visitors', e.target.value)
+ }
+ className='w-full'
+ />
+ <Input
+ type='number'
+ label={
+ <>
+ Conversions
+ <Tooltip
+ className='ml-1'
+ text='Number of users who completed the desired action'
+ />
+ </>
+ }
+ value={variant.conversions || ''}
+ onChange={(e) =>
+ handleVariantChange('conversions', e.target.value)
+ }
+ className='w-full'
+ />
+ </div>
+ </div>
+ </div>
+
+ <div className='rounded-xl bg-white p-6 ring-1 ring-gray-200 dark:bg-slate-800 dark:ring-slate-700'>
+ <label className='mb-2 block text-sm font-medium text-gray-700 dark:text-gray-300'>
+ Confidence Level
+ </label>
+ <select
+ className='block w-full rounded-md border-gray-300 py-2 pr-10 pl-3 text-base focus:border-indigo-500 focus:ring-indigo-500 focus:outline-none sm:text-sm dark:border-gray-600 dark:bg-slate-700 dark:text-white'
+ value={confidenceLevel}
+ onChange={(e) =>
+ setConfidenceLevel(parseFloat(e.target.value))
+ }
+ >
+ <option value={0.9}>90% (More false positives)</option>
+ <option value={0.95}>95% (Standard, recommended)</option>
+ <option value={0.99}>99% (Highly rigorous)</option>
+ </select>
+ </div>
+ </div>
+
+ {/* Results Section */}
+ <div className='lg:col-span-1'>
+ <div className='sticky top-8 space-y-6'>
+ <div className='rounded-xl bg-white p-6 ring-1 ring-gray-200 dark:bg-slate-800 dark:ring-slate-700'>
+ <h3 className='mb-4 text-lg font-semibold text-gray-900 dark:text-white'>
+ Test Results
+ </h3>
+
+ {!results ? (
+ <p className='text-sm text-gray-500 dark:text-gray-400'>
+ Enter valid data to see results.
+ </p>
+ ) : (
+ <div className='space-y-6'>
+ <div
+ className={`flex items-start gap-3 rounded-lg p-4 ${
+ results.isSignificant
+ ? 'bg-green-50 text-green-800 ring-1 ring-green-200 dark:bg-green-900/20 dark:text-green-300 dark:ring-green-800'
+ : 'bg-gray-50 text-gray-800 ring-1 ring-gray-200 dark:bg-slate-700/50 dark:text-gray-300 dark:ring-gray-600'
+ }`}
+ >
+ {results.isSignificant ? (
+ <CheckCircleIcon className='h-6 w-6 shrink-0 text-green-600 dark:text-green-400' />
+ ) : (
+ <WarningCircleIcon className='h-6 w-6 shrink-0 text-gray-500 dark:text-gray-400' />
+ )}
+ <div>
+ <p className='font-semibold'>
+ {results.isSignificant
+ ? 'Statistically Significant!'
+ : 'Not Significant'}
+ </p>
+ <p className='mt-1 text-sm opacity-90'>
+ {results.isSignificant
+ ? `The variant's performance is significantly different from the control at a ${
+ confidenceLevel * 100
+ }% confidence level.`
+ : `The results are not statistically significant. You may need more data or the variation has no real impact.`}
+ </p>
+ </div>
+ </div>
+
+ <div className='space-y-4'>
+ <div className='flex items-center justify-between'>
+ <span className='text-sm text-gray-600 dark:text-gray-400'>
+ Control CR
+ </span>
+ <span className='font-semibold text-gray-900 dark:text-white'>
+ {formatPercentage(results.controlCR)}
+ </span>
+ </div>
+ <div className='flex items-center justify-between'>
+ <span className='text-sm text-gray-600 dark:text-gray-400'>
+ Variant CR
+ </span>
+ <span className='font-semibold text-gray-900 dark:text-white'>
+ {formatPercentage(results.variantCR)}
+ </span>
+ </div>
+ <div className='flex items-center justify-between border-t border-gray-100 pt-3 dark:border-gray-700'>
+ <span className='text-sm text-gray-600 dark:text-gray-400'>
+ Relative Change
+ </span>
+ <span
+ className={`flex items-center gap-1 font-semibold ${
+ results.relativeImprovement > 0
+ ? 'text-green-600 dark:text-green-400'
+ : results.relativeImprovement < 0
+ ? 'text-red-600 dark:text-red-400'
+ : 'text-gray-900 dark:text-white'
+ }`}
+ >
+ {results.relativeImprovement > 0 && '+'}
+ {formatPercentage(results.relativeImprovement)}
+ {results.relativeImprovement > 0 ? (
+ <ChartLineUpIcon className='h-4 w-4' />
+ ) : results.relativeImprovement < 0 ? (
+ <ChartLineUpIcon className='h-4 w-4 rotate-180' />
+ ) : null}
+ </span>
+ </div>
+ <div className='flex items-center justify-between'>
+ <span className='text-sm text-gray-600 dark:text-gray-400'>
+ P-Value
+ </span>
+ <span className='font-mono text-sm text-gray-900 dark:text-white'>
+ {results.pValue < 0.001
+ ? '<0.001'
+ : results.pValue.toFixed(3)}
+ </span>
+ </div>
+ </div>
+ </div>
+ )}
+ </div>
+ </div>
+ </div>
+ </div>
+
+ {/* FAQ Section */}
+ <section className='mt-20 border-t border-gray-200 pt-16 dark:border-slate-700'>
+ <Text as='h2' size='3xl' weight='bold' tracking='tight'>
+ Free A/B Test Significance Calculator
+ </Text>
+ <Text
+ as='p'
+ size='lg'
+ colour='muted'
+ className='mt-4 leading-relaxed'
+ >
+ Stop guessing whether your website changes are actually
+ improving conversion rates. Our A/B testing calculator uses
+ robust statistical models to tell you if the performance
+ difference between your Control and Variant is real, or just
+ random noise.
+ </Text>
+
+ <div className='mt-12 grid gap-x-12 gap-y-10 md:grid-cols-2'>
+ <div>
+ <Text as='h3' size='xl' weight='semibold'>
+ Understanding Statistical Significance
+ </Text>
+ <Text as='p' colour='muted' className='mt-3'>
+ In A/B testing, statistical significance (often measured via
+ a p-value) indicates the likelihood that the difference in
+ conversion rates happened by chance. A 95% confidence level
+ means you can be 95% sure that the results are reliable and
+ not a fluke. If your test isn't significant, you may need to
+ run it longer to collect more data.
+ </Text>
+ </div>
+ <div>
+ <Text as='h3' size='xl' weight='semibold'>
+ Best Practices for Split Testing
+ </Text>
+ <ul className='mt-3 space-y-2'>
+ <li>
+ <Text colour='muted'>
+ <Text as='span' weight='semibold' colour='inherit'>
+ Test One Variable
+ </Text>{' '}
+ - Only change one element (like a button color or
+ headline) at a time so you know exactly what caused the
+ impact.
+ </Text>
+ </li>
+ <li>
+ <Text colour='muted'>
+ <Text as='span' weight='semibold' colour='inherit'>
+ Wait for Traffic
+ </Text>{' '}
+ - Don't stop tests early just because they show an early
+ winner. Wait until you hit your required sample size.
+ </Text>
+ </li>
+ <li>
+ <Text colour='muted'>
+ <Text as='span' weight='semibold' colour='inherit'>
+ Account for Seasonality
+ </Text>{' '}
+ - Run tests for at least one full business cycle (e.g.,
+ 1-2 weeks) to account for day-of-week traffic
+ variations.
+ </Text>
+ </li>
+ </ul>
+ </div>
+ </div>
+ </section>
+
+ <div className='mt-16'>
+ <h2 className='mb-8 text-center text-3xl font-bold text-gray-900 dark:text-white'>
+ Frequently Asked Questions
+ </h2>
+
+ <div className='space-y-4'>
+ {FAQ_ITEMS.map((item, index) => (
+ <details
+ key={index}
+ className='group rounded-lg border border-gray-200 bg-white dark:border-gray-700 dark:bg-slate-800'
+ >
+ <summary className='flex w-full cursor-pointer items-center justify-between px-6 py-4 text-left hover:bg-gray-50 dark:hover:bg-slate-700/50'>
+ <h3 className='text-lg font-medium text-gray-900 dark:text-white'>
+ {item.question}
+ </h3>
+ <CaretDownIcon className='h-5 w-5 text-gray-500 transition-transform group-open:rotate-180' />
+ </summary>
+ <div className='border-t border-gray-200 px-6 py-4 dark:border-gray-700'>
+ <p className='text-gray-600 dark:text-gray-400'>
+ {item.answer}
+ </p>
+ </div>
+ </details>
+ ))}
+ </div>
+ </div>
+
+ {/* FAQ Structured Data */}
+ <script
+ type='application/ld+json'
+ dangerouslySetInnerHTML={{
+ __html: JSON.stringify({
+ '@context': 'https://schema.org',
+ '@type': 'FAQPage',
+ mainEntity: FAQ_ITEMS.map((item) => ({
+ '@type': 'Question',
+ name: item.question,
+ acceptedAnswer: {
+ '@type': 'Answer',
+ text: item.answer,
+ },
+ })),
+ })
+ .replace(/</g, '\\u003c')
+ .replace(/\u2028|\u2029/g, ''),
+ }}
+ />
+
+ <DitchGoogle />
+ </div>
+
+ <aside className='hidden xl:sticky xl:top-12 xl:block xl:w-64 xl:shrink-0 xl:self-start'>
+ <ToolsNav />
+ </aside>
+ </div>
+ </main>
+ </div>
+ )
+}
diff --git a/web/app/routes/tools.ad-cost-calculator.tsx b/web/app/routes/tools.ad-cost-calculator.tsx
new file mode 100644
index 000000000..97ef817a2
--- /dev/null
+++ b/web/app/routes/tools.ad-cost-calculator.tsx
@@ -0,0 +1,416 @@
+import { CaretDownIcon, CurrencyDollarIcon } from '@phosphor-icons/react'
+import { useState, useEffect } from 'react'
+import type { MetaFunction } from 'react-router'
+import { redirect } from 'react-router'
+import type { SitemapFunction } from 'remix-sitemap'
+
+import { DitchGoogle } from '~/components/marketing/DitchGoogle'
+import { ToolsNav, ToolsNavMobile } from '~/components/ToolsNav'
+import { isSelfhosted } from '~/lib/constants'
+import Input from '~/ui/Input'
+import { Text } from '~/ui/Text'
+import Tooltip from '~/ui/Tooltip'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
+
+export const meta: MetaFunction = () => {
+ return [
+ ...getTitle('Free Ad Cost Calculator (CPM, CPC, CPA) - Swetrix'),
+ ...getDescription(
+ 'Calculate CPM (Cost Per Mille), CPC (Cost Per Click), and CPA (Cost Per Action) instantly. Analyze your ad campaign costs and performance.',
+ ),
+ ...getPreviewImage(),
+ ]
+}
+
+export const sitemap: SitemapFunction = () => ({
+ priority: 0.8,
+ exclude: isSelfhosted,
+})
+
+export async function loader() {
+ if (isSelfhosted) {
+ return redirect('/login', 302)
+ }
+
+ return null
+}
+
+interface Metrics {
+ spend: number
+ impressions: number
+ clicks: number
+ conversions: number
+}
+
+const FAQ_ITEMS = [
+ {
+ question: 'What is CPM (Cost Per Mille)?',
+ answer:
+ 'CPM stands for Cost Per Mille (Mille means thousand in Latin). It is the cost an advertiser pays for one thousand views or impressions of an advertisement.',
+ },
+ {
+ question: 'What is CPC (Cost Per Click)?',
+ answer:
+ 'CPC is the actual price you pay for each click in your pay-per-click (PPC) marketing campaigns. A lower CPC means you are getting more clicks for your budget.',
+ },
+ {
+ question: 'What is CPA (Cost Per Action)?',
+ answer:
+ 'CPA, or Cost Per Acquisition/Action, measures the aggregate cost to acquire one paying customer or a specific action (like a sign-up) on a campaign or channel level.',
+ },
+ {
+ question: 'What is CTR (Click-Through Rate)?',
+ answer:
+ 'CTR is the ratio of users who click on a specific link to the number of total users who view a page, email, or advertisement. It is commonly used to measure the success of an online advertising campaign.',
+ },
+ {
+ question: 'How do I lower my Ad Costs?',
+ answer:
+ 'To lower CPC and CPA, focus on improving your ad relevance, targeting the right audience, testing different ad creatives (A/B testing), and optimizing your landing pages to improve conversion rates.',
+ },
+]
+
+const formatCurrency = (value: number): string => {
+ if (!isFinite(value) || isNaN(value)) return '$0.00'
+ return new Intl.NumberFormat('en-US', {
+ style: 'currency',
+ currency: 'USD',
+ minimumFractionDigits: 2,
+ maximumFractionDigits: 2,
+ }).format(value)
+}
+
+const formatPercentage = (value: number): string => {
+ if (!isFinite(value) || isNaN(value)) return '0.00%'
+ return `${value.toFixed(2)}%`
+}
+
+export default function AdCostCalculator() {
+ const [metrics, setMetrics] = useState<Metrics>({
+ spend: 1000,
+ impressions: 50000,
+ clicks: 1250,
+ conversions: 50,
+ })
+
+ const [cpm, setCpm] = useState(0)
+ const [cpc, setCpc] = useState(0)
+ const [cpa, setCpa] = useState(0)
+ const [ctr, setCtr] = useState(0)
+ const [cvr, setCvr] = useState(0)
+
+ useEffect(() => {
+ const { spend, impressions, clicks, conversions } = metrics
+
+ setCpm(impressions > 0 ? (spend / impressions) * 1000 : 0)
+ setCpc(clicks > 0 ? spend / clicks : 0)
+ setCpa(conversions > 0 ? spend / conversions : 0)
+ setCtr(impressions > 0 ? (clicks / impressions) * 100 : 0)
+ setCvr(clicks > 0 ? (conversions / clicks) * 100 : 0)
+ }, [metrics])
+
+ const handleMetricChange = (key: keyof Metrics, value: string) => {
+ setMetrics({ ...metrics, [key]: parseFloat(value) || 0 })
+ }
+
+ return (
+ <div className='min-h-screen bg-gray-50 dark:bg-slate-950'>
+ <main className='mx-auto max-w-7xl px-4 py-12 sm:px-6 lg:px-8'>
+ <ToolsNavMobile className='mb-6 xl:hidden' />
+
+ <div className='xl:flex xl:items-start xl:gap-8'>
+ <div className='min-w-0 xl:flex-1'>
+ <Text as='h1' size='4xl' weight='bold' tracking='tight'>
+ Ad Cost Calculator
+ </Text>
+ <Text as='p' size='lg' colour='muted' className='mt-4'>
+ Calculate key advertising metrics like CPM, CPC, CPA, and
+ understand your campaign performance.
+ </Text>
+
+ <div className='mt-12 grid gap-8 lg:grid-cols-3'>
+ {/* Input Section */}
+ <div className='lg:col-span-2'>
+ <div className='rounded-xl bg-white p-8 ring-1 ring-gray-200 dark:bg-slate-800 dark:ring-slate-700'>
+ <h2 className='mb-6 text-2xl font-semibold text-gray-900 dark:text-white'>
+ Campaign Data
+ </h2>
+
+ <div className='grid gap-6 md:grid-cols-2'>
+ <Input
+ type='number'
+ label={
+ <>
+ Total Ad Spend ($)
+ <Tooltip
+ className='ml-1'
+ text='Total amount of money spent on the ad campaign'
+ />
+ </>
+ }
+ value={metrics.spend || ''}
+ onChange={(e) =>
+ handleMetricChange('spend', e.target.value)
+ }
+ className='w-full'
+ />
+
+ <Input
+ type='number'
+ label={
+ <>
+ Total Impressions
+ <Tooltip
+ className='ml-1'
+ text='Number of times your ads were shown'
+ />
+ </>
+ }
+ value={metrics.impressions || ''}
+ onChange={(e) =>
+ handleMetricChange('impressions', e.target.value)
+ }
+ className='w-full'
+ />
+
+ <Input
+ type='number'
+ label={
+ <>
+ Total Clicks
+ <Tooltip
+ className='ml-1'
+ text='Number of times people clicked on your ads'
+ />
+ </>
+ }
+ value={metrics.clicks || ''}
+ onChange={(e) =>
+ handleMetricChange('clicks', e.target.value)
+ }
+ className='w-full'
+ />
+
+ <Input
+ type='number'
+ label={
+ <>
+ Total Conversions
+ <Tooltip
+ className='ml-1'
+ text='Number of desired actions completed (sales, leads, etc.)'
+ />
+ </>
+ }
+ value={metrics.conversions || ''}
+ onChange={(e) =>
+ handleMetricChange('conversions', e.target.value)
+ }
+ className='w-full'
+ />
+ </div>
+ </div>
+ </div>
+
+ {/* Results Section */}
+ <div className='lg:col-span-1'>
+ <div className='sticky top-8 space-y-6'>
+ <div className='rounded-xl bg-white p-6 ring-1 ring-gray-200 dark:bg-slate-800 dark:ring-slate-700'>
+ <h3 className='mb-4 text-lg font-semibold text-gray-900 dark:text-white'>
+ Cost Analysis
+ </h3>
+
+ <div className='space-y-4'>
+ <div className='flex items-center justify-between rounded-lg bg-gray-50 p-4 dark:bg-slate-700/50'>
+ <div className='flex items-center'>
+ <CurrencyDollarIcon className='mr-2 h-5 w-5 text-gray-500 dark:text-gray-400' />
+ <span className='font-medium text-gray-700 dark:text-gray-300'>
+ CPM
+ </span>
+ </div>
+ <span className='text-xl font-bold text-gray-900 dark:text-white'>
+ {formatCurrency(cpm)}
+ </span>
+ </div>
+
+ <div className='flex items-center justify-between rounded-lg bg-gray-50 p-4 dark:bg-slate-700/50'>
+ <div className='flex items-center'>
+ <CurrencyDollarIcon className='mr-2 h-5 w-5 text-gray-500 dark:text-gray-400' />
+ <span className='font-medium text-gray-700 dark:text-gray-300'>
+ CPC
+ </span>
+ </div>
+ <span className='text-xl font-bold text-gray-900 dark:text-white'>
+ {formatCurrency(cpc)}
+ </span>
+ </div>
+
+ <div className='flex items-center justify-between rounded-lg bg-gray-50 p-4 dark:bg-slate-700/50'>
+ <div className='flex items-center'>
+ <CurrencyDollarIcon className='mr-2 h-5 w-5 text-gray-500 dark:text-gray-400' />
+ <span className='font-medium text-gray-700 dark:text-gray-300'>
+ CPA
+ </span>
+ </div>
+ <span className='text-xl font-bold text-gray-900 dark:text-white'>
+ {formatCurrency(cpa)}
+ </span>
+ </div>
+ </div>
+
+ <div className='mt-6 border-t border-gray-100 pt-6 dark:border-gray-700'>
+ <h4 className='mb-4 text-sm font-medium text-gray-500 dark:text-gray-400'>
+ Performance Rates
+ </h4>
+ <div className='space-y-3'>
+ <div className='flex items-center justify-between'>
+ <span className='text-sm text-gray-600 dark:text-gray-300'>
+ Click-Through Rate (CTR)
+ </span>
+ <span className='font-semibold text-gray-900 dark:text-white'>
+ {formatPercentage(ctr)}
+ </span>
+ </div>
+ <div className='flex items-center justify-between'>
+ <span className='text-sm text-gray-600 dark:text-gray-300'>
+ Conversion Rate (CVR)
+ </span>
+ <span className='font-semibold text-gray-900 dark:text-white'>
+ {formatPercentage(cvr)}
+ </span>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ {/* FAQ Section */}
+ <section className='mt-20 border-t border-gray-200 pt-16 dark:border-slate-700'>
+ <Text as='h2' size='3xl' weight='bold' tracking='tight'>
+ Free Ad Cost Calculator (CPM, CPC, CPA)
+ </Text>
+ <Text
+ as='p'
+ size='lg'
+ colour='muted'
+ className='mt-4 leading-relaxed'
+ >
+ Take control of your advertising budget with our comprehensive
+ ad cost calculator. Instantly convert between different pricing
+ models like CPM (Cost Per Mille), CPC (Cost Per Click), and CPA
+ (Cost Per Action) to better understand your campaign performance
+ across different platforms.
+ </Text>
+
+ <div className='mt-12 grid gap-x-12 gap-y-10 md:grid-cols-2'>
+ <div>
+ <Text as='h3' size='xl' weight='semibold'>
+ Understanding Ad Pricing Models
+ </Text>
+ <ul className='mt-3 space-y-2'>
+ <li>
+ <Text colour='muted'>
+ <Text as='span' weight='semibold' colour='inherit'>
+ CPM (Cost Per Mille)
+ </Text>{' '}
+ - Best for brand awareness campaigns. You pay for every
+ 1,000 times your ad is shown, regardless of clicks.
+ </Text>
+ </li>
+ <li>
+ <Text colour='muted'>
+ <Text as='span' weight='semibold' colour='inherit'>
+ CPC (Cost Per Click)
+ </Text>{' '}
+ - Best for driving traffic. You only pay when a user
+ actually clicks on your ad.
+ </Text>
+ </li>
+ <li>
+ <Text colour='muted'>
+ <Text as='span' weight='semibold' colour='inherit'>
+ CPA (Cost Per Action)
+ </Text>{' '}
+ - Best for direct response. You pay only when a user
+ completes a specific action, like a purchase or sign-up.
+ </Text>
+ </li>
+ </ul>
+ </div>
+ <div>
+ <Text as='h3' size='xl' weight='semibold'>
+ How to Optimize Your Ad Spend
+ </Text>
+ <Text as='p' colour='muted' className='mt-3'>
+ To lower your overall advertising costs, focus on improving
+ your Click-Through Rate (CTR) by using highly relevant ad
+ copy and targeted audience segments. Additionally, optimize
+ your landing pages to boost your Conversion Rate (CVR).
+ Small improvements in these intermediate metrics can
+ drastically lower your final Cost Per Action (CPA).
+ </Text>
+ </div>
+ </div>
+ </section>
+
+ <div className='mt-16'>
+ <h2 className='mb-8 text-center text-3xl font-bold text-gray-900 dark:text-white'>
+ Frequently Asked Questions
+ </h2>
+
+ <div className='space-y-4'>
+ {FAQ_ITEMS.map((item, index) => (
+ <details
+ key={index}
+ className='group rounded-lg border border-gray-200 bg-white dark:border-gray-700 dark:bg-slate-800'
+ >
+ <summary className='flex w-full cursor-pointer items-center justify-between px-6 py-4 text-left hover:bg-gray-50 dark:hover:bg-slate-700/50'>
+ <h3 className='text-lg font-medium text-gray-900 dark:text-white'>
+ {item.question}
+ </h3>
+ <CaretDownIcon className='h-5 w-5 text-gray-500 transition-transform group-open:rotate-180' />
+ </summary>
+ <div className='border-t border-gray-200 px-6 py-4 dark:border-gray-700'>
+ <p className='text-gray-600 dark:text-gray-400'>
+ {item.answer}
+ </p>
+ </div>
+ </details>
+ ))}
+ </div>
+ </div>
+
+ {/* FAQ Structured Data */}
+ <script
+ type='application/ld+json'
+ dangerouslySetInnerHTML={{
+ __html: JSON.stringify({
+ '@context': 'https://schema.org',
+ '@type': 'FAQPage',
+ mainEntity: FAQ_ITEMS.map((item) => ({
+ '@type': 'Question',
+ name: item.question,
+ acceptedAnswer: {
+ '@type': 'Answer',
+ text: item.answer,
+ },
+ })),
+ })
+ .replace(/</g, '\\u003c')
+ .replace(/\u2028|\u2029/g, ''),
+ }}
+ />
+
+ <DitchGoogle />
+ </div>
+
+ <aside className='hidden xl:sticky xl:top-12 xl:block xl:w-64 xl:shrink-0 xl:self-start'>
+ <ToolsNav />
+ </aside>
+ </div>
+ </main>
+ </div>
+ )
+}
diff --git a/web/app/routes/tools.ctr-calculator.tsx b/web/app/routes/tools.ctr-calculator.tsx
index 709261224..0e7a92e0e 100644
--- a/web/app/routes/tools.ctr-calculator.tsx
+++ b/web/app/routes/tools.ctr-calculator.tsx
@@ -277,6 +277,96 @@ export default function CTRCalculator() {
</div>
</div>
+ <section className='mt-20 border-t border-gray-200 pt-16 dark:border-slate-700'>
+ <Text as='h2' size='3xl' weight='bold' tracking='tight'>
+ Free Click-Through Rate (CTR) Calculator
+ </Text>
+ <Text
+ as='p'
+ size='lg'
+ colour='muted'
+ className='mt-4 leading-relaxed'
+ >
+ Use our free CTR calculator to instantly evaluate the
+ performance of your search ads, display banners, or email
+ campaigns. Click-through rate is a foundational metric that
+ reveals how relevant and engaging your content is to your target
+ audience.
+ </Text>
+
+ <div className='mt-12 grid gap-x-12 gap-y-10 md:grid-cols-2'>
+ <div>
+ <Text as='h3' size='xl' weight='semibold'>
+ Why Does CTR Matter?
+ </Text>
+ <ul className='mt-3 space-y-2'>
+ <li>
+ <Text colour='muted'>
+ <Text as='span' weight='semibold' colour='inherit'>
+ Quality Score Impact
+ </Text>{' '}
+ - Higher CTRs typically lead to better Quality Scores on
+ platforms like Google Ads, which lowers your cost per
+ click (CPC).
+ </Text>
+ </li>
+ <li>
+ <Text colour='muted'>
+ <Text as='span' weight='semibold' colour='inherit'>
+ Relevance Indicator
+ </Text>{' '}
+ - A low CTR is a strong signal that your messaging,
+ targeting, or creative needs adjustment.
+ </Text>
+ </li>
+ <li>
+ <Text colour='muted'>
+ <Text as='span' weight='semibold' colour='inherit'>
+ Engagement Metric
+ </Text>{' '}
+ - For organic content and email marketing, CTR is the
+ best way to measure audience engagement.
+ </Text>
+ </li>
+ </ul>
+ </div>
+ <div>
+ <Text as='h3' size='xl' weight='semibold'>
+ Tips for Improving CTR
+ </Text>
+ <ul className='mt-3 space-y-2'>
+ <li>
+ <Text colour='muted'>
+ <Text as='span' weight='semibold' colour='inherit'>
+ Write compelling copy
+ </Text>{' '}
+ - Use action-oriented language and highlight clear
+ benefits or offers.
+ </Text>
+ </li>
+ <li>
+ <Text colour='muted'>
+ <Text as='span' weight='semibold' colour='inherit'>
+ Refine your audience
+ </Text>{' '}
+ - Ensure your ads are only shown to highly relevant
+ users.
+ </Text>
+ </li>
+ <li>
+ <Text colour='muted'>
+ <Text as='span' weight='semibold' colour='inherit'>
+ Test different creatives
+ </Text>{' '}
+ - Run A/B tests on headlines, images, and
+ calls-to-action (CTAs).
+ </Text>
+ </li>
+ </ul>
+ </div>
+ </div>
+ </section>
+
<div className='mt-16'>
<h2 className='mb-8 text-center text-3xl font-bold text-gray-900 dark:text-white'>
Frequently Asked Questions
diff --git a/web/app/routes/tools.ltv-calculator.tsx b/web/app/routes/tools.ltv-calculator.tsx
new file mode 100644
index 000000000..38717807d
--- /dev/null
+++ b/web/app/routes/tools.ltv-calculator.tsx
@@ -0,0 +1,420 @@
+import { CaretDownIcon, ChartLineUpIcon } from '@phosphor-icons/react'
+import { useState, useEffect } from 'react'
+import type { MetaFunction } from 'react-router'
+import { redirect } from 'react-router'
+import type { SitemapFunction } from 'remix-sitemap'
+
+import { DitchGoogle } from '~/components/marketing/DitchGoogle'
+import { ToolsNav, ToolsNavMobile } from '~/components/ToolsNav'
+import { isSelfhosted } from '~/lib/constants'
+import Input from '~/ui/Input'
+import { Text } from '~/ui/Text'
+import Tooltip from '~/ui/Tooltip'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
+
+export const meta: MetaFunction = () => {
+ return [
+ ...getTitle('Free LTV Calculator - Customer Lifetime Value'),
+ ...getDescription(
+ 'Calculate Customer Lifetime Value (LTV) and LTV:CAC ratio. Optimize your marketing spend and understand the long-term value of your customers.',
+ ),
+ ...getPreviewImage(),
+ ]
+}
+
+export const sitemap: SitemapFunction = () => ({
+ priority: 0.8,
+ exclude: isSelfhosted,
+})
+
+export async function loader() {
+ if (isSelfhosted) {
+ return redirect('/login', 302)
+ }
+
+ return null
+}
+
+interface Metrics {
+ aov: number
+ frequency: number
+ lifespan: number
+ margin: number
+ cac: number
+}
+
+const FAQ_ITEMS = [
+ {
+ question: 'What is Customer Lifetime Value (LTV)?',
+ answer:
+ 'Customer Lifetime Value (LTV or CLV) is the total revenue a business can reasonably expect from a single customer account throughout the business relationship.',
+ },
+ {
+ question: 'How do you calculate LTV?',
+ answer:
+ 'A common way to calculate LTV is: Average Order Value × Purchase Frequency × Customer Lifespan. To get the profit LTV, multiply this by your Gross Margin.',
+ },
+ {
+ question: 'What is a good LTV:CAC ratio?',
+ answer:
+ 'A benchmark LTV:CAC ratio for successful SaaS and e-commerce businesses is 3:1 or higher. This means you make $3 for every $1 spent acquiring a customer. A ratio of 1:1 means you are losing money or breaking even, while a ratio of 5:1+ means you might be under-investing in marketing.',
+ },
+ {
+ question: 'Why is LTV important?',
+ answer:
+ 'LTV helps you make important business decisions about sales, marketing, product development, and customer support. It tells you how much you can afford to spend to acquire a new customer (CAC).',
+ },
+ {
+ question: 'How can I improve my LTV?',
+ answer:
+ 'You can improve LTV by increasing the average order value (upselling/cross-selling), increasing purchase frequency (loyalty programs, email marketing), or extending the customer lifespan (improving customer service, reducing churn).',
+ },
+]
+
+const formatCurrency = (value: number): string => {
+ return new Intl.NumberFormat('en-US', {
+ style: 'currency',
+ currency: 'USD',
+ minimumFractionDigits: 0,
+ maximumFractionDigits: 2,
+ }).format(value)
+}
+
+export default function LTVCalculator() {
+ const [metrics, setMetrics] = useState<Metrics>({
+ aov: 100,
+ frequency: 4,
+ lifespan: 3,
+ margin: 60,
+ cac: 150,
+ })
+
+ const [ltv, setLtv] = useState(0)
+ const [profitLtv, setProfitLtv] = useState(0)
+ const [ltvCacRatio, setLtvCacRatio] = useState(0)
+
+ useEffect(() => {
+ calculateLTV()
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [metrics])
+
+ const calculateLTV = () => {
+ const { aov, frequency, lifespan, margin, cac } = metrics
+ const calculatedLtv = aov * frequency * lifespan
+ const calculatedProfitLtv = calculatedLtv * (margin / 100)
+
+ setLtv(calculatedLtv)
+ setProfitLtv(calculatedProfitLtv)
+
+ if (cac > 0) {
+ setLtvCacRatio(calculatedProfitLtv / cac)
+ } else {
+ setLtvCacRatio(0)
+ }
+ }
+
+ const handleMetricChange = (key: keyof Metrics, value: string) => {
+ setMetrics({ ...metrics, [key]: parseFloat(value) || 0 })
+ }
+
+ const getRatioColor = (ratio: number) => {
+ if (ratio >= 3) return 'text-green-600 dark:text-green-400'
+ if (ratio >= 1) return 'text-yellow-600 dark:text-yellow-400'
+ return 'text-red-600 dark:text-red-400'
+ }
+
+ return (
+ <div className='min-h-screen bg-gray-50 dark:bg-slate-950'>
+ <main className='mx-auto max-w-7xl px-4 py-12 sm:px-6 lg:px-8'>
+ <ToolsNavMobile className='mb-6 xl:hidden' />
+
+ <div className='xl:flex xl:items-start xl:gap-8'>
+ <div className='min-w-0 xl:flex-1'>
+ <Text as='h1' size='4xl' weight='bold' tracking='tight'>
+ Customer Lifetime Value Calculator
+ </Text>
+ <Text as='p' size='lg' colour='muted' className='mt-4'>
+ Calculate how much a customer is worth to your business over their
+ lifetime and optimize your acquisition costs.
+ </Text>
+
+ <div className='mt-12 grid gap-8 lg:grid-cols-3'>
+ {/* Input Section */}
+ <div className='lg:col-span-2'>
+ <div className='rounded-xl bg-white p-8 ring-1 ring-gray-200 dark:bg-slate-800 dark:ring-slate-700'>
+ <h2 className='mb-6 text-2xl font-semibold text-gray-900 dark:text-white'>
+ Business Metrics
+ </h2>
+
+ <div className='grid gap-6 md:grid-cols-2'>
+ <Input
+ type='number'
+ label={
+ <>
+ Average Order Value ($)
+ <Tooltip
+ className='ml-1'
+ text='The average amount spent each time a customer places an order'
+ />
+ </>
+ }
+ value={metrics.aov || ''}
+ onChange={(e) =>
+ handleMetricChange('aov', e.target.value)
+ }
+ className='w-full'
+ />
+
+ <Input
+ type='number'
+ label={
+ <>
+ Purchase Frequency (per year)
+ <Tooltip
+ className='ml-1'
+ text='Average number of purchases a customer makes in a year'
+ />
+ </>
+ }
+ value={metrics.frequency || ''}
+ onChange={(e) =>
+ handleMetricChange('frequency', e.target.value)
+ }
+ className='w-full'
+ />
+
+ <Input
+ type='number'
+ label={
+ <>
+ Customer Lifespan (years)
+ <Tooltip
+ className='ml-1'
+ text='Average number of years a customer continues purchasing from you'
+ />
+ </>
+ }
+ value={metrics.lifespan || ''}
+ onChange={(e) =>
+ handleMetricChange('lifespan', e.target.value)
+ }
+ className='w-full'
+ />
+
+ <Input
+ type='number'
+ label={
+ <>
+ Gross Margin (%)
+ <Tooltip
+ className='ml-1'
+ text='Your average profit margin percentage per order'
+ />
+ </>
+ }
+ value={metrics.margin || ''}
+ onChange={(e) =>
+ handleMetricChange('margin', e.target.value)
+ }
+ className='w-full'
+ />
+
+ <div className='md:col-span-2'>
+ <Input
+ type='number'
+ label={
+ <>
+ Customer Acquisition Cost (CAC) ($)
+ <Tooltip
+ className='ml-1'
+ text='Total marketing and sales cost to acquire one new customer'
+ />
+ </>
+ }
+ value={metrics.cac || ''}
+ onChange={(e) =>
+ handleMetricChange('cac', e.target.value)
+ }
+ className='w-full'
+ />
+ </div>
+ </div>
+ </div>
+ </div>
+
+ {/* Results Section */}
+ <div className='lg:col-span-1'>
+ <div className='sticky top-8 space-y-6'>
+ <div className='rounded-xl bg-white p-6 ring-1 ring-gray-200 dark:bg-slate-800 dark:ring-slate-700'>
+ <h3 className='mb-4 text-lg font-semibold text-gray-900 dark:text-white'>
+ LTV Results
+ </h3>
+
+ <div className='space-y-6'>
+ <div>
+ <p className='mb-1 text-sm text-gray-600 dark:text-gray-400'>
+ Profit LTV
+ </p>
+ <p className='flex items-center gap-2 text-3xl font-bold text-gray-900 dark:text-white'>
+ <ChartLineUpIcon className='h-6 w-6 text-indigo-500' />
+ {formatCurrency(profitLtv)}
+ </p>
+ <p className='mt-1 text-xs text-gray-500'>
+ Revenue LTV: {formatCurrency(ltv)}
+ </p>
+ </div>
+
+ <div className='border-t border-gray-100 pt-4 dark:border-gray-700'>
+ <p className='mb-1 text-sm text-gray-600 dark:text-gray-400'>
+ LTV:CAC Ratio
+ </p>
+ <p
+ className={`text-2xl font-bold ${getRatioColor(
+ ltvCacRatio,
+ )}`}
+ >
+ {ltvCacRatio.toFixed(2)}:1
+ </p>
+ <p className='mt-1 text-xs text-gray-500'>
+ {ltvCacRatio >= 3
+ ? 'Excellent ratio! Healthy growth potential.'
+ : ltvCacRatio >= 1
+ ? 'Needs improvement. Low profitability.'
+ : 'Unsustainable. You lose money on each customer.'}
+ </p>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ {/* FAQ Section */}
+ <section className='mt-20 border-t border-gray-200 pt-16 dark:border-slate-700'>
+ <Text as='h2' size='3xl' weight='bold' tracking='tight'>
+ Free Customer Lifetime Value (LTV) Calculator
+ </Text>
+ <Text
+ as='p'
+ size='lg'
+ colour='muted'
+ className='mt-4 leading-relaxed'
+ >
+ Understanding your Customer Lifetime Value (CLV/LTV) is crucial
+ for sustainable business growth. This calculator helps you
+ determine how much revenue and profit a typical customer
+ generates over their entire relationship with your brand,
+ enabling you to make smarter decisions about marketing spend.
+ </Text>
+
+ <div className='mt-12 grid gap-x-12 gap-y-10 md:grid-cols-2'>
+ <div>
+ <Text as='h3' size='xl' weight='semibold'>
+ Why Calculate LTV?
+ </Text>
+ <ul className='mt-3 space-y-2'>
+ <li>
+ <Text colour='muted'>
+ <Text as='span' weight='semibold' colour='inherit'>
+ Optimize Acquisition
+ </Text>{' '}
+ - Knowing your LTV tells you exactly how much you can
+ afford to spend to acquire a new customer (CAC).
+ </Text>
+ </li>
+ <li>
+ <Text colour='muted'>
+ <Text as='span' weight='semibold' colour='inherit'>
+ Focus on Retention
+ </Text>{' '}
+ - It highlights the financial impact of keeping
+ customers longer versus constantly finding new ones.
+ </Text>
+ </li>
+ <li>
+ <Text colour='muted'>
+ <Text as='span' weight='semibold' colour='inherit'>
+ Predictive Revenue
+ </Text>{' '}
+ - Helps forecast long-term cash flow based on current
+ customer acquisition rates.
+ </Text>
+ </li>
+ </ul>
+ </div>
+ <div>
+ <Text as='h3' size='xl' weight='semibold'>
+ The LTV:CAC Ratio
+ </Text>
+ <Text as='p' colour='muted' className='mt-3'>
+ The LTV to CAC ratio is one of the most important metrics
+ for SaaS and e-commerce companies. It compares the lifetime
+ value of a customer to the cost of acquiring them. A
+ benchmark ratio of 3:1 means you make $3 in gross profit for
+ every $1 spent on marketing and sales. A ratio lower than
+ 3:1 indicates poor profitability, while a ratio of 5:1 or
+ higher might mean you are under-investing in growth.
+ </Text>
+ </div>
+ </div>
+ </section>
+
+ <div className='mt-16'>
+ <h2 className='mb-8 text-center text-3xl font-bold text-gray-900 dark:text-white'>
+ Frequently Asked Questions
+ </h2>
+
+ <div className='space-y-4'>
+ {FAQ_ITEMS.map((item, index) => (
+ <details
+ key={index}
+ className='group rounded-lg border border-gray-200 bg-white dark:border-gray-700 dark:bg-slate-800'
+ >
+ <summary className='flex w-full cursor-pointer items-center justify-between px-6 py-4 text-left hover:bg-gray-50 dark:hover:bg-slate-700/50'>
+ <h3 className='text-lg font-medium text-gray-900 dark:text-white'>
+ {item.question}
+ </h3>
+ <CaretDownIcon className='h-5 w-5 text-gray-500 transition-transform group-open:rotate-180' />
+ </summary>
+ <div className='border-t border-gray-200 px-6 py-4 dark:border-gray-700'>
+ <p className='text-gray-600 dark:text-gray-400'>
+ {item.answer}
+ </p>
+ </div>
+ </details>
+ ))}
+ </div>
+ </div>
+
+ {/* FAQ Structured Data */}
+ <script
+ type='application/ld+json'
+ dangerouslySetInnerHTML={{
+ __html: JSON.stringify({
+ '@context': 'https://schema.org',
+ '@type': 'FAQPage',
+ mainEntity: FAQ_ITEMS.map((item) => ({
+ '@type': 'Question',
+ name: item.question,
+ acceptedAnswer: {
+ '@type': 'Answer',
+ text: item.answer,
+ },
+ })),
+ })
+ .replace(/</g, '\\u003c')
+ .replace(/\u2028|\u2029/g, ''),
+ }}
+ />
+
+ <DitchGoogle />
+ </div>
+
+ <aside className='hidden xl:sticky xl:top-12 xl:block xl:w-64 xl:shrink-0 xl:self-start'>
+ <ToolsNav />
+ </aside>
+ </div>
+ </main>
+ </div>
+ )
+}
diff --git a/web/app/routes/tools.meta-tags-generator.tsx b/web/app/routes/tools.meta-tags-generator.tsx
new file mode 100644
index 000000000..8c39573aa
--- /dev/null
+++ b/web/app/routes/tools.meta-tags-generator.tsx
@@ -0,0 +1,438 @@
+import { CaretDownIcon, CodeIcon } from '@phosphor-icons/react'
+import { useState } from 'react'
+import type { MetaFunction } from 'react-router'
+import { redirect } from 'react-router'
+import type { SitemapFunction } from 'remix-sitemap'
+
+import { DitchGoogle } from '~/components/marketing/DitchGoogle'
+import { ToolsNav, ToolsNavMobile } from '~/components/ToolsNav'
+import { isSelfhosted } from '~/lib/constants'
+import Button from '~/ui/Button'
+import Input from '~/ui/Input'
+import Textarea from '~/ui/Textarea'
+import CodeBlock from '~/ui/CodeBlock'
+import { Text } from '~/ui/Text'
+import Tooltip from '~/ui/Tooltip'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
+
+export const meta: MetaFunction = () => {
+ return [
+ ...getTitle('Free Meta Tags & Open Graph Generator - Swetrix'),
+ ...getDescription(
+ 'Generate perfect HTML meta tags, Open Graph for Facebook/LinkedIn, and Twitter Cards to make your links look great when shared on social media.',
+ ),
+ ...getPreviewImage(),
+ ]
+}
+
+export const sitemap: SitemapFunction = () => ({
+ priority: 0.8,
+ exclude: isSelfhosted,
+})
+
+export async function loader() {
+ if (isSelfhosted) {
+ return redirect('/login', 302)
+ }
+
+ return null
+}
+
+const FAQ_ITEMS = [
+ {
+ question: 'What are Meta Tags?',
+ answer:
+ "Meta tags are snippets of text that describe a page's content. They don't appear on the page itself, but only in the page's source code. They help tell search engines what a web page is about.",
+ },
+ {
+ question: 'What is Open Graph?',
+ answer:
+ 'The Open Graph protocol enables any web page to become a rich object in a social graph. It was created by Facebook and is now used by LinkedIn, Slack, Discord, and others to display link previews with images, titles, and descriptions.',
+ },
+ {
+ question: 'What are Twitter Cards?',
+ answer:
+ 'Twitter Cards make it possible to attach media experiences to Tweets that link to your content. Simply add a few lines of HTML to your webpage, and users who Tweet links to your content will have a "Card" added to the Tweet that\'s visible to all of their followers.',
+ },
+ {
+ question: 'Where do I put these generated tags?',
+ answer:
+ "You should place the generated HTML code inside the <head> section of your webpage's HTML document. If you use a CMS like WordPress, Webflow, or Shopify, there are usually plugins or settings sections dedicated to SEO where you can input these details without touching the code.",
+ },
+]
+
+interface MetaData {
+ title: string
+ description: string
+ url: string
+ imageUrl: string
+ siteName: string
+ twitterHandle: string
+}
+
+export default function MetaTagsGenerator() {
+ const [data, setData] = useState<MetaData>({
+ title: 'Swetrix - Privacy-focused web analytics',
+ description:
+ 'Cookie-less, open source, and privacy-focused web analytics alternative to Google Analytics.',
+ url: 'https://swetrix.com',
+ imageUrl: 'https://swetrix.com/assets/seo/banner.png',
+ siteName: 'Swetrix',
+ twitterHandle: '@Swetrix',
+ })
+
+ const handleDataChange = (key: keyof MetaData, value: string) => {
+ setData((prev) => ({ ...prev, [key]: value }))
+ }
+
+ const generateHTML = () => {
+ const { title, description, url, imageUrl, siteName, twitterHandle } = data
+ return `<!-- Primary Meta Tags -->
+<title>${title}</title>
+<meta name="title" content="${title}" />
+<meta name="description" content="${description}" />
+
+<!-- Open Graph / Facebook -->
+<meta property="og:type" content="website" />
+<meta property="og:url" content="${url}" />
+<meta property="og:title" content="${title}" />
+<meta property="og:description" content="${description}" />
+${imageUrl ? `<meta property="og:image" content="${imageUrl}" />\n` : ''}${siteName ? `<meta property="og:site_name" content="${siteName}" />\n` : ''}
+<!-- Twitter -->
+<meta property="twitter:card" content="summary_large_image" />
+<meta property="twitter:url" content="${url}" />
+<meta property="twitter:title" content="${title}" />
+<meta property="twitter:description" content="${description}" />
+${imageUrl ? `<meta property="twitter:image" content="${imageUrl}" />\n` : ''}${twitterHandle ? `<meta name="twitter:site" content="${twitterHandle.startsWith('@') ? twitterHandle : `@${twitterHandle}`}" />` : ''}`
+ }
+
+ return (
+ <div className='min-h-screen bg-gray-50 dark:bg-slate-950'>
+ <main className='mx-auto max-w-7xl px-4 py-12 sm:px-6 lg:px-8'>
+ <ToolsNavMobile className='mb-6 xl:hidden' />
+
+ <div className='xl:flex xl:items-start xl:gap-8'>
+ <div className='min-w-0 xl:flex-1'>
+ <Text as='h1' size='4xl' weight='bold' tracking='tight'>
+ Meta Tags & Open Graph Generator
+ </Text>
+ <Text as='p' size='lg' colour='muted' className='mt-4'>
+ Create perfect SEO and social media meta tags for your website.
+ </Text>
+
+ <div className='mt-12 grid gap-8 lg:grid-cols-2'>
+ {/* Input Section */}
+ <div className='rounded-xl bg-white p-6 ring-1 ring-gray-200 dark:bg-slate-800 dark:ring-slate-700'>
+ <h2 className='mb-6 text-xl font-semibold text-gray-900 dark:text-white'>
+ Page Information
+ </h2>
+ <div className='space-y-4'>
+ <Input
+ type='text'
+ label='Page Title'
+ placeholder='My Awesome Website'
+ value={data.title}
+ onChange={(e) => handleDataChange('title', e.target.value)}
+ className='w-full'
+ maxLength={60}
+ />
+ <div className='mt-[-10px] flex justify-end'>
+ <span
+ className={`text-xs ${data.title.length > 60 ? 'text-red-500' : 'text-gray-500'}`}
+ >
+ {data.title.length}/60 recommended
+ </span>
+ </div>
+
+ <div>
+ <Textarea
+ label='Page Description'
+ placeholder='This is the best website ever created.'
+ value={data.description}
+ onChange={(e) =>
+ handleDataChange('description', e.target.value)
+ }
+ rows={3}
+ />
+ <div className='mt-1 flex justify-end'>
+ <span
+ className={`text-xs ${data.description.length > 160 ? 'text-red-500' : 'text-gray-500'}`}
+ >
+ {data.description.length}/160 recommended
+ </span>
+ </div>
+ </div>
+
+ <Input
+ type='text'
+ label='Page URL'
+ placeholder='https://example.com'
+ value={data.url}
+ onChange={(e) => handleDataChange('url', e.target.value)}
+ className='w-full'
+ />
+
+ <Input
+ type='text'
+ label={
+ <>
+ Image URL
+ <Tooltip
+ className='ml-1'
+ text='Absolute URL for the preview image (1200x630px recommended)'
+ />
+ </>
+ }
+ placeholder='https://example.com/image.jpg'
+ value={data.imageUrl}
+ onChange={(e) =>
+ handleDataChange('imageUrl', e.target.value)
+ }
+ className='w-full'
+ />
+
+ <div className='grid grid-cols-2 gap-4'>
+ <Input
+ type='text'
+ label='Site Name'
+ placeholder='MySite'
+ value={data.siteName}
+ onChange={(e) =>
+ handleDataChange('siteName', e.target.value)
+ }
+ className='w-full'
+ />
+ <Input
+ type='text'
+ label='Twitter Handle'
+ placeholder='@username'
+ value={data.twitterHandle}
+ onChange={(e) =>
+ handleDataChange('twitterHandle', e.target.value)
+ }
+ className='w-full'
+ />
+ </div>
+ </div>
+ </div>
+
+ {/* Code Output Section */}
+ <div className='flex h-[600px] flex-col rounded-xl bg-slate-900 p-6 ring-1 ring-slate-800'>
+ <div className='mb-4 flex items-center justify-between'>
+ <div className='flex items-center gap-2'>
+ <CodeIcon className='h-5 w-5 text-gray-400' />
+ <h3 className='text-lg font-medium text-white'>
+ Generated HTML
+ </h3>
+ </div>
+ </div>
+
+ <div className='flex-1 overflow-auto rounded-lg'>
+ <CodeBlock code={generateHTML()} />
+ </div>
+ </div>
+ </div>
+
+ {/* Social Preview section (Simplified) */}
+ <div className='mt-8 rounded-xl bg-white p-6 ring-1 ring-gray-200 dark:bg-slate-800 dark:ring-slate-700'>
+ <h2 className='mb-6 text-xl font-semibold text-gray-900 dark:text-white'>
+ Social Preview Example (Twitter/X)
+ </h2>
+ <div className='mx-auto max-w-md overflow-hidden rounded-xl border border-gray-200 bg-white dark:border-gray-700 dark:bg-slate-900'>
+ {data.imageUrl ? (
+ <div className='aspect-[1.91/1] w-full overflow-hidden bg-gray-100 dark:bg-slate-800'>
+ <img
+ src={data.imageUrl}
+ alt='Preview'
+ className='h-full w-full object-cover'
+ onError={(e) => {
+ ;(e.target as HTMLImageElement).style.display = 'none'
+ ;(
+ e.target as HTMLImageElement
+ ).parentElement!.classList.add(
+ 'flex',
+ 'items-center',
+ 'justify-center',
+ )
+ ;(
+ e.target as HTMLImageElement
+ ).parentElement!.innerHTML =
+ '<span class="text-gray-400">Invalid Image URL</span>'
+ }}
+ />
+ </div>
+ ) : (
+ <div className='flex aspect-[1.91/1] w-full items-center justify-center bg-gray-100 dark:bg-slate-800'>
+ <span className='text-gray-400'>No image provided</span>
+ </div>
+ )}
+ <div className='border-t border-gray-200 p-3 dark:border-gray-700'>
+ <p className='truncate text-sm text-gray-500 dark:text-gray-400'>
+ {data.url
+ ? new URL(
+ data.url.startsWith('http')
+ ? data.url
+ : `https://${data.url}`,
+ ).hostname
+ : 'example.com'}
+ </p>
+ <p className='mt-0.5 truncate font-semibold text-gray-900 dark:text-white'>
+ {data.title || 'Page Title'}
+ </p>
+ <p className='mt-1 line-clamp-2 text-sm text-gray-500 dark:text-gray-400'>
+ {data.description || 'Page description goes here...'}
+ </p>
+ </div>
+ </div>
+ </div>
+
+ {/* FAQ Section */}
+ <section className='mt-20 border-t border-gray-200 pt-16 dark:border-slate-700'>
+ <Text as='h2' size='3xl' weight='bold' tracking='tight'>
+ Free Meta Tags & Open Graph Generator
+ </Text>
+ <Text
+ as='p'
+ size='lg'
+ colour='muted'
+ className='mt-4 leading-relaxed'
+ >
+ Ensure your website looks professional when shared on social
+ media and ranks well in search engines. Our free generator
+ creates perfectly formatted HTML code for standard SEO meta
+ tags, Facebook Open Graph protocol, and Twitter Cards.
+ </Text>
+
+ <div className='mt-12 grid gap-x-12 gap-y-10 md:grid-cols-2'>
+ <div>
+ <Text as='h3' size='xl' weight='semibold'>
+ Why Meta Tags are Important
+ </Text>
+ <ul className='mt-3 space-y-2'>
+ <li>
+ <Text colour='muted'>
+ <Text as='span' weight='semibold' colour='inherit'>
+ Search Engine Optimization
+ </Text>{' '}
+ - Title and description tags directly impact your
+ click-through rate from Google search results.
+ </Text>
+ </li>
+ <li>
+ <Text colour='muted'>
+ <Text as='span' weight='semibold' colour='inherit'>
+ Social Sharing
+ </Text>{' '}
+ - Open Graph and Twitter Card tags control the image,
+ title, and description shown when someone links your
+ site on social platforms.
+ </Text>
+ </li>
+ <li>
+ <Text colour='muted'>
+ <Text as='span' weight='semibold' colour='inherit'>
+ Brand Consistency
+ </Text>{' '}
+ - Custom meta tags guarantee that your brand's messaging
+ is presented exactly how you want it, everywhere.
+ </Text>
+ </li>
+ </ul>
+ </div>
+ <div>
+ <Text as='h3' size='xl' weight='semibold'>
+ Tips for Great Meta Tags
+ </Text>
+ <ul className='mt-3 space-y-2'>
+ <li>
+ <Text colour='muted'>
+ <Text as='span' weight='semibold' colour='inherit'>
+ Character Limits
+ </Text>{' '}
+ - Keep titles under 60 characters and descriptions under
+ 160 characters to avoid truncation in search results.
+ </Text>
+ </li>
+ <li>
+ <Text colour='muted'>
+ <Text as='span' weight='semibold' colour='inherit'>
+ Image Sizing
+ </Text>{' '}
+ - Use high-quality images with an aspect ratio of 1.91:1
+ (recommended size: 1200x630 pixels) for the best social
+ previews.
+ </Text>
+ </li>
+ <li>
+ <Text colour='muted'>
+ <Text as='span' weight='semibold' colour='inherit'>
+ Compelling Copy
+ </Text>{' '}
+ - Write descriptions that act as a call-to-action,
+ encouraging users to click through to your site.
+ </Text>
+ </li>
+ </ul>
+ </div>
+ </div>
+ </section>
+
+ <div className='mt-16'>
+ <h2 className='mb-8 text-center text-3xl font-bold text-gray-900 dark:text-white'>
+ Frequently Asked Questions
+ </h2>
+
+ <div className='space-y-4'>
+ {FAQ_ITEMS.map((item, index) => (
+ <details
+ key={index}
+ className='group rounded-lg border border-gray-200 bg-white dark:border-gray-700 dark:bg-slate-800'
+ >
+ <summary className='flex w-full cursor-pointer items-center justify-between px-6 py-4 text-left hover:bg-gray-50 dark:hover:bg-slate-700/50'>
+ <h3 className='text-lg font-medium text-gray-900 dark:text-white'>
+ {item.question}
+ </h3>
+ <CaretDownIcon className='h-5 w-5 text-gray-500 transition-transform group-open:rotate-180' />
+ </summary>
+ <div className='border-t border-gray-200 px-6 py-4 dark:border-gray-700'>
+ <p className='text-gray-600 dark:text-gray-400'>
+ {item.answer}
+ </p>
+ </div>
+ </details>
+ ))}
+ </div>
+ </div>
+
+ {/* FAQ Structured Data */}
+ <script
+ type='application/ld+json'
+ dangerouslySetInnerHTML={{
+ __html: JSON.stringify({
+ '@context': 'https://schema.org',
+ '@type': 'FAQPage',
+ mainEntity: FAQ_ITEMS.map((item) => ({
+ '@type': 'Question',
+ name: item.question,
+ acceptedAnswer: {
+ '@type': 'Answer',
+ text: item.answer,
+ },
+ })),
+ })
+ .replace(/</g, '\\u003c')
+ .replace(/\u2028|\u2029/g, ''),
+ }}
+ />
+
+ <DitchGoogle />
+ </div>
+
+ <aside className='hidden xl:sticky xl:top-12 xl:block xl:w-64 xl:shrink-0 xl:self-start'>
+ <ToolsNav />
+ </aside>
+ </div>
+ </main>
+ </div>
+ )
+}
diff --git a/web/app/routes/tools.qr-code-generator.tsx b/web/app/routes/tools.qr-code-generator.tsx
new file mode 100644
index 000000000..841867e78
--- /dev/null
+++ b/web/app/routes/tools.qr-code-generator.tsx
@@ -0,0 +1,361 @@
+import { CaretDownIcon, DownloadIcon } from '@phosphor-icons/react'
+import { useState } from 'react'
+import QRCode from 'react-qr-code'
+import type { MetaFunction } from 'react-router'
+import { redirect } from 'react-router'
+import type { SitemapFunction } from 'remix-sitemap'
+import { ClientOnly } from 'remix-utils/client-only'
+
+import { DitchGoogle } from '~/components/marketing/DitchGoogle'
+import { ToolsNav, ToolsNavMobile } from '~/components/ToolsNav'
+import { isSelfhosted } from '~/lib/constants'
+import Button from '~/ui/Button'
+import Input from '~/ui/Input'
+import Textarea from '~/ui/Textarea'
+import { Text } from '~/ui/Text'
+import Tooltip from '~/ui/Tooltip'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
+
+export const meta: MetaFunction = () => {
+ return [
+ ...getTitle('Free QR Code Generator - Swetrix'),
+ ...getDescription(
+ 'Create high-quality, customizable QR codes instantly. Perfect for links, marketing materials, and offline-to-online campaigns.',
+ ),
+ ...getPreviewImage(),
+ ]
+}
+
+export const sitemap: SitemapFunction = () => ({
+ priority: 0.8,
+ exclude: isSelfhosted,
+})
+
+export async function loader() {
+ if (isSelfhosted) {
+ return redirect('/login', 302)
+ }
+
+ return null
+}
+
+const FAQ_ITEMS = [
+ {
+ question: 'Do these QR codes expire?',
+ answer:
+ 'No! The QR codes generated here are static, meaning they embed the destination URL directly into the code itself. They will work forever as long as your destination URL remains active.',
+ },
+ {
+ question: 'How do I track how many people scan my QR code?',
+ answer:
+ 'To track scans, generate a link using our UTM Generator first, then paste that trackable link into this QR Code Generator. When people scan the code, your analytics tool (like Swetrix) will track the traffic as a campaign.',
+ },
+ {
+ question: 'What is the best size for a QR code?',
+ answer:
+ 'For print materials like business cards, a QR code should be at least 2x2 cm (0.8x0.8 inches). For posters or billboards, it needs to be much larger depending on the scanning distance.',
+ },
+ {
+ question: 'Can I change the colors of my QR code?',
+ answer:
+ 'Yes, you can customize the foreground and background colors. However, make sure to maintain high contrast between the code (darker) and the background (lighter) so smartphone cameras can read it easily.',
+ },
+]
+
+export default function QRCodeGenerator() {
+ const [value, setValue] = useState('https://swetrix.com')
+ const [fgColor, setFgColor] = useState('#000000')
+ const [bgColor, setBgColor] = useState('#ffffff')
+
+ const downloadSVG = () => {
+ const svgElement = document.getElementById('qr-code-svg')
+ if (!svgElement) return
+
+ const svgData = new XMLSerializer().serializeToString(svgElement)
+ const blob = new Blob([svgData], { type: 'image/svg+xml;charset=utf-8' })
+ const url = URL.createObjectURL(blob)
+
+ const link = document.createElement('a')
+ link.href = url
+ link.download = 'swetrix-qrcode.svg'
+ document.body.appendChild(link)
+ link.click()
+ document.body.removeChild(link)
+ URL.revokeObjectURL(url)
+ }
+
+ return (
+ <div className='min-h-screen bg-gray-50 dark:bg-slate-950'>
+ <main className='mx-auto max-w-7xl px-4 py-12 sm:px-6 lg:px-8'>
+ <ToolsNavMobile className='mb-6 lg:hidden' />
+
+ <div className='lg:flex lg:items-start lg:gap-8'>
+ <div className='min-w-0 lg:flex-1'>
+ <Text as='h1' size='4xl' weight='bold' tracking='tight'>
+ QR Code Generator
+ </Text>
+ <Text as='p' size='lg' colour='muted' className='mt-4'>
+ Instantly create beautiful, high-resolution QR codes for your
+ links and marketing materials.
+ </Text>
+
+ <div className='mt-12 grid gap-8 lg:grid-cols-2'>
+ {/* Input Section */}
+ <div className='rounded-xl bg-white p-8 ring-1 ring-gray-200 dark:bg-slate-800 dark:ring-slate-700'>
+ <h2 className='mb-6 text-xl font-semibold text-gray-900 dark:text-white'>
+ Configuration
+ </h2>
+
+ <div className='space-y-6'>
+ <div>
+ <Textarea
+ label='Website URL or Text'
+ placeholder='https://example.com'
+ value={value}
+ onChange={(e) => setValue(e.target.value)}
+ rows={3}
+ />
+ </div>
+
+ <div className='grid grid-cols-2 gap-4'>
+ <div>
+ <Input
+ type='color'
+ label={
+ <>
+ Code Color
+ <Tooltip
+ className='ml-1'
+ text='The color of the QR code pattern'
+ />
+ </>
+ }
+ value={fgColor}
+ onChange={(e) => setFgColor(e.target.value)}
+ className='h-10 w-full cursor-pointer p-1'
+ />
+ </div>
+ <div>
+ <Input
+ type='color'
+ label={
+ <>
+ Background
+ <Tooltip
+ className='ml-1'
+ text='The background color behind the QR code'
+ />
+ </>
+ }
+ value={bgColor}
+ onChange={(e) => setBgColor(e.target.value)}
+ className='h-10 w-full cursor-pointer p-1'
+ />
+ </div>
+ </div>
+
+ <div className='rounded-md bg-blue-50 p-4 dark:bg-blue-900/20'>
+ <p className='text-sm text-blue-800 dark:text-blue-300'>
+ <strong>Pro tip:</strong> Pair this with our UTM Generator
+ tool to track how many people scan your QR codes in your
+ analytics dashboard!
+ </p>
+ </div>
+ </div>
+ </div>
+
+ {/* Preview & Download Section */}
+ <div className='flex flex-col items-center rounded-xl bg-white p-8 ring-1 ring-gray-200 dark:bg-slate-800 dark:ring-slate-700'>
+ <h3 className='mb-6 text-xl font-semibold text-gray-900 dark:text-white'>
+ Preview
+ </h3>
+
+ <div className='flex flex-col items-center justify-center space-y-8'>
+ <div className='rounded-xl bg-gray-50 p-6 ring-1 ring-gray-200 dark:bg-slate-900 dark:ring-slate-700'>
+ <div
+ className='bg-white p-4 shadow-sm'
+ style={{ backgroundColor: bgColor }}
+ >
+ <ClientOnly
+ fallback={<div style={{ width: 256, height: 256 }} />}
+ >
+ {() => (
+ <QRCode
+ id='qr-code-svg'
+ value={value || 'https://swetrix.com'}
+ size={256}
+ fgColor={fgColor}
+ bgColor={bgColor}
+ level='H'
+ />
+ )}
+ </ClientOnly>
+ </div>
+ </div>
+
+ <Button
+ onClick={downloadSVG}
+ primary
+ regular
+ disabled={!value}
+ className='w-full max-w-xs'
+ >
+ <DownloadIcon className='mr-2 h-5 w-5' />
+ Download SVG
+ </Button>
+ </div>
+ </div>
+ </div>
+
+ {/* FAQ Section */}
+ <section className='mt-20 border-t border-gray-200 pt-16 dark:border-slate-700'>
+ <Text as='h2' size='3xl' weight='bold' tracking='tight'>
+ Free Online QR Code Generator
+ </Text>
+ <Text
+ as='p'
+ size='lg'
+ colour='muted'
+ className='mt-4 leading-relaxed'
+ >
+ Bridge the gap between your physical marketing materials and
+ your digital presence. Our free QR code generator lets you
+ instantly create high-quality, static QR codes that never
+ expire. Perfect for business cards, flyers, restaurant menus,
+ and event banners.
+ </Text>
+
+ <div className='mt-12 grid gap-x-12 gap-y-10 md:grid-cols-2'>
+ <div>
+ <Text as='h3' size='xl' weight='semibold'>
+ Creative Ways to Use QR Codes
+ </Text>
+ <ul className='mt-3 space-y-2'>
+ <li>
+ <Text colour='muted'>
+ <Text as='span' weight='semibold' colour='inherit'>
+ Contactless Menus & Catalogs
+ </Text>{' '}
+ - Allow customers to scan a code on their table to view
+ your offerings instantly on their phone.
+ </Text>
+ </li>
+ <li>
+ <Text colour='muted'>
+ <Text as='span' weight='semibold' colour='inherit'>
+ App Downloads
+ </Text>{' '}
+ - Direct users straight to the App Store or Google Play
+ store to download your application.
+ </Text>
+ </li>
+ <li>
+ <Text colour='muted'>
+ <Text as='span' weight='semibold' colour='inherit'>
+ Event Registration
+ </Text>{' '}
+ - Add a code to physical invitations that links directly
+ to an RSVP or ticketing page.
+ </Text>
+ </li>
+ </ul>
+ </div>
+ <div>
+ <Text as='h3' size='xl' weight='semibold'>
+ Best Practices for QR Codes
+ </Text>
+ <ul className='mt-3 space-y-2'>
+ <li>
+ <Text colour='muted'>
+ <Text as='span' weight='semibold' colour='inherit'>
+ Maintain High Contrast
+ </Text>{' '}
+ - Always ensure the QR code is significantly darker than
+ the background color so smartphone cameras can easily
+ read it.
+ </Text>
+ </li>
+ <li>
+ <Text colour='muted'>
+ <Text as='span' weight='semibold' colour='inherit'>
+ Size Matters
+ </Text>{' '}
+ - Make sure the printed code is large enough to scan. A
+ general rule of thumb is a minimum size of 2x2 cm
+ (0.8x0.8 inches).
+ </Text>
+ </li>
+ <li>
+ <Text colour='muted'>
+ <Text as='span' weight='semibold' colour='inherit'>
+ Track Your Scans
+ </Text>{' '}
+ - Add UTM parameters to your destination URL before
+ generating the code so you can track scans in your
+ analytics platform.
+ </Text>
+ </li>
+ </ul>
+ </div>
+ </div>
+ </section>
+
+ <div className='mt-16'>
+ <h2 className='mb-8 text-center text-3xl font-bold text-gray-900 dark:text-white'>
+ Frequently Asked Questions
+ </h2>
+
+ <div className='space-y-4'>
+ {FAQ_ITEMS.map((item, index) => (
+ <details
+ key={index}
+ className='group rounded-lg border border-gray-200 bg-white dark:border-gray-700 dark:bg-slate-800'
+ >
+ <summary className='flex w-full cursor-pointer items-center justify-between px-6 py-4 text-left hover:bg-gray-50 dark:hover:bg-slate-700/50'>
+ <h3 className='text-lg font-medium text-gray-900 dark:text-white'>
+ {item.question}
+ </h3>
+ <CaretDownIcon className='h-5 w-5 text-gray-500 transition-transform group-open:rotate-180' />
+ </summary>
+ <div className='border-t border-gray-200 px-6 py-4 dark:border-gray-700'>
+ <p className='text-gray-600 dark:text-gray-400'>
+ {item.answer}
+ </p>
+ </div>
+ </details>
+ ))}
+ </div>
+ </div>
+
+ {/* FAQ Structured Data */}
+ <script
+ type='application/ld+json'
+ dangerouslySetInnerHTML={{
+ __html: JSON.stringify({
+ '@context': 'https://schema.org',
+ '@type': 'FAQPage',
+ mainEntity: FAQ_ITEMS.map((item) => ({
+ '@type': 'Question',
+ name: item.question,
+ acceptedAnswer: {
+ '@type': 'Answer',
+ text: item.answer,
+ },
+ })),
+ })
+ .replace(/</g, '\\u003c')
+ .replace(/\u2028|\u2029/g, ''),
+ }}
+ />
+
+ <DitchGoogle />
+ </div>
+
+ <aside className='hidden lg:sticky lg:top-12 lg:block lg:w-64 lg:shrink-0 lg:self-start'>
+ <ToolsNav />
+ </aside>
+ </div>
+ </main>
+ </div>
+ )
+}
diff --git a/web/app/routes/tools.roi-calculator.tsx b/web/app/routes/tools.roi-calculator.tsx
index 2721999d0..e26888f43 100644
--- a/web/app/routes/tools.roi-calculator.tsx
+++ b/web/app/routes/tools.roi-calculator.tsx
@@ -531,6 +531,74 @@ export default function ROICalculator() {
</div>
{/* FAQ Section */}
+ <section className='mt-20 border-t border-gray-200 pt-16 dark:border-slate-700'>
+ <Text as='h2' size='3xl' weight='bold' tracking='tight'>
+ Free Marketing ROI & ROAS Calculator
+ </Text>
+ <Text
+ as='p'
+ size='lg'
+ colour='muted'
+ className='mt-4 leading-relaxed'
+ >
+ Our comprehensive Marketing ROI Calculator helps you measure the
+ true profitability of your advertising campaigns. Quickly
+ compute Return on Ad Spend (ROAS), Customer Acquisition Cost
+ (CAC), and other vital metrics to optimize your marketing budget
+ and improve profitability.
+ </Text>
+
+ <div className='mt-12 grid gap-x-12 gap-y-10 md:grid-cols-2'>
+ <div>
+ <Text as='h3' size='xl' weight='semibold'>
+ Key Marketing Metrics Explained
+ </Text>
+ <ul className='mt-3 space-y-2'>
+ <li>
+ <Text colour='muted'>
+ <Text as='span' weight='semibold' colour='inherit'>
+ ROI (Return on Investment)
+ </Text>{' '}
+ - Measures the overall profitability of your campaign,
+ accounting for costs.
+ </Text>
+ </li>
+ <li>
+ <Text colour='muted'>
+ <Text as='span' weight='semibold' colour='inherit'>
+ ROAS (Return on Ad Spend)
+ </Text>{' '}
+ - Indicates how much revenue is generated for every
+ dollar spent on ads.
+ </Text>
+ </li>
+ <li>
+ <Text colour='muted'>
+ <Text as='span' weight='semibold' colour='inherit'>
+ CAC (Customer Acquisition Cost)
+ </Text>{' '}
+ - The average amount you spend to acquire a single
+ paying customer.
+ </Text>
+ </li>
+ </ul>
+ </div>
+ <div>
+ <Text as='h3' size='xl' weight='semibold'>
+ How to Use This Tool
+ </Text>
+ <Text as='p' colour='muted' className='mt-3'>
+ Simply enter your campaign's total ad spend, revenue
+ generated, and other available metrics like clicks or
+ impressions. The calculator will instantly generate a
+ detailed performance report, showing your exact profit
+ margins, conversion rates, and whether your campaign has
+ reached its break-even point.
+ </Text>
+ </div>
+ </div>
+ </section>
+
<div className='mt-16'>
<h2 className='mb-8 text-center text-3xl font-bold text-gray-900 dark:text-white'>
Frequently Asked Questions
diff --git a/web/app/routes/tools.utm-generator.tsx b/web/app/routes/tools.utm-generator.tsx
index 408c164e3..31a0f01c1 100644
--- a/web/app/routes/tools.utm-generator.tsx
+++ b/web/app/routes/tools.utm-generator.tsx
@@ -390,6 +390,95 @@ export default function UTMGenerator() {
</div>
</div>
+ <section className='mt-20 border-t border-gray-200 pt-16 dark:border-slate-700'>
+ <Text as='h2' size='3xl' weight='bold' tracking='tight'>
+ Free UTM Link Generator
+ </Text>
+ <Text
+ as='p'
+ size='lg'
+ colour='muted'
+ className='mt-4 leading-relaxed'
+ >
+ Our free UTM Generator tool makes it easy to build trackable
+ URLs for your marketing campaigns. By adding UTM parameters to
+ your links, you can accurately track where your traffic comes
+ from, which campaigns are driving conversions, and what content
+ resonates best with your audience.
+ </Text>
+
+ <div className='mt-12 grid gap-x-12 gap-y-10 md:grid-cols-2'>
+ <div>
+ <Text as='h3' size='xl' weight='semibold'>
+ Why Use UTM Parameters?
+ </Text>
+ <ul className='mt-3 space-y-2'>
+ <li>
+ <Text colour='muted'>
+ <Text as='span' weight='semibold' colour='inherit'>
+ Accurate Attribution
+ </Text>{' '}
+ - Know exactly which marketing efforts are driving
+ traffic and sales.
+ </Text>
+ </li>
+ <li>
+ <Text colour='muted'>
+ <Text as='span' weight='semibold' colour='inherit'>
+ Campaign Comparison
+ </Text>{' '}
+ - Easily compare performance across different channels
+ (e.g., Email vs. Social).
+ </Text>
+ </li>
+ <li>
+ <Text colour='muted'>
+ <Text as='span' weight='semibold' colour='inherit'>
+ A/B Testing
+ </Text>{' '}
+ - Use utm_content to test different link placements
+ within the same ad or email.
+ </Text>
+ </li>
+ </ul>
+ </div>
+ <div>
+ <Text as='h3' size='xl' weight='semibold'>
+ Best Practices
+ </Text>
+ <ul className='mt-3 space-y-2'>
+ <li>
+ <Text colour='muted'>
+ <Text as='span' weight='semibold' colour='inherit'>
+ Be Consistent
+ </Text>{' '}
+ - Use a standardized naming convention (e.g., always use
+ lowercase, use underscores instead of spaces).
+ </Text>
+ </li>
+ <li>
+ <Text colour='muted'>
+ <Text as='span' weight='semibold' colour='inherit'>
+ Keep it Simple
+ </Text>{' '}
+ - Use clear, descriptive names for your campaigns so
+ they are easy to understand in your analytics dashboard.
+ </Text>
+ </li>
+ <li>
+ <Text colour='muted'>
+ <Text as='span' weight='semibold' colour='inherit'>
+ Use a URL Shortener
+ </Text>{' '}
+ - UTM links can get long; consider shortening them
+ before sharing on social media.
+ </Text>
+ </li>
+ </ul>
+ </div>
+ </div>
+ </section>
+
<div className='mt-16'>
<h2 className='mb-8 text-center text-3xl font-bold text-gray-900 dark:text-white'>
Frequently Asked Questions
diff --git a/web/app/utils/routes.ts b/web/app/utils/routes.ts
index 9a111d1d6..fb2e37d08 100644
--- a/web/app/utils/routes.ts
+++ b/web/app/utils/routes.ts
@@ -45,6 +45,11 @@ const routes = Object.freeze({
ctr_calculator: '/tools/ctr-calculator',
ip_lookup: '/tools/ip-lookup',
sitemap_validator: '/tools/sitemap-validator',
+ ab_test_calculator: '/tools/ab-test-calculator',
+ ltv_calculator: '/tools/ltv-calculator',
+ meta_tags_generator: '/tools/meta-tags-generator',
+ ad_cost_calculator: '/tools/ad-cost-calculator',
+ qr_code_generator: '/tools/qr-code-generator',
// Marketing pages
gaAlternative: '/google-analytics-alternative',