Dungeon Layout Generator
Binary space partitioning splits the map in two, splits each half again, and keeps going until the pieces are room-sized. Then, as the recursion unwinds, it joins the two halves of every split with a corridor — which means every room is reachable by construction, not by a repair pass afterwards. The rooms come out pleasantly uneven, because an even split would just look like a grid.
What this generator does
Splits the map recursively, places a room in each final piece, and joins the two halves of every split with an L-shaped corridor as the recursion unwinds. It reports the room count, the corridor count and the range of room sizes.
How to use this tool
- Choose the map size and how many times to split.
- Read how many rooms and corridors came out.
- Look at the smallest and largest room to see how uneven the split was.
- Copy the map as text for a virtual tabletop.
Understanding the controls
- Map size
- Between 12 and 48 cells across. Larger maps give the splits more room before the pieces get too small to hold a room.
- Split depth
- Between 1 and 4. Each level roughly doubles the room count, and the generator stops splitting a piece that has become too small regardless.
- Seed
- Reproduces exactly the same layout, which is what a prepared session needs.
Common use cases
- Dungeon floors for a tabletop session, guaranteed fully reachable
- Showing how binary space partitioning produces layouts
- Test maps for pathfinding or room-graph code
- Battle maps with distinct rooms rather than open caves
- Reproducing the same dungeon from a seed
How this generator works
Each split cuts between 35% and 65% of the way across, which keeps the pieces uneven without producing slivers. Corridors join the centres of the two halves at every level, so connectivity follows from the recursion. The check confirms every room is actually carved into the grid and that a flood fill reaches every open cell.
Randomness and fairness
The split positions and the room placements are random; connectivity is structural. Seeded dungeons reproduce exactly and are therefore explicitly not cryptographically secure, and unseeded ones use the browser's cryptographically secure generator.
For how randomness is produced across the whole site, see how Generate Random works.
Limitations and good to know
- Corridors are L-shaped and can pass through other rooms, which makes some layouts more open than intended.
- No doors, secret passages, stairs or multi-level structure.
- Rooms are always rectangular — irregular rooms are the cave generator's territory.
- Content is not placed; this generates the layout only.
- Layouts are not stored between visits.
Privacy and your data
The dungeon is generated in your browser. Nothing about the layout or your seed leaves the page.
Related generators
- Cave Map GeneratorOrganic cave layouts from cellular-automata smoothing, with every pocket joined so the whole map is walkable.
- Maze GeneratorPrint a maze with exactly one route from start to finish — three textures from long corridors to short dead ends, any size up to 40 by 40.
- Dungeon Feature GeneratorAn environmental detail to drop into a dungeon or ruin — a hazard, mechanism or oddity, distinct from a monster or puzzle.
- Graph Traversal GeneratorThe same graph visited breadth-first and depth-first side by side, with the hop count each node sits at.
- Floor Plan GeneratorA plan of a building in metres, where the rooms cover the whole footprint with no void and no overlap, nothing is a cupboard or a corridor, and every room can be reached from the front door.