Feature Flag Rule Builder
Design targeting rules and percentage rollouts, simulate user bucketing, and export provider JSON.
Flag design
2 variations · 1 rulesSimulator & exports
5 sample users · neutral| User | Country | Bucket | Rule | Variation |
|---|---|---|---|---|
| user-1 | NO | 46 | 0 | control |
| user-2 | US | 83 | — | control |
| user-3 | SE | 46 | 0 | control |
| user-4 | DK | 24 | 0 | control |
| user-5 | GB | 56 | — | control |
Examples
Nordic 20% rollout
country in [NO, SE, DK] → 20% treatmentMatched users bucket 0–19 get treatment; 20–99 get controlThe clause gates who is eligible; the deterministic bucket decides the split within that group.
A/B/C weights
A 50 · B 25 · C 25Buckets [0,50) → A, [50,75) → B, [75,100) → CContiguous normalised ranges guarantee every bucket maps to exactly one variation.
Unleash strategy
rollout: 20, stickiness: userId, groupId: new-checkoutgradualRolloutUserId strategy plus constraintsThe same model compiles to each provider's vocabulary without changing the design.
About this tool
The Feature Flag Rule Builder designs targeting rules offline: variations and weights, ordered attribute clauses, a percentage rollout with a salt and assignment attribute, and per-environment fallback overrides. A simulator evaluates sample users so you can see the exact bucket and served variation before wiring up an SDK.
Bucketing uses murmur3 x86 32-bit over salt + '.' + attribute value, reduced mod 100. The same user gets the same bucket on every run, and changing the salt (or the key, when the salt is empty) reshuffles assignments deliberately. First matching rule wins; a rollout hit serves the treatment and a miss serves the rule's fallback variation.
One source of truth compiles to three shapes: provider-neutral JSON for an in-house evaluator, LaunchDarkly-style flag JSON with weights in 1000ths, and Unleash strategies with groupId and stickiness. Nothing calls a provider API and no SDK keys are requested.
What this tool does not do
- Simulated users are sample fixtures — paste-style bulk simulation is capped at 10k users.
- Exports are design artifacts; the tool does not push flags to any provider or validate against a live SDK.
- Multivariate weights validate to exactly 100; normalisation applies only to bucket mapping, not to the emitted weights.
How to use this tool
Define variations
Give each variation a name, value and weight; weights must total 100 before exports are enabled.
Add a targeting rule
Pick an attribute, operator and values (for example country is one of NO, SE, DK), then set the rollout percentage.
Simulate users
Read the sample-user table: each row shows country, bucket, matched rule and served variation, updated live on every change.
Export
Switch between neutral, LaunchDarkly and Unleash output, then copy or download the JSON. Import neutral JSON to continue editing.
Use cases
Rollout policy design
Prototype a staged rollout and check deterministic assignments before implementing an SDK integration.
Provider migration
Export neutral JSON from one design and compare LaunchDarkly and Unleash representations side by side.
In-house flag service
Use the neutral export plus documented bucketing algorithm as an evaluator specification.
Clause operators
| Operator | Predicate |
|---|---|
| is one of | Attribute value is in the values list |
| is not one of | Attribute value is absent from the list |
| starts with / ends with | Prefix or suffix match against values |
| gt / lt | Numeric comparison (non-numeric values compare false) |
| exists | Attribute is present, non-null and non-empty |
Bucketing: murmur3x86_32(salt + '.' + attributeValue) mod 100; LD weights are multiplied by 10.
Common mistakes
Mistake:Changing the flag key after launch with an empty salt.
Fix:An empty salt defaults to the key, so renaming the flag reshuffles every bucket. Set an explicit, permanent salt before rollout.
Mistake:Expecting provider APIs to match exactly.
Fix:The exports are provider-shaped design fragments with the exact bucketing key format documented; verify semantics against your SDK version before production use.
Mistake:Assuming later rules run after an earlier 100% rule.
Fix:First match wins. A catch-all 100% rule makes everything below it unreachable; the validator flags this.
Frequently asked questions
How is a user assigned to the rollout percentage?
The tool hashes salt + '.' + the assignment attribute value (for example userId) with murmur3 x86 32-bit, takes the hash mod 100, and compares the resulting bucket against the rollout percentage. The same input always produces the same bucket, so a user who sees the treatment once keeps seeing it. Changing the salt intentionally reshuffles assignments.
Is bucketing consistent across providers?
The algorithm is deterministic and follows the same shape as common SDK bucketing (hash mod 100), but exact compatibility depends on each provider's key prefix and seed. The neutral export documents the precise key format used here, and the LaunchDarkly and Unleash outputs are provider-shaped design fragments. Verify against your SDK version before relying on identical assignments across providers.
What is a clause versus a rule?
A clause is a single predicate over a user attribute: attribute, operator and values, such as country is one of NO, SE, DK. A rule is an ordered list of clauses plus a serve decision — either a fixed variation or a percentage rollout. All clauses in a rule must match, and the first matching rule wins; if none match, the fallback variation is served.
Can I import an existing flag?
You can round-trip the provider-neutral JSON this tool exports: paste it into the import field and the form restores variations, rules, salt and environment overrides. LaunchDarkly or Unleash JSON imports are intentionally not supported because their shape does not carry the same model — the difference is stated in the interface.
Does the tool call any provider API?
No. Everything — hashing, simulation and export — happens in your browser tab. No SDK keys or credentials are requested, and sample users are local fixtures. Exports contain flag configuration only, so they are safe to hand to a teammate or check into a repository.
References & standards
Related tools
.env Secret Safety Linter
Validate .env syntax and spot likely leaked credentials or placeholder secrets.
.gitattributes Generator
Build .gitattributes rules for line endings, Git LFS, GitHub linguist marks and merge drivers — with a one-line explanation for every rule.
.htaccess Generator
Build an Apache .htaccess — HTTPS redirects, rewrites, error pages, security headers, and basic auth
2D Fluid Dynamics & Particle Physics Sandbox
A physics playground with two engines sharing one canvas. The fluid mode runs a real Eulerian Navier-Stokes solver — semi-Lagrangian advection, explicit diffusion, Jacobi pressure projection and vorticity confinement — that you paint with dye and velocity using mouse or touch. The particle mode is a damped Verlet N-body engine with gravity wells, Coulomb attractors and repulsors, spring links, wall restitution and elastic circle collisions. Particle counts adapt to the device (100k target on WebGL2 desktop, 2k-5k on CPU fallback), and every configuration exports as runnable code: a Matter.js world, a PixiJS ticker setup, or a standalone vanilla Canvas engine.
A/B Test Sample Size Calculator
Compute required sample size per variant and test duration from baseline conversion rate, minimum detectable effect, alpha and power.
ABA Routing Number Validator
Validate 9-digit US ABA routing numbers with 3-7-1 Mod-10 breakdown.