one-line definition
A feature flag is a configuration toggle that lets you enable or disable functionality for specific users or groups without redeploying your application.
formula: No formula. A boolean or percentage-based toggle that controls whether a feature is visible to users without deploying new code.
tl;dr
Feature flags decouple deployment from release. Ship code to production behind a flag, test with 5% of users, then roll out to everyone once you're confident. For solo builders, even a simple database boolean per feature works.
Simple definition
A feature flag is a conditional switch in your code that controls whether a feature is active. Instead of deploying new code to release a feature, you flip a toggle. This lets you ship incomplete work safely, test features with a subset of users, and instantly roll back if something breaks. For solo founders, feature flags reduce the risk of every deploy — you can push code to production daily without worrying that half-finished work reaches users.
How to calculate it
There is no formula. Implementation is straightforward: wrap new functionality in a conditional check.
Method: Store a boolean or percentage-based toggle (in a database, config file, or feature flag service) that controls whether a feature is visible to users without deploying new code.
At its simplest: if (flags.newEditor) { showNewEditor() } else { showOldEditor() }. The flag value comes from your database, a config file, or a service. To do a percentage rollout, generate a consistent hash from the user ID and enable the feature for the target percentage.
Example
You're rebuilding the dashboard of your analytics tool. The new version is faster but you're not sure the charts render correctly for all data shapes. You ship the new dashboard behind a feature flag called new_dashboard_v2, enabled for 10% of users. Over a week, you monitor error rates and support tickets. No issues — you bump to 50%. A user reports a rendering bug with large datasets. You fix it, then roll out to 100%. Without the flag, you would have shipped the bug to everyone and scrambled to deploy a hotfix. With it, only 50% of users were affected and you had time to fix it calmly.
Related reading
Related terms
- A/B Testing
- Feature Adoption
- Activation Rate
FAQ
Do I need a paid feature flag service?+
Not at first. A JSON config file, a database column, or even environment variables work fine for solo builders. Services like LaunchDarkly or Flagsmith add value when you need targeting rules, audit logs, or team coordination.
How do I avoid feature flag debt?+
Set an expiration date when you create each flag. After a feature is fully rolled out or killed, remove the flag and its conditional code. Stale flags create confusing code paths and bugs.