How to create a feature flag in PostHog
Create 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.

Quick answer
Open Feature flags, choose Create your first feature flag, then pick Start from scratch. Enter a unique key and a description, set the Rollout percentage to 100%, and click Save. The flag is Boolean by default, so it returns true for every user in the All Users condition set.
Steps at a glance
- Open Feature flags and click Create your first feature flag.
- Choose Start from scratch.
- Enter the flag key.
- Add a description.
- Set the rollout percentage to 100%.
- Click Save.
Interactive demo
Summary
A feature flag lets you ship code behind a switch and decide who sees it. PostHog flags are Boolean by default, and you control who gets the feature with a rollout percentage in the release conditions.
Step-by-step guide
Step 1
Create your first feature flag
Open Feature flags from the sidebar. On the empty page, click Create your first feature flag to start a new flag.
Step 2
Start from scratch
Under Create a feature flag, click Start from scratch to use the default settings and customize everything yourself.
Step 3
Enter the flag key
Click the Flag key field and type a unique key, such as new-board-layout. Your code uses this key to check the flag.
Step 4
Add a description
Click the Description field and describe the flag for your team, for example New board layout for Acme Tasks. The Boolean flag type is already selected.
Step 5
Release to 100% of users
In the release conditions, find Rollout percentage for the All Users condition set. Click 100% to release the flag to everyone.
Step 6
Save the flag
Click Save at the top of the page. The condition set now shows 100% and the flag is created.
Why this matters
You are about to ship a new board layout but want to turn it on without a redeploy. Creating the flag now gives your team one switch to release the feature to everyone, or pull it back if something goes wrong.
Frequently asked questions
What type of flag does this create?
A Boolean flag, which is the default type. It is a release toggle that returns true or false based on the release conditions.
Can I release to fewer users first?
Yes. The Rollout percentage offers 0%, 10%, 25%, 50%, 75% and 100%, so you can pick a lower value instead of 100%.
Related guides
Continue with more step-by-step guides for getting work done.
How to add an insight to a dashboard in PostHogAdd a saved PostHog insight to a dashboard in a few clicks: open it from All insights, choose Add to dashboard, and pin it to your overview.
How to create a cohort in PostHogCreate a dynamic cohort in PostHog that groups people by a person property such as plan, so you can reuse the group across insights and analysis.
How to create a dashboard in PostHogCreate a blank PostHog dashboard from scratch, give it a name, and find it in your dashboards list so you can start adding charts and insights.
How to create a funnel in PostHogBuild a PostHog funnel from signed_up to task_created to task_completed, set the last 14 days, and save it to see where users drop off between steps.
How to create a lifecycle insight in PostHogLearn how to build a lifecycle insight in PostHog that splits users into new, returning, resurrecting, and dormant, then save it for your team.
How to create a multivariate feature flag in PostHogCreate 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.
Create interactive demos like this one — free, no coding required.
Start for free →