How to create a multivariate feature flag in PostHog
Create a multivariate feature flag in PostHog: set a unique flag key, choose the Multivariate type, name two variants at 50/50, and save the flag.

Quick answer
To create a multivariate feature flag in PostHog, open a new feature flag, enter a unique flag key, choose the Multivariate flag type, rename the second variant, and click Save. The default variants split rollout 50/50, so the flag is ready to serve two experiences to your users.
Steps at a glance
- Open a new feature flag and enter a flag key.
- Choose the Multivariate flag type.
- Expand the second variant.
- Rename it in the Variant key field.
- Click Save to create the flag.
Interactive demo
Summary
A multivariate feature flag serves one of several named variants instead of a simple on or off. PostHog splits users across the variants by rollout percentage, which lets you compare two versions of an experience.
Step-by-step guide
Step 1
Name the flag
On the new feature flag form, click the Flag key field and type a unique key. Use something descriptive, such as onboarding-checklist-style. The key is what your code checks to decide which variant to show.
Step 2
Choose Multivariate
Under Flag type, select Multivariate. The option is described as multiple variants with rollout percentages. PostHog then adds a Variants section with two starting variants.
Step 3
Open the second variant
In the Variants list, you see control (50%) and a second variant that is also at 50%. Click the second row to expand it and show its settings.
Step 4
Name the second variant
Click the Variant key field, replace the default text, and type compact. The first variant stays as control, and both keep a Rollout percentage of 50, so users split evenly.
Step 5
Save the flag
Click Save at the top right. The second row now reads compact, and your multivariate flag is created and ready to use in your code.
Why this matters
You want to test two versions of your onboarding checklist, a control and a compact layout. A multivariate flag splits users evenly between them, so you can ship both behind one key and see which one performs better.
Frequently asked questions
How are users split between variants by default?
The two starting variants each have a rollout percentage of 50, so users are split evenly between them.
Can I add more than two variants?
The Variants section includes an Add variant button, so you can add more variants beyond the two defaults.
Related guides
Continue with more step-by-step guides for getting work done.
How to create a feature flag in PostHogCreate a boolean feature flag in PostHog: set a key and description, release it to 100% of users, and save it so your app can toggle the feature.
How to roll out a feature flag to a percentage of users in PostHogLearn how to roll out a PostHog feature flag to a percentage of users: open the flag, click Edit, pick a rollout percentage, and save the change.
How to target a feature flag to a cohort in PostHogLearn how to target a PostHog feature flag to a cohort: open the flag, edit its release condition, add a cohort filter, and save the change.
How to create a retention insight in PostHogCreate a retention insight in PostHog: pick signed_up as the start event, task_created as the return event, set the last 14 days, then save it.
How to create a stickiness insight in PostHogBuild a stickiness insight in PostHog to see how many days users repeat an event. Pick task_created, set Last 14 days, name it, and save.
How to create a survey in PostHogCreate a survey in PostHog from the Open feedback template: name it, write one freeform text question, and save it as a draft before you launch it.
Create interactive demos like this one — free, no coding required.
Start for free →