A Free NBA Lineup Optimizer for DraftKings and FanDuel

The free NBA lineup optimizer is live. It builds lineups for DraftKings and FanDuel classic contests, there is no signup, and it makes up to 150 lineups from the player file you download from the site. The last step is a CSV you upload straight back.

It is the basketball version of my MLB, NFL and NHL optimizers. Same engine, different rules on top. The NBA season opens on October 20, 2026, so the timing works.

Why it waited until October

I parked this project in September. The code was not the problem. I had no real files. DraftKings and FanDuel had not published their NBA contests yet, and the salary file is the one thing the whole tool is built around. I did not want to guess at the format and find out later that I was wrong. (Guessing at file formats is a good way to lose a weekend.)

So I waited. Both sites have now published their contests, and I built the tool from the real files. I used Claude, the AI assistant, to help build it, the same as with the other three.

How it works

You pick DraftKings or FanDuel, then upload the player list you exported from that site. That one file is all it needs. Optionally you add your own projections on top (more on that below).

Then you can trim the pool. Switch players off, lock players into every lineup, filter by salary, projection or team. Players the site lists as out start switched off, so you do not build a lineup around a guy who is not playing.

Then you set the rules and press generate. You choose how many lineups you want, up to 150, and how long the solver is allowed to think, up to 240 seconds. The salary cap is filled in from the site’s published rule, not read from your file. For me, 150 DraftKings lineups take about a minute. You download the upload CSV when it is done. You can also save your rule settings and reuse them, but they only live in your own browser.

It does classic contests only. Showdown is not supported.

What a real DraftKings file looks like

Here is the actual DraftKings file I used while building this. It is from the October 8 slate: 248 players across six games. The DraftKings NBA rules page has the official roster and scoring rules. You fill eight slots: PG, SG, SF, PF, C, G, F and UTIL, under a $50,000 cap.

Dot chart of DraftKings NBA salaries by listed position for one 248-player slate, with the median and top salary labeled for each position
Every player in the October 8 DraftKings file, by listed position. Grey dots are players, the black bar is the median, blue is the most expensive player at each position.

The shape is the same at every position. A big pile of players sits near the minimum ($3,000 is the lowest), and a handful of stars sit far above them. The median salary is only $3,600 to $4,000 at every position. The most expensive player is Victor Wembanyama at $9,400. If you spend your $50,000 evenly over eight slots, each player costs $6,250. That is a long way from the median.

Many players have two positions. A player listed PG/SG can go in the PG slot, the SG slot, the G slot or UTIL. The file says which slots each player can fill, and the optimizer follows that list. This is where doing it by hand gets slow. Move one guard from G to UTIL and a forward has to move too, and then the salary no longer adds up.

One more thing about the file. Player IDs belong to one slate. If you upload yesterday’s file for tonight’s games, the IDs will not match. Always export a fresh file.

Projections: bring your own

By default the tool uses the site’s own average points per game as the projection. I want to be plain about this: a season average is a starting point, not a forecast for tonight. It does not know who is resting or who has a good matchup.

If you have better numbers, upload them. The file needs two columns, id and projection, and the tool matches them to the players by ID. Your numbers replace the site’s. I do not sell projections and I am not going to pretend my averages are smart. Judgment about what will happen tonight is the part you should bring.

Spreading your lineups out

The diversity and exposure options work like they do in the other sports. Inside one lineup you can cap how many players come from the same team and set a minimum number of teams. Across the whole set you can set a maximum exposure for each player (the percent of lineups he can appear in), a cooldown that benches a player for a number of lineups after he is used, and a minimum number of players that must be different from earlier lineups.

Without those, 150 lineups tend to be the same lineup with one cheap guy swapped. I wrote about reading the results in the NFL optimizer post. The idea is the same here.

No stacking, on purpose

The other three optimizers have stacking. This one does not, and that is on purpose, not a missing feature. When I started the NBA work I opened a new rules file to write the stacking rules and found there was nothing to write. I explained why in NBA DFS Stacking: There Is Nothing to Stack: basketball has one ball, no batting order and no quarterback, so the rules of the game do not tie two players’ scores together.

That was only an argument, so I measured it. In NBA DFS Correlation: 3 Seasons, 500,000 Pairs I used three seasons of public box scores: 62,681 player-games and 505,721 pairs of players on the floor together. The correlations are small. Teammates in blowouts were the strongest at +0.074, and in close games they were about zero. That is far weaker than what you see in football.

I also have to admit my first version of that study was wrong. It labeled every pair of opponents as teammates, because players change teams, and it told me the opponent group had zero pairs. I caught it only because the numbers looked strange. The lesson was to check the groups before I trust the answer. I put the whole thing in the post, because I would rather you see the mistake than think I got it right the first time.

If you want to see how the optimizer thinks, Every Constraint in My Excel NBA DFS Optimizer lists every constraint in my Excel version. With no stacking, the tool leaves the rest to your projections and your exposure caps.

What comes next

One feature is planned for a later version: player variance. It comes from the same three-season study. The idea is to bound how much a lineup can bounce, not just how many points it is projected to score. Tournament lineups want more bounce, cash lineups want less. I wrote about the idea in NBA DFS Variance Without a Subscription. It is planned, not built, and I am not going to give you a date.

Until then, the tool is what it says: a salary-cap solver for NBA classic contests, with your projections and your exposure rules. The page has an optional email box if you want a note when I change it. It is not affiliated with or endorsed by DraftKings or FanDuel, and it is for entertainment. Free, no signup. Go build some lineups before the 20th: nba-lineup-optimizer.kindoflost.com.

Tradeline Supply
Things that I use, like, and am affiliated with:
Mint Mobile offers great cell phone service for $15 flat, get $15 off using the link. Get discounted phones with service activation and no contract.
I never spend money before I check Mr Rebates or Rakuten to get cashbacks, rebates, discounts, coupons or cheaper gift cards.

Leave a Reply