# Room Layout Optimizer > Auto-arrange furniture in a room around doors, windows and a clear walkway. Give the room size, doors, windows and your furniture with the clearance each piece needs. A deterministic grid search places everything inside the room without overlaps, keeps door swings and a walkway clear, prefers walls and windows where requested and returns coordinates plus a text floor plan. Part of usefulweb.site (https://usefulweb.site/). Results are deterministic calculations from the inputs and the listed assumptions; the API returns exactly what the web page shows. ## Use it - Human interface: https://roomlayoutoptimizer.usefulweb.site/ (interactive tool at https://roomlayoutoptimizer.usefulweb.site/tool) - JSON API: POST https://roomlayoutoptimizer.usefulweb.site/api/v1/calculate with a JSON object of inputs (schema: https://roomlayoutoptimizer.usefulweb.site/api/v1/tool) - OpenAPI: https://roomlayoutoptimizer.usefulweb.site/openapi.json - MCP (Streamable HTTP): https://roomlayoutoptimizer.usefulweb.site/mcp - tool `room_layout_optimizer` ## Inputs - roomWidth (number, required): Room width (west → east) - roomDepth (number, required): Room depth (north → south) - gridCm (integer): Grid size - Positions snap to this grid; furniture sizes are rounded up to it. - walkwayCm (integer): Minimum walkway width - openings (table): Doors and windows - Offset is measured along the wall from its west end (north/south walls) or north end (east/west walls). - furniture (table, required): Furniture - Width = side along its back; depth = front to back. Clearance = free space needed in front (to open drawers, get into bed, sit). ## Method - The room is rasterised into grid cells (default 10 cm); furniture sizes, clearances and door zones are rounded up to whole cells, the room size down. - Each door gets a keep-clear square (door width × door width) inside the room in front of it, approximating the quarter-circle swing. - Each item can face any of the 4 directions; its body must lie inside the room and not overlap other bodies, other clearance zones or door squares; its front clearance zone must lie inside the room and not overlap bodies. "Back against wall" items must touch the wall behind them. - Walkway: the free floor is eroded by a square of the walkway width; squares connected to a door square form the reachable walkway. Every item’s clearance zone (or the cell strip in front of it) must touch that walkway. - Search: items are placed largest-area first with a beam search (4 partial layouts kept). For each layout, every valid grid position is pre-scored (wall hugging, corner use, distance to the nearest window for "prefer near window" items); the 25 best are checked for walkway access and scored. - Score = 1000 × items placed + 10 × reachable walkway m² + 2 per wall item in a corner − 3 × distance (m) of free-standing items from the nearest wall − 5 × distance (m) from window-loving items to the nearest window. Ties break by input order, then north-to-south, west-to-east position. ## Limits - Rectangles only; radiators, sockets, sloped ceilings and personal taste are not considered. Treat the result as a starting point.