Free A/B Split Testing Script Generator
Split landing page traffic between two URLs for A/B testing without plugins or paid tools. Copy and paste the generated JavaScript snippet.
What Is an A/B Split Test?
An A/B split test sends a percentage of your visitors to a "Control" page (Version A) and the remaining percentage to a "Variant" page (Version B). By measuring which page generates more conversions - signups, purchases, clicks - you get data-driven evidence of which design or copy approach works better. It eliminates guesswork and replaces it with real performance data.
How This Tool Generates the Split
This tool generates a lightweight client-side JavaScript snippet using Math.random(). When a visitor lands on the entry page (where you paste the snippet), the script instantly generates a number between 0 - 100 and routes them to Version A or Version B based on the split percentage you defined. The redirect happens before any visual content loads - the experience is seamless.
This approach is zero-cost, zero-infrastructure, and requires no third-party split testing subscription. Pair it with UTM parameters on each variant URL to measure results in Google Analytics.
How to Run Your A/B Test
- Create two versions of your landing page - Version A (your current "control") and Version B (your variant with one change).
- Enter both URLs and set your split percentage. A 50/50 split is standard for most tests.
- Add UTM parameters to each URL (e.g.
?utm_content=version-aand?utm_content=version-b) so Google Analytics can track which version converts. - Copy the generated snippet and paste it into the
<head>of your entry page. - Drive traffic to the entry page (paid ads, email, social), and monitor conversions by the UTM content tag in Google Analytics or your preferred analytics tool.
What Should You Test?
- Headlines: The most impactful element on any landing page. Small headline wording changes regularly produce 20-50% conversion uplifts.
- CTA Button Copy: "Get Started" vs. "Start Free Trial" vs. "Claim Your Spot" - each creates a different intent signal.
- Hero Image or Video: Test whether a product image or an explainer video performs better above the fold.
- Pricing Display: Monthly vs. annual pricing, showing vs. hiding the price comparison.
- Social Proof Placement: Test testimonials above the fold vs. below the CTA.
Frequently Asked Questions
How long should I run an A/B test?
Run your test until you reach statistical significance - typically at least 100 conversions per variant. For low-traffic pages, this may take several weeks. Ending a test too early (peeking) inflates false positive rates. Use a significance calculator once you have sufficient data.
Should I change multiple elements at once?
No. Only change one element per test. Changing the headline, CTA, and hero image simultaneously makes it impossible to know which change drove the result. For testing multiple elements simultaneously, use a multivariate test instead.
Is this a 50/50 split only?
No. You can set any percentage split. However, 50/50 is recommended for most A/B tests as it reaches statistical significance fastest with equal exposure. Use an unequal split (e.g. 80/20) if you want a "safer" test where most traffic still goes to the known control.
Get smarter about link tracking
UTM strategies, campaign tricks, and new tools for marketers who want cleaner data.
Related Tools
Explore other free tools to build, test, and optimize your links and QR codes.
Amazon Affiliate Link Builder
Clean up messy Amazon URLs and generate perfect Associate links using your affiliate tag.
Link Expirator & Countdown Snippet
Generate a Javascript snippet to automatically expire a link and redirect traffic after a specific date and time.
Link Cloaker & Redirect
Generate HTML, PHP, and .htaccess redirect codes to hide ugly affiliate links.
Link Rotator
Generate a JavaScript snippet to randomly rotate traffic across multiple destination URLs based on percentage weights.
SMS Link Generator
Create clickable sms: links that open the native text message app with a phone number and pre-filled message. Generates the URL and HTML code.
Mailto Link
Create advanced email links with pre-filled subjects, CC, BCC, and body text. Generates standard URLs and HTML code.